-
Notifications
You must be signed in to change notification settings - Fork 419
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
Tutorial for image data extraction #518
Conversation
Codecov Report
@@ Coverage Diff @@
## master #518 +/- ##
=======================================
Coverage 61.54% 61.54%
=======================================
Files 166 166
Lines 7594 7594
Branches 84 84
=======================================
Hits 4674 4674
Misses 2920 2920
Continue to review full report at Codecov.
|
Co-Authored-By: Erik Wijmans <etw@gatech.edu>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Couple little comments. One other request if you think it'll be easy to do: Can you copy-paste the python code into a python file and then run black on it (that way it'll look like the rest of the code in habitat-sim).
docs/pages/image-extractor.rst
Outdated
|
||
|
||
dataset = HabitatDataset(extractor) | ||
dataloader = DataLoader(dataset, batch_size=2) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Worth mentioning that num_workers
must be set to 0
currently.
docs/pages/image-extractor.rst
Outdated
from habitat_sim.utils.data.data_extractor import ImageExtractor | ||
|
||
# Give the extractor a path to the scene | ||
scene_filepath = "../data/scene_datasets/habitat-test-scenes/skokloster-castle.glb" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
scene_filepath = "../data/scene_datasets/habitat-test-scenes/skokloster-castle.glb" | |
scene_filepath = "data/scene_datasets/habitat-test-scenes/skokloster-castle.glb" |
docs/pages/image-extractor.rst
Outdated
def __getitem__(self, idx): | ||
sample = self.extractor[idx] | ||
output = { | ||
'rgb': sample['rgba'].astype(np.float32)[..., :-1], # dataloader requires certain types |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Since you converting to float, also a good idea to divide by 255.0
(people expect float images to have pixel values in [0, 1])
* added tutorial for image data extraction * Update docs/pages/image-extractor.rst Co-Authored-By: Erik Wijmans <etw@gatech.edu> * formatting Co-authored-by: Michael Piseno <mpiseno@fb.com> Co-authored-by: Erik Wijmans <etw@gatech.edu>
Motivation and Context
Added a tutorial to the doc/pages/ directory that explains how to use the ImageExtractor class in habitat sim to generate image data.
How Has This Been Tested
Types of changes