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

Gibson large generation #387

Merged

Conversation

srama2512
Copy link
Contributor

@srama2512 srama2512 commented May 6, 2020

Motivation and Context

This PR adds a script to generate customized Gibson training datasets for the PointNav task. Specifically, the Gibson-2+ and Gibson-0+ training splits used in the DD-PPO paper (https://arxiv.org/abs/1911.00357) can be generated by setting the appropriate quality threshold.

How Has This Been Tested

Tested bug-free execution and the resulting data splits.

Types of changes

  • New feature (non-breaking change which adds functionality)

Checklist

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have completed my CLA (see CONTRIBUTING)
  • I have added tests to cover my changes.
  • All new and existing tests passed.

@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label May 6, 2020
@srama2512
Copy link
Contributor Author

Adding this to examples did not seem like a good idea, but I could not think of any other places for adding the script. Please let me know if there's a better organization for this.

@codecov
Copy link

codecov bot commented May 6, 2020

Codecov Report

Merging #387 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master     #387   +/-   ##
=======================================
  Coverage   76.32%   76.32%           
=======================================
  Files         108      108           
  Lines        7640     7640           
=======================================
  Hits         5831     5831           
  Misses       1809     1809           

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 814dc04...793d768. Read the comment docs.

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.

In terms of location, let's put this under a habitat_baselines/rl/ddppo/data_generation folder.

generate_pointnav_episode,
)

num_episodes_per_scene = int(1e2)
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
num_episodes_per_scene = int(1e2)
num_episodes_per_scene = int(1e4)

Should probably generate more episodes by default.

dhruvbatra pushed a commit that referenced this pull request May 10, 2020
- Use jest-image-snapshot to generate and compare snapshots
- Use puppeteer to launch chromium browser in headless mode
- Use finalhandler and static-serve to finalize requests and serve
static content easily
- Update package.json with required packages
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.

Should be good to go after correcting the filepath for the annotations file


# Load train / val statistics
dataset_statistics = json.load(
open("./examples/gibson_large_generation/gibson_dset_with_qual.json")
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
open("./examples/gibson_large_generation/gibson_dset_with_qual.json")
open(osp.join(osp.dirname(__file__), "gibson_dset_with_qual.json"), "r")

@@ -0,0 +1,87 @@
"""This script is used to generate customized Gibson training splits for the
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to add header:

more

#!/usr/bin/env python3

# Copyright (c) Facebook, Inc. and its affiliates.
# This source code is licensed under the MIT license found in the
# LICENSE file in the root directory of this source tree.

generate_pointnav_episode,
)

num_episodes_per_scene = int(1e4)
Copy link
Contributor

Choose a reason for hiding this comment

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

Const are upper case per code guidelines:

Suggested change
num_episodes_per_scene = int(1e4)
NUM_EPISODES_PER_SCENE = int(1e4)


path = "./data/datasets/pointnav/gibson/v2/train_large/train_large.json.gz"
with gzip.open(path, "wt") as f:
json.dump(dict(episodes=[]), f)
Copy link
Contributor

Choose a reason for hiding this comment

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

gibson_dset_with_qual.json should be mentioned in License part of readme as Gibson based task datasets and trained models => Gibson based task datasets and code generating it, trained models

Copy link
Contributor

@mathfac mathfac left a comment

Choose a reason for hiding this comment

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

Thank you for the contribution, several more changes left. Other than that looks good to go!

@srama2512 srama2512 requested a review from mathfac May 18, 2020 18:12
README.md Outdated Show resolved Hide resolved
Co-authored-by: dhruvbatra <dhruvbatra@users.noreply.github.com>
@erikwijmans
Copy link
Contributor

Apologies for the slowness on landing this!

@erikwijmans erikwijmans merged commit b91eb43 into facebookresearch:master Jun 8, 2020
@mathfac
Copy link
Contributor

mathfac commented Jun 8, 2020

Thank you for the contribution!

@srama2512
Copy link
Contributor Author

Glad to be of help!

dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
* added gibson large generation script

* ran black for formatting

* updated number of episodes, moved to ddppo directory

* updated license to include data generation

* added header

* changed const to upper case

* added separate function call

* Update README.md

Co-authored-by: dhruvbatra <dhruvbatra@users.noreply.github.com>

Co-authored-by: Santhosh K. Ramakrishnan <sramarki@fb.com>
Co-authored-by: dhruvbatra <dhruvbatra@users.noreply.github.com>
HHYHRHY pushed a commit to SgtVincent/habitat-lab that referenced this pull request Aug 31, 2024
* added gibson large generation script

* ran black for formatting

* updated number of episodes, moved to ddppo directory

* updated license to include data generation

* added header

* changed const to upper case

* added separate function call

* Update README.md

Co-authored-by: dhruvbatra <dhruvbatra@users.noreply.github.com>

Co-authored-by: Santhosh K. Ramakrishnan <sramarki@fb.com>
Co-authored-by: dhruvbatra <dhruvbatra@users.noreply.github.com>
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.

5 participants