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

Added ObjectNav task definition, dataset, metrics, goal sensor #284

Merged
merged 14 commits into from
Feb 7, 2020

Conversation

mathfac
Copy link
Contributor

@mathfac mathfac commented Jan 27, 2020

Motivation and Context

Added ObjectNav task definition, dataset, metrics, goal sensor.

  • ObjectGoal Nav Task definition: metrics, goals, sensors with documentations.
  • ObjectGoal Nav Dataset definition and loading and link for downloading.
  • Topdown target objects, view points, bounding boxes visualization
  • Compatible with Benchmark API
  • Added ObjectNav DDPPO config for a baseline
  • Made PointNavDataset general enough to be inherited by other Dataset types
  • Refactored RLEnv to use measures for reward and success to speed up distance calculations
  • Added mechanism for Measures (Metrics) classes to be depend on other measure. That increased speed and calculation and decrease copy pasta. Speed improvements 2x: from 8 FPS to 15.5 FPS, compare to 40 FPS for PointGoal with same setup.
  • made SPL dependent on DistanceToGoal
  • added metrics calc to reset method for SPL and DistanceToGoal

with @Skylion007, inspired by @erikwijmans's an initial implementation.

How Has This Been Tested

  • Added the unit test.
  • Enable the task config for other general tests we have

Examples of the Object Goal Navigation Episodes:
Goal semantic category: chair
ezgif-2-d8bbee870faf
Goal semantic category: picture
ezgif-2-7bc528b0d37a
Goal semantic category: sink
ezgif-2-23a938625884
The target object is highlighted by red overlay on RGB image.

Map colors:
Red is a center of the target objet.
Green is an axes aligned bounding box of the target objet.
Red overlay zone near the target objects is view points/success zone.

Types of changes

  • Docs change / refactoring / dependency upgrade
  • New feature (non-breaking change which adds functionality)

@mathfac mathfac requested a review from erikwijmans January 27, 2020 02:58
@facebook-github-bot facebook-github-bot added the CLA Signed Do not delete this pull request or issue due to inactivity. label Jan 27, 2020
@mathfac mathfac requested review from abhiskk and msbaines January 27, 2020 02:58
configs/tasks/obj_nav_mp3d.yaml Outdated Show resolved Hide resolved
MAX_EPISODE_STEPS: 750
SIMULATOR:
TURN_ANGLE: 30
TILT_ANGLE: 30
Copy link
Contributor

Choose a reason for hiding this comment

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

We are planning to add look_up and look_down actions to the action space for the challenge? If so, we should add a max tilt angle parameter.

Copy link
Contributor

Choose a reason for hiding this comment

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

We are planning to add look_up and look_down actions to the action space for the challenge?

Yes, so the agent can see objects hanging on the wall or placed on the floor.

Copy link
Contributor

Choose a reason for hiding this comment

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

Ah, any suggestion for the max title angle then?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

-90..+90 degrees?

configs/tasks/obj_nav_mp3d.yaml Outdated Show resolved Hide resolved
habitat/tasks/nav/nav.py Outdated Show resolved Hide resolved
habitat/tasks/nav/nav.py Outdated Show resolved Hide resolved
habitat/tasks/nav/nav.py Outdated Show resolved Hide resolved
habitat/tasks/nav/object_nav_task.py Outdated Show resolved Hide resolved
habitat/tasks/nav/nav.py Outdated Show resolved Hide resolved
habitat/tasks/nav/nav.py Outdated Show resolved Hide resolved
habitat/datasets/object_nav/object_nav_dataset.py Outdated Show resolved Hide resolved
@smorad
Copy link
Contributor

smorad commented Jan 30, 2020

This is relevant to my interests, is there an associated dataset for this?

@dhruvbatra
Copy link
Contributor

Dataset and challenge details for CVPR20 challenge/workshop are coming soon.

@mathfac
Copy link
Contributor Author

mathfac commented Jan 31, 2020

Address the comments, refactored drawing functions, update the config. PR depends on #290.

@codecov-io
Copy link

codecov-io commented Jan 31, 2020

Codecov Report

Merging #284 into master will increase coverage by 0.28%.
The diff coverage is 85.71%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #284      +/-   ##
==========================================
+ Coverage   77.05%   77.33%   +0.28%     
==========================================
  Files         108      108              
  Lines        7077     7086       +9     
==========================================
+ Hits         5453     5480      +27     
+ Misses       1624     1606      -18
Impacted Files Coverage Δ
...abitat/sims/habitat_simulator/habitat_simulator.py 91.85% <ø> (-0.04%) ⬇️
examples/shortest_path_follower_example.py 97.05% <ø> (ø) ⬆️
habitat/core/utils.py 51.31% <ø> (-0.64%) ⬇️
habitat/tasks/nav/object_nav_task.py 59.25% <0%> (ø) ⬆️
test/test_sensors.py 96.29% <100%> (ø) ⬆️
habitat_baselines/common/base_trainer.py 73.91% <100%> (+0.28%) ⬆️
habitat_baselines/common/environments.py 100% <100%> (+4%) ⬆️
habitat/datasets/pointnav/pointnav_dataset.py 81.94% <100%> (ø) ⬆️
habitat/version.py 100% <100%> (ø) ⬆️
habitat/utils/visualizations/maps.py 100% <100%> (ø) ⬆️
... and 6 more

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 2041054...812df92. Read the comment docs.

@smorad
Copy link
Contributor

smorad commented Feb 3, 2020

Does "compatible with benchmark api" refer to habitat_baselines? If so, could you include the baseline .yaml you created for testing purposes?

WIDTH: 640
HEIGHT: 480
HFOV: 79
MIN_DEPTH: 0.5
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there a reason for using a MIN_DEPTH of 0.5, the default config uses a value of 0?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, that is motivated by real depth camera.

@@ -559,51 +565,95 @@ def get_original_map(self):

return top_down_map

def draw_source_and_target(self, episode):
Copy link
Contributor

Choose a reason for hiding this comment

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

Just to double check, what exactly is the reason for getting rid of this method. From what I can tell by default the target point is drawn always and there is a config parameter to control drawing of the source point.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It was broke into _draw_point and _draw_goals_positions as we start drawing more sophisticated goals.

habitat/core/utils.py Show resolved Hide resolved
habitat/core/utils.py Show resolved Hide resolved
"""

# Version of JSON library that encoder is compatible with.
__version__ = "2.0.9"
Copy link
Contributor

Choose a reason for hiding this comment

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

How is this __version__ being used, maybe rename it to version_compatible, __version__ is mostly used to indicate the version of package (which in this case is habitat).

)

assert set(self.category_to_task_category_id.keys()) == set(
self.category_to_mp3d_category_id.keys()
Copy link
Contributor

Choose a reason for hiding this comment

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

Should we have Matterport3d (mp3d) specific variable names here, is this implementation dataset (Matterport3D, Gibson) agnostic?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's good question. We can change category_to_mp3d_category_id to category_to_scene_annotation_category_id and then use scene dataset type for further category conversions. cc @Skylion007

@@ -614,7 +664,7 @@ def reset_metric(self, *args: Any, episode, **kwargs: Any):
self._coordinate_min,
self._coordinate_max,
self._map_resolution,
)[::-1]
Copy link
Contributor

Choose a reason for hiding this comment

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

What is the reason for getting rid of the list reversal here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Because, maps.draw_path method was changed that switching x and y isn't needed anymore. That makes maps.draw_path easier to use.

@@ -47,6 +49,8 @@
TOP_DOWN_MAP_COLORS[MAP_SOURCE_POINT_INDICATOR] = [0, 0, 200]
TOP_DOWN_MAP_COLORS[MAP_TARGET_POINT_INDICATOR] = [200, 0, 0]
TOP_DOWN_MAP_COLORS[MAP_SHORTEST_PATH_COLOR] = [0, 200, 0]
TOP_DOWN_MAP_COLORS[MAP_VIEW_POINT_INDICATOR] = [245, 150, 150]
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: if possible add color names here, it would be useful for someone reading the codebase.

@mathfac
Copy link
Contributor Author

mathfac commented Feb 6, 2020

  • Added ObjectNav DDPPO config for a baseline cc @smorad
  • Updated the config to converged version for ObjectNav
  • Made PointNavDataset general enough to be inherited
  • Refactored RLEnv to use measures for reward and success to speed up distance calculations
  • Added mechanisms for measures to depend on other measure. That increased speed and calculation and decrease copy pasta. Speed improvements 2x: from 8 FPS to 15.5 FPS, compare to 40 FPS for PointGoal with same setup.
  • made SPL dependent on DistanceToGoal
  • added metrics calc to reset method for SPL and DistanceToGoal

…endent on DistToGoal, added metrics calc to reset method
@mathfac
Copy link
Contributor Author

mathfac commented Feb 6, 2020

  • Added doc to FloatJSON encoder,
  • Added color names
  • Removed mp3d mentioning from ObjectNavDataset class

VIDEO_OPTION: ["disk", "tensorboard"]
TENSORBOARD_DIR: "/checkpoint/maksymets/logs/habitat_baselines/ddppo/obj_nav_mp3d"
VIDEO_DIR: "data/video_dir"
TEST_EPISODE_COUNT: 2
Copy link
Contributor

Choose a reason for hiding this comment

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

Let's put the actual number of val episodes here. It is hard to figure out what number should go here when you want to evaluate on everything otherwise.

Copy link
Contributor

@abhiskk abhiskk left a comment

Choose a reason for hiding this comment

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

LGTM 👍

@mathfac mathfac merged commit f5e29c6 into master Feb 7, 2020
@mathfac mathfac deleted the object_nav_task branch February 7, 2020 19:05
@erikwijmans erikwijmans mentioned this pull request Mar 12, 2020
@dhruvbatra dhruvbatra mentioned this pull request Apr 13, 2020
7 tasks
dannymcy pushed a commit to dannymcy/habitat-lab that referenced this pull request Jul 8, 2024
…ookresearch#284)

Added ObjectNav task definition, dataset, metrics, goal sensor.
ObjectGoal Nav Task definition: metrics, goals, sensors with documentations.
ObjectGoal Nav Dataset definition and loading and link for downloading.
Topdown target objects, view points, bounding boxes visualization
Compatible with Benchmark API
Added ObjectNav DDPPO config for a baseline
Made PointNavDataset general enough to be inherited by other Dataset types
Refactored RLEnv to use measures for reward and success to speed up distance calculations
Added mechanism for Measures (Metrics) classes to be depend on other measure. That increased speed and calculation and decrease copy pasta. Speed improvements 2x: from 8 FPS to 15.5 FPS, compare to 40 FPS for PointGoal with same setup.
made SPL dependent on DistanceToGoal
added metrics calc to reset method for SPL and DistanceToGoal
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.

7 participants