Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Habitat Lab
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mirrored_repos
MachineLearning
Meta Research
Habitat Lab
Commits
4d7d8b32
Commit
4d7d8b32
authored
5 years ago
by
Oleksandr Maksymets
Browse files
Options
Downloads
Patches
Plain Diff
Added doc to FloatJSON encoder, added color names, removed mp3d mentioning from ObjectNavDataset
parent
bcfb573e
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
habitat/core/utils.py
+5
-5
5 additions, 5 deletions
habitat/core/utils.py
habitat/datasets/object_nav/object_nav_dataset.py
+9
-4
9 additions, 4 deletions
habitat/datasets/object_nav/object_nav_dataset.py
habitat/utils/visualizations/maps.py
+8
-8
8 additions, 8 deletions
habitat/utils/visualizations/maps.py
with
22 additions
and
17 deletions
habitat/core/utils.py
+
5
−
5
View file @
4d7d8b32
...
...
@@ -12,6 +12,8 @@ import quaternion
from
habitat.utils.geometry_utils
import
quaternion_to_list
# Internals from inner json library needed for patching functionality in
# DatasetFloatJSONEncoder.
try
:
from
_json
import
encode_basestring_ascii
except
ImportError
:
...
...
@@ -108,12 +110,10 @@ def center_crop(obs, new_shape):
class
DatasetFloatJSONEncoder
(
json
.
JSONEncoder
):
r
"""
JSON Encoder that sets a float precision for a space saving purpose and
encodes ndarray and quaternion. The encoder is compatible with JSON
version 2.0.9.
"""
JSON Encoder that set float precision for space saving purpose.
"""
# Version of JSON library that encoder is compatible with.
__version__
=
"
2.0.9
"
def
default
(
self
,
object
):
# JSON doesn't support numpy ndarray and quaternion
...
...
This diff is collapsed.
Click to expand it.
habitat/datasets/object_nav/object_nav_dataset.py
+
9
−
4
View file @
4d7d8b32
...
...
@@ -25,7 +25,7 @@ class ObjectNavDatasetV1(PointNavDatasetV1):
r
"""
Class inherited from PointNavDataset that loads Object Navigation dataset.
"""
category_to_task_category_id
:
Dict
[
str
,
int
]
category_to_
mp3d
_category_id
:
Dict
[
str
,
int
]
category_to_
scene_annotation
_category_id
:
Dict
[
str
,
int
]
episodes
:
List
[
NavigationEpisode
]
content_scenes_path
:
str
=
"
{data_path}/content/{scene}.json.gz
"
...
...
@@ -45,17 +45,22 @@ class ObjectNavDatasetV1(PointNavDatasetV1):
"
category_to_task_category_id
"
]
if
"
category_to_scene_annotation_category_id
"
in
deserialized
:
self
.
category_to_scene_annotation_category_id
=
deserialized
[
"
category_to_scene_annotation_category_id
"
]
if
"
category_to_mp3d_category_id
"
in
deserialized
:
self
.
category_to_
mp3d
_category_id
=
deserialized
[
self
.
category_to_
scene_annotation
_category_id
=
deserialized
[
"
category_to_mp3d_category_id
"
]
assert
len
(
self
.
category_to_task_category_id
)
==
len
(
self
.
category_to_
mp3d
_category_id
self
.
category_to_
scene_annotation
_category_id
)
assert
set
(
self
.
category_to_task_category_id
.
keys
())
==
set
(
self
.
category_to_
mp3d
_category_id
.
keys
()
self
.
category_to_
scene_annotation
_category_id
.
keys
()
),
"
category_to_task and category_to_mp3d must have the same keys
"
for
episode
in
deserialized
[
"
episodes
"
]:
...
...
This diff is collapsed.
Click to expand it.
habitat/utils/visualizations/maps.py
+
8
−
8
View file @
4d7d8b32
...
...
@@ -43,14 +43,14 @@ TOP_DOWN_MAP_COLORS = np.full((256, 3), 150, dtype=np.uint8)
TOP_DOWN_MAP_COLORS
[
10
:]
=
cv2
.
applyColorMap
(
np
.
arange
(
246
,
dtype
=
np
.
uint8
),
cv2
.
COLORMAP_JET
).
squeeze
(
1
)[:,
::
-
1
]
TOP_DOWN_MAP_COLORS
[
MAP_INVALID_POINT
]
=
[
255
,
255
,
255
]
TOP_DOWN_MAP_COLORS
[
MAP_VALID_POINT
]
=
[
150
,
150
,
150
]
TOP_DOWN_MAP_COLORS
[
MAP_BORDER_INDICATOR
]
=
[
50
,
50
,
50
]
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
]
TOP_DOWN_MAP_COLORS
[
MAP_TARGET_BOUNDING_BOX
]
=
[
0
,
175
,
0
]
TOP_DOWN_MAP_COLORS
[
MAP_INVALID_POINT
]
=
[
255
,
255
,
255
]
# White
TOP_DOWN_MAP_COLORS
[
MAP_VALID_POINT
]
=
[
150
,
150
,
150
]
# Light Grey
TOP_DOWN_MAP_COLORS
[
MAP_BORDER_INDICATOR
]
=
[
50
,
50
,
50
]
# Grey
TOP_DOWN_MAP_COLORS
[
MAP_SOURCE_POINT_INDICATOR
]
=
[
0
,
0
,
200
]
# Blue
TOP_DOWN_MAP_COLORS
[
MAP_TARGET_POINT_INDICATOR
]
=
[
200
,
0
,
0
]
# Red
TOP_DOWN_MAP_COLORS
[
MAP_SHORTEST_PATH_COLOR
]
=
[
0
,
200
,
0
]
# Green
TOP_DOWN_MAP_COLORS
[
MAP_VIEW_POINT_INDICATOR
]
=
[
245
,
150
,
150
]
# Light Red
TOP_DOWN_MAP_COLORS
[
MAP_TARGET_BOUNDING_BOX
]
=
[
0
,
175
,
0
]
# Green
def
draw_agent
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment