-
Notifications
You must be signed in to change notification settings - Fork 419
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
[esp/scene] Added support of object's centers and bounding boxes to Gibson semantic scenes #407
Conversation
871ba10
to
13b58dc
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM. Minor comment on placement of json parsing function.
src/esp/gfx/Simulator.cpp
Outdated
@@ -57,6 +57,10 @@ void Simulator::reconfigure(const SimulatorConfiguration& cfg) { | |||
houseFilename = cfg.scene.filepaths.at("house"); | |||
} | |||
|
|||
if (!io::exists(houseFilename)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can avoid this by adding a "house" entry to your configuration in cfg.scene.filepaths (see line 56)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you, missed that logic.
The .obj mesh used for main gibson (what 3Dscenegraph is built from) has a rotated coordinate system when compared to the gibson gltf meshes we are using for rgb in Habitat. My utility rotates the coordinate system to match habitat and outputs to .ply semantic mesh. I transformed the bounding box info from the 3Dscenegraph .npz dataset in the same way. My goal was to have a consistent coordinated system. I verified the semantic meshes using the mesh highlighting logic we have in WebGL but did not have time before holidays to verify the bounding boxes were correct. We have coordinate flipping logic in Asset.cpp that may be relevant here:
I have not studied the above code so don't know exactly what it does. |
Codecov Report
@@ Coverage Diff @@
## master #407 +/- ##
=========================================
+ Coverage 56.02% 57.4% +1.37%
=========================================
Files 171 175 +4
Lines 7994 8170 +176
Branches 84 84
=========================================
+ Hits 4479 4690 +211
+ Misses 3515 3480 -35
Continue to review full report at Codecov.
|
@@ -19,6 +19,18 @@ namespace scene { | |||
|
|||
constexpr int kMaxIds = 10000; /* We shouldn't every need more than this. */ | |||
|
|||
namespace { | |||
vec3f jsonToVec3f(const esp::io::JsonGenericValue& jsonObject) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be removed?
// TODO(msb) add support for aabb | ||
|
||
const auto& jsonCenter = jsonObject["location"]; | ||
if (!jsonCenter.IsNull()) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code might be simpler if you checked center AND size at the top.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I want to create OBB only if at least center is available, while size can be optional.
@@ -7,6 +7,7 @@ | |||
#include <cstdint> | |||
#define RAPIDJSON_NO_INT64DEFINE | |||
#include <rapidjson/document.h> | |||
#include "esp/core/esp.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why is this include needed?
@@ -53,6 +53,9 @@ void Simulator::reconfigure(const SimulatorConfiguration& cfg) { | |||
} | |||
|
|||
std::string houseFilename = io::changeExtension(sceneFilename, ".house"); | |||
if (!io::exists(houseFilename)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this still needed? You can avoid this by adding a "house" entry to your configuration in cfg.scene.filepaths
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msbaines by default, we are not filling a "house" entry in cfg.scene.filepaths. To support same behavior for `".house" (line 55) and ".scn" that make sense to leave it. Otherwise, wider refactoring needed and there will be no that seamless experience loading MP3D with semantic scenes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Compile issue and one nit. Otherwise, LGTM.
@@ -26,6 +27,9 @@ JsonDocument parseJsonString(const std::string& jsonString); | |||
//! Return string representation of given JsonDocument | |||
std::string jsonToString(const JsonDocument& d); | |||
|
|||
//! Return Vec3f coordinates representation of given JsonObject of array type | |||
esp::vec3f jsonToVec3f(const JsonGenericValue& jsonArray); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you need to include esp/core/esp.h for esp::vec3f
src/esp/gfx/Simulator.cpp
Outdated
scene::SemanticScene::loadGibsonHouse( | ||
houseFilename, *semanticScene_, | ||
// Default World rotation for Gibson semantic data | ||
quatf::FromTwoVectors(geo::ESP_GRAVITY, -vec3f::UnitZ())); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mp3d does this as a default argument in the header file. Not sure which is better but we should try to be consistent
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@msbaines, that's great suggestion, thank you!
…arch#407) Fixed path to data directory for DDPPO objectnav config
…ibson semantic scenes (facebookresearch#407) To leverage 3dscenegraph semantic annotation spatial information added support of object's bounding boxes to Gibson semantic scenes. Related to issue facebookresearch#374 and depends on PR facebookresearch#406.
Motivation and Context
To leverage 3dscenegraph semantic annotation spatial information added support of object's bounding boxes to Gibson semantic scenes. Related to issue #374 and depends on PR #406.
How Has This Been Tested
Added the integration test and run it locally with
*.scn
data:Types of changes