Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: support training and annotating datasets with image data outside hdf5 #3

Open
lambdaloop opened this issue Aug 4, 2019 · 4 comments
Labels
enhancement New feature or request

Comments

@lambdaloop
Copy link

This seems like a great package!

From what I can tell, it seems that the TrainingGenerator and DataGenerator classes only support loading data from an hdf5 file. However, I expect this would not work with datasets which do not fit into RAM.

Would it be possible to have some way to load the image files from paths stored in the hdf5 file, rather than from the hdf5 file directly?

Thank you!

@lambdaloop lambdaloop changed the title Feature request: support training and annotating from datasets outside h5 Feature request: support training and annotating datasets with image data outside hdf5 Aug 4, 2019
@jgraving
Copy link
Owner

jgraving commented Aug 5, 2019

Hi, Thanks for your interest! However, I'm a bit confused by your feature request, so I'd appreciate if you could provide more details.

During model training and when annotating images, the image data are dynamically loaded into memory as single images or in small training batches from the HDF5 file—which is stored on the disk, not in memory—so there should be no problems with the data fitting into memory. See https://github.com/jgraving/deepposekit/blob/master/deepposekit/io/DataGenerator.py#L80 for more details.

If you'd like to use an existing dataset, we have preliminary code for converting to the deepposekit format, but we are still working to make this easier. You can find examples here: https://github.com/jgraving/deepposekit-contrib/tree/master/notebooks

That being said, the DataGenerator class could certainly be modified to support other data formats, but it's unclear to me how useful this would be vs. converting data to the existing HDF5 format.

@lambdaloop
Copy link
Author

Ah I see, thank you for clarifying!

Yes, that makes sense. I didn't realize that it was opening the HDF5 file each time to read a couple images and not loading into memory.

That said, I still think this would be a useful feature. Many existing datasets (e.g. MPII Human Pose, COCO keypoints) consist of folders with images so it would be more convenient to generate a small HDF5 file which has annotations with paths to all the images, rather than generate a huge HDF5 file with all the image data. It also makes it easier to inspect the images.

@jgraving jgraving added the enhancement New feature or request label Sep 17, 2019
@jgraving
Copy link
Owner

We've now added a (experimental) data generator for loading DeepLabCut data (see here for example: https://github.com/jgraving/DeepPoseKit/blob/master/examples/deeplacut_data_example.ipynb). The BaseGenerator class is now abstracted so writing a custom generator is possible with arbitrary data formats. (see here for example: https://github.com/jgraving/DeepPoseKit/blob/master/examples/custom_data_generator.ipynb)

The deepposekit.io API has changed quite a bit, so check out the updated examples for more details: https://github.com/jgraving/DeepPoseKit/tree/master/examples

We're still working to update and abstract the GUI and Annotator classes to work with the abstract BaseGenerator, so I'll leave this open until we get that update pushed.

@stale
Copy link

stale bot commented Oct 25, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.

@stale stale bot added the stale Issue has been inactive for 7 days label Oct 25, 2019
@jgraving jgraving added pinned Pinned as important and removed stale Issue has been inactive for 7 days labels Oct 25, 2019
@jgraving jgraving pinned this issue Nov 7, 2019
@jgraving jgraving removed the pinned Pinned as important label Nov 15, 2019
@jgraving jgraving unpinned this issue Jan 23, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants