Custom ItemBase and ItemList needed or not?

I am doing machine learning on vector based images instead of raster based images. For now, it is images made up of only lines. My input data is many rows of x,y start point and x,y end point pairs for each line. For example:

0 15 22 75 li
100 10 2 17 li
...

The above represents an image with two lines. The first line starts at 0, 15 and ends at 22, 75. None of the existing fastai data types seem suitable for this type of data. Which leads me to believe I need to create my own ItemBase and ItemList classes?

I made an initial attempt at my own ItemBase and ItemList, but am still having some problems with them, so before fixing things I want to understand if I am heading in the right direction.

What I have done so far:

  • My ItemList uses pandas and read_cvs to get the data in its open method. I have to do quite a bit of removal of headers and other footers in read_cvs to clean up the data.
  • Because images of the same dimensions can have a few drawn lines of many lines, I am zero padding with extra rows to make all images the same number of lines.
  • I want to be able to set this number of lines somewhere but so far I have not been able to figure out how to do that with my custom VectorImageList or custom VectorImageDataBunch. The from_folder method does not seem suitable for passing a parameter that eventually gets passed to VectorImageList.get.
  • I do have a custom showBatch working. matplotlib works well to plot lines, so that’s easy.
  • I am not sure what type of model I should be using in my learner for this type of data.

My eventual goal is to use these vector based images in a GAN. But for now, even getting a simple image classification working would be a big win. I already have a working Pytorch based GAN that does train well, but it takes a very long time. So I am hoping to use all the bells and whistles that fastai offers to make it train faster and more accurately. Any help is appreciated.