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

Tutorial for image data extraction #518

Merged
merged 4 commits into from
Mar 18, 2020
Merged

Conversation

mpiseno
Copy link

@mpiseno mpiseno commented Mar 5, 2020

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

  • Docs change / refactoring / dependency upgrade

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Mar 5, 2020
@mpiseno mpiseno requested a review from mathfac March 5, 2020 00:50
@codecov
Copy link

codecov bot commented Mar 5, 2020

Codecov Report

Merging #518 into master will not change coverage by %.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #518   +/-   ##
=======================================
  Coverage   61.54%   61.54%           
=======================================
  Files         166      166           
  Lines        7594     7594           
  Branches       84       84           
=======================================
  Hits         4674     4674           
  Misses       2920     2920           
Flag Coverage Δ
#CPP 56.68% <ø> (ø)
#JavaScript 10.00% <ø> (ø)
#Python 80.75% <ø> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4d59a56...b59c14e. Read the comment docs.

@mpiseno mpiseno requested review from erikwijmans, abhiskk and mathfac and removed request for mathfac March 12, 2020 23:31
Co-Authored-By: Erik Wijmans <etw@gatech.edu>
Copy link
Contributor

@erikwijmans erikwijmans left a 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).



dataset = HabitatDataset(extractor)
dataloader = DataLoader(dataset, batch_size=2)
Copy link
Contributor

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.

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"
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
scene_filepath = "../data/scene_datasets/habitat-test-scenes/skokloster-castle.glb"
scene_filepath = "data/scene_datasets/habitat-test-scenes/skokloster-castle.glb"

def __getitem__(self, idx):
sample = self.extractor[idx]
output = {
'rgb': sample['rgba'].astype(np.float32)[..., :-1], # dataloader requires certain types
Copy link
Contributor

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])

@mpiseno mpiseno merged commit 3ad27bf into master Mar 18, 2020
@mpiseno mpiseno deleted the data-extraction-tutorial branch March 18, 2020 04:27
Ram81 pushed a commit to Ram81/habitat-web-sim that referenced this pull request Dec 10, 2020
* 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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Do not delete this pull request or issue due to inactivity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants