Skip to content
Merged
Show file tree
Hide file tree
Changes from 47 commits
Commits
Show all changes
50 commits
Select commit Hold shift + click to select a range
1f192ce
minor
bigbike Apr 29, 2021
affa6f8
minor
bigbike Apr 29, 2021
e9ea1ce
minor
bigbike Apr 29, 2021
bf01d9a
minor
bigbike Apr 29, 2021
cd10d64
Merge branch 'master' into semantic-tex
bigbike Apr 29, 2021
78e3765
minor
bigbike Apr 29, 2021
2ed0929
minor
bigbike Apr 29, 2021
7564dab
minor
bigbike Apr 30, 2021
fe53e35
Merge branch 'semantic-tex' into viz-semantic
bigbike Apr 30, 2021
f751333
minor
bigbike Apr 30, 2021
8da2f88
Merge branch 'master' into viz-semantic
bigbike Apr 30, 2021
4aaed1b
minor
bigbike Apr 30, 2021
f7bfe14
minor
bigbike Apr 30, 2021
db0f8a0
minor
bigbike Apr 30, 2021
dd3a6d3
minor
bigbike Apr 30, 2021
0d93c7a
minor
bigbike Apr 30, 2021
97e715e
Merge branch 'viz-semantic' into semantic-fisheye
bigbike Apr 30, 2021
73837f1
add equiRec semantic
bigbike Apr 30, 2021
3ce5ecf
minor
bigbike Apr 30, 2021
d7879de
fix a bug
bigbike Apr 30, 2021
6d62ab3
minor
bigbike May 1, 2021
c89ceaa
address the complaints from the stupid clang-tidy
bigbike May 1, 2021
3eab549
Merge branch 'master' into semantic-fisheye
bigbike May 4, 2021
ce0a40f
Merge branch 'master' into semantic-fisheye
bigbike May 5, 2021
8be98a7
minor
bigbike May 5, 2021
c8f4886
minor
bigbike May 7, 2021
1c98916
minor
bigbike May 7, 2021
de40925
GoPro
bigbike May 7, 2021
012bf1b
Merge branch 'master' into semantic-fisheye
bigbike May 8, 2021
7eb64b3
Upgrade exotic sensor tests
Skylion007 May 10, 2021
a5b020e
Merge branch 'master' of https://github.com/facebookresearch/habitat-…
Skylion007 May 10, 2021
c8bc93f
Fix semantic bug
Skylion007 May 10, 2021
8a6f785
Remove redundant assert
Skylion007 May 10, 2021
7a7010d
Merge branch 'master' into semantic-fisheye
bigbike May 11, 2021
54323ae
Update src/utils/viewer/viewer.cpp
bigbike May 11, 2021
5d7662d
Merge branch 'semantic-fisheye' of github.com:facebookresearch/habita…
bigbike May 11, 2021
c893e42
minor
bigbike May 11, 2021
2341fd7
Add ortho sensor_spec gen function
Skylion007 May 11, 2021
05afdf9
Merge branch 'semantic-fisheye' of https://github.com/facebookresearc…
Skylion007 May 11, 2021
7efe3be
Revert regression
Skylion007 May 11, 2021
facc16f
Fix settings
Skylion007 May 11, 2021
1019822
Revert bug
Skylion007 May 11, 2021
acc5061
Remove all references to channels for now
Skylion007 May 11, 2021
f38391e
Fix comments
Skylion007 May 11, 2021
ed08b13
Further simplify
Skylion007 May 11, 2021
7a3c870
Merge branch 'master' of https://github.com/facebookresearch/habitat-…
Skylion007 May 12, 2021
3d2f081
Add channels backend
Skylion007 May 12, 2021
c5ba54d
Drop channels again
Skylion007 May 12, 2021
82fabeb
Rename RGBA_sensors
Skylion007 May 12, 2021
1784c65
Add channels=1 for depth and semantic only
Skylion007 May 12, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
149 changes: 102 additions & 47 deletions examples/settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,15 @@
"color_sensor": True, # RGB sensor (default: ON)
"semantic_sensor": False, # semantic sensor (default: OFF)
"depth_sensor": False, # depth sensor (default: OFF)
"ortho_sensor": False, # Orthographic RGB sensor (default: OFF)
"ortho_rgb_sensor": False, # Orthographic RGB sensor (default: OFF)
Comment thread
Skylion007 marked this conversation as resolved.
Outdated
"ortho_depth_sensor": False, # Orthographic depth sensor (default: OFF)
"ortho_semantic_sensor": False, # Orthographic semantic sensor (default: OFF)
"fisheye_rgb_sensor": False,
"fisheye_depth_sensor": False,
"fisheye_semantic_sensor": False,
"equirect_rgb_sensor": False,
"equirect_depth_sensor": False,
"equirect_semantic_sensor": False,
"seed": 1,
"silent": False, # do not print log info (default: OFF)
# settings exclusive to example.py
Expand Down Expand Up @@ -65,65 +69,92 @@ def make_cfg(settings):

# define default sensor parameters (see src/esp/Sensor/Sensor.h)
sensor_specs = []

def create_camera_spec(**kw_args):
camera_sensor_spec = habitat_sim.CameraSensorSpec()
camera_sensor_spec.sensor_type = habitat_sim.SensorType.COLOR
camera_sensor_spec.resolution = [settings["height"], settings["width"]]
camera_sensor_spec.position = [0, settings["sensor_height"], 0]
for k in kw_args:
setattr(camera_sensor_spec, k, kw_args[k])
return camera_sensor_spec

if settings["color_sensor"]:
color_sensor_spec = habitat_sim.CameraSensorSpec()
color_sensor_spec.uuid = "color_sensor"
color_sensor_spec.sensor_type = habitat_sim.SensorType.COLOR
color_sensor_spec.resolution = [settings["height"], settings["width"]]
color_sensor_spec.position = [0, settings["sensor_height"], 0]
color_sensor_spec.hfov = settings["hfov"]
color_sensor_spec.sensor_subtype = habitat_sim.SensorSubType.PINHOLE
color_sensor_spec = create_camera_spec(
uuid="color_sensor",
channels=4,
hfov=settings["hfov"],
sensor_type=habitat_sim.SensorType.COLOR,
sensor_subtype=habitat_sim.SensorSubType.PINHOLE,
)
sensor_specs.append(color_sensor_spec)

if settings["depth_sensor"]:
depth_sensor_spec = habitat_sim.CameraSensorSpec()
depth_sensor_spec.uuid = "depth_sensor"
depth_sensor_spec.sensor_type = habitat_sim.SensorType.DEPTH
depth_sensor_spec.resolution = [settings["height"], settings["width"]]
depth_sensor_spec.position = [0, settings["sensor_height"], 0]
depth_sensor_spec.hfov = settings["hfov"]
depth_sensor_spec.sensor_subtype = habitat_sim.SensorSubType.PINHOLE
depth_sensor_spec = create_camera_spec(
uuid="depth_sensor",
channels=1,
hfov=settings["hfov"],
sensor_type=habitat_sim.SensorType.DEPTH,
sensor_subtype=habitat_sim.SensorSubType.PINHOLE,
)
sensor_specs.append(depth_sensor_spec)

if settings["semantic_sensor"]:
semantic_sensor_spec = habitat_sim.CameraSensorSpec()
semantic_sensor_spec.uuid = "semantic_sensor"
semantic_sensor_spec.sensor_type = habitat_sim.SensorType.SEMANTIC
semantic_sensor_spec.resolution = [settings["height"], settings["width"]]
semantic_sensor_spec.position = [0, settings["sensor_height"], 0]
semantic_sensor_spec.hfov = settings["hfov"]
semantic_sensor_spec.sensor_subtype = habitat_sim.SensorSubType.PINHOLE
semantic_sensor_spec = create_camera_spec(
uuid="semantic_sensor",
channels=1,
hfov=settings["hfov"],
sensor_type=habitat_sim.SensorType.SEMANTIC,
sensor_subtype=habitat_sim.SensorSubType.PINHOLE,
)
sensor_specs.append(semantic_sensor_spec)

if settings["ortho_sensor"]:
ortho_sensor_spec = habitat_sim.CameraSensorSpec()
ortho_sensor_spec.uuid = "ortho_sensor"
ortho_sensor_spec.sensor_type = habitat_sim.SensorType.COLOR
ortho_sensor_spec.resolution = [settings["height"], settings["width"]]
ortho_sensor_spec.position = [0, settings["sensor_height"], 0]
ortho_sensor_spec.sensor_subtype = habitat_sim.SensorSubType.ORTHOGRAPHIC
sensor_specs.append(ortho_sensor_spec)
if settings["ortho_rgb_sensor"]:
Comment thread
Skylion007 marked this conversation as resolved.
Outdated
ortho_rgb_sensor_spec = create_camera_spec(
uuid="ortho_rgb_sensor",
channels=4,
sensor_type=habitat_sim.SensorType.COLOR,
sensor_subtype=habitat_sim.SensorSubType.ORTHOGRAPHIC,
)
sensor_specs.append(ortho_rgb_sensor_spec)

if settings["ortho_depth_sensor"]:
ortho_depth_sensor_spec = create_camera_spec(
uuid="ortho_depth_sensor",
channels=1,
sensor_type=habitat_sim.SensorType.DEPTH,
sensor_subtype=habitat_sim.SensorSubType.ORTHOGRAPHIC,
)
sensor_specs.append(ortho_depth_sensor_spec)

if settings["ortho_semantic_sensor"]:
ortho_semantic_sensor_spec = create_camera_spec(
uuid="ortho_semantic_sensor",
channels=1,
sensor_type=habitat_sim.SensorType.SEMANTIC,
sensor_subtype=habitat_sim.SensorSubType.ORTHOGRAPHIC,
)
sensor_specs.append(ortho_semantic_sensor_spec)

# TODO Figure out how to implement copying of specs
def create_fisheye_spec(**kw_args):
fisheye_sensor_spec = habitat_sim.FisheyeSensorDoubleSphereSpec()
fisheye_sensor_spec.uuid = "fisheye_sensor"
fisheye_sensor_spec.channels = 4
fisheye_sensor_spec.sensor_type = habitat_sim.SensorType.COLOR
fisheye_sensor_spec.sensor_model_type = (
habitat_sim.FisheyeSensorModelType.DOUBLE_SPHERE
)

# The default value (alpha, xi) is set to match the lens "BF2M2020S23" found in Table 3 of this paper:
# The default value (alpha, xi) is set to match the lens "GoPro" found in Table 3 of this paper:
Comment thread
Skylion007 marked this conversation as resolved.
# Vladyslav Usenko, Nikolaus Demmel and Daniel Cremers: The Double Sphere
# Camera Model, The International Conference on 3D Vision (3DV), 2018
# You can find the intrinsic parameters for the other lenses in the same table as well.
# fisheye_sensor_spec.alpha = 0.59 # default
# fisheye_sensor_spec.xi = -0.18 # default
fisheye_sensor_spec.xi = -0.27
fisheye_sensor_spec.alpha = 0.57
fisheye_sensor_spec.focal_length = [364.84, 364.86]
Comment thread
Skylion007 marked this conversation as resolved.

fisheye_sensor_spec.resolution = [settings["height"], settings["width"]]
fisheye_sensor_spec.focal_length = [
min(settings["height"], settings["width"]) * 0.5
] * 2
# The default principal_point_offset is the middle of the image
fisheye_sensor_spec.principal_point_offset = mn.Vector2(
settings["height"] // 2,
Expand All @@ -139,26 +170,50 @@ def create_fisheye_spec(**kw_args):
sensor_specs.append(fisheye_rgb_sensor_spec)
if settings["fisheye_depth_sensor"]:
fisheye_depth_sensor_spec = create_fisheye_spec(
uuid="fisheye_depth_sensor", sensor_type=habitat_sim.SensorType.DEPTH
uuid="fisheye_depth_sensor",
channels=1,
sensor_type=habitat_sim.SensorType.DEPTH,
)
sensor_specs.append(fisheye_depth_sensor_spec)
if settings["fisheye_semantic_sensor"]:
fisheye_semantic_sensor_spec = create_fisheye_spec(
uuid="fisheye_semantic_sensor",
channels=1,
sensor_type=habitat_sim.SensorType.SEMANTIC,
)
sensor_specs.append(fisheye_semantic_sensor_spec)

def create_equirect_spec(**kw_args):
Comment thread
bigbike marked this conversation as resolved.
equirect_sensor_spec = habitat_sim.EquirectangularSensorSpec()
equirect_sensor_spec.uuid = "equirect_rgb_sensor"
equirect_sensor_spec.channels = 4
equirect_sensor_spec.sensor_type = habitat_sim.SensorType.COLOR
equirect_sensor_spec.resolution = [settings["height"], settings["width"]]
equirect_sensor_spec.position = [0, settings["sensor_height"], 0]
for k in kw_args:
setattr(equirect_sensor_spec, k, kw_args[k])
return equirect_sensor_spec

if settings["equirect_rgb_sensor"]:
equirect_rgb_sensor_spec = habitat_sim.EquirectangularSensorSpec()
equirect_rgb_sensor_spec.uuid = "equirect_rgb_sensor"
equirect_rgb_sensor_spec.sensor_type = habitat_sim.SensorType.COLOR
equirect_rgb_sensor_spec.resolution = [settings["height"], settings["width"]]
equirect_rgb_sensor_spec.position = [0, settings["sensor_height"], 0]
equirect_rgb_sensor_spec = create_equirect_spec(uuid="equirect_rgb_sensor")
sensor_specs.append(equirect_rgb_sensor_spec)

if settings["equirect_depth_sensor"]:
equirect_depth_sensor_spec = habitat_sim.EquirectangularSensorSpec()
equirect_depth_sensor_spec.uuid = "equirect_depth_sensor"
equirect_depth_sensor_spec.sensor_type = habitat_sim.SensorType.DEPTH
equirect_depth_sensor_spec.resolution = [settings["height"], settings["width"]]
equirect_depth_sensor_spec.position = [0, settings["sensor_height"], 0]
equirect_depth_sensor_spec = create_equirect_spec(
uuid="equirect_depth_sensor",
channels=1,
sensor_type=habitat_sim.SensorType.DEPTH,
)
sensor_specs.append(equirect_depth_sensor_spec)

if settings["equirect_semantic_sensor"]:
equirect_semantic_sensor_spec = create_equirect_spec(
uuid="equirect_semantic_sensor",
channels=1,
sensor_type=habitat_sim.SensorType.SEMANTIC,
)
sensor_specs.append(equirect_semantic_sensor_spec)

# create agent specifications
agent_cfg = habitat_sim.agent.AgentConfiguration()
agent_cfg.sensor_specifications = sensor_specs
Expand Down
Loading