-
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] initial support for Gibson semantic scene #393
Conversation
This change include a Gibson semantic scene generator and parser.
Codecov Report
@@ Coverage Diff @@
## master #393 +/- ##
==========================================
- Coverage 57.16% 55.82% -1.34%
==========================================
Files 156 170 +14
Lines 7122 7918 +796
Branches 0 82 +82
==========================================
+ Hits 4071 4420 +349
- Misses 3051 3498 +447
Continue to review full report at Codecov.
|
const std::string& houseFilename, | ||
SemanticScene& scene, | ||
const quatf& worldRotation /* = quatf::Identity() */) { | ||
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.
Cr::Utility::Directory::exists()
? IIRC the io::
APIs are obsolete and should be gradually replaced with corrade's functionality.
#include <map> | ||
#include <string> | ||
|
||
#include <Corrade/Utility/String.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.
Unused include?
ping All feedback addressed. |
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 great, some minor comments. Can we add example of command line how to run the tool.
bool SemanticScene::loadGibsonHouse( | ||
const std::string& houseFilename, | ||
SemanticScene& scene, | ||
const quatf& worldRotation /* = quatf::Identity() */) { |
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.
Do we want to uncomment default value? Looks reasonable.
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.
The default arguments are only provided in the function declaration, not in the function definition.
scene.categories_.push_back(category); | ||
object->category_ = std::move(category); | ||
} | ||
// TODO(msb) object->obb = ; |
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.
Let's add more extended comment about adding bounding boxes.
def fixCoords(entry): | ||
size = entry["size"].tolist() | ||
size[1], size[2] = size[2], size[1] | ||
entry["size"] = size |
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 entry["size"]
wasn't list, but now it is. Is that expected?
tools/npz2scn.py
Outdated
|
||
# Convert ndarrays to python lists so that we can serialize. | ||
# Tranform coordinates by rotating Y-axis to Z-axis | ||
def fixCoords(entry): |
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.
If we know entry
type we can add typing to the func, for example:
from typing import Any, Dict
def fix_coords(entry: Dict[str, Any]) -> None
tools/npz2scn.py
Outdated
|
||
|
||
# Convert ndarrays to python lists so that we can serialize. | ||
# Tranform coordinates by rotating Y-axis to Z-axis |
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.
# Tranform coordinates by rotating Y-axis to Z-axis | |
# Transform coordinates by rotating Y-axis to Z-axis |
Maybe, the comment should be:
# Transform coordinates by rotating Y-axis to -Z-axis
tools/npz2scn.py
Outdated
|
||
# Convert ndarrays to python lists so that we can serialize. | ||
# Tranform coordinates by rotating Y-axis to Z-axis | ||
def fixCoords(entry): |
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.
Based on naming convention:
def fixCoords(entry): | |
def fix_coords(entry): |
tools/npz2scn.py
Outdated
|
||
|
||
def main(): | ||
parser = argparse.ArgumentParser(description="Extract object IDs from npz.") |
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.
parser = argparse.ArgumentParser(description="Extract object IDs from npz.") | |
parser = argparse.ArgumentParser(description="Extracts object IDs from npz. Used for loading 3dscenegraph.stanford.edu semantic data.") |
tools/npz2scn.py
Outdated
for object in objects.values(): | ||
fixCoords(object) |
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.
Use of keyword object
, rename to obj
maybe.
} else { | ||
int nextCategoryIndex = scene.categories_.size(); | ||
categories[categoryName] = nextCategoryIndex++; | ||
auto category = std::make_shared<GibsonObjectCategory>(nextCategoryIndex, |
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.
nextCategoryIndex has been increased by 1.
It is NOT equal to categories[categoryName] now. Make sure if this is really what you want?
I've now addressed all feedback. |
…is missing (#406) With current code state 3dscenegraph semantic annotation files (*.scn) won't load, as our semantic loading pipeline triggers only on *.house files. To enable functionality implemented in #393 and #374 added loading of Gibson Semantics scene if MP3D semantic is missing. To test semantic loading e2e added integration test that will run only when *.scn test data is available.
…oc-in-CI Build api doc in CI
…is missing (facebookresearch#406) With current code state 3dscenegraph semantic annotation files (*.scn) won't load, as our semantic loading pipeline triggers only on *.house files. To enable functionality implemented in facebookresearch#393 and facebookresearch#374 added loading of Gibson Semantics scene if MP3D semantic is missing. To test semantic loading e2e added integration test that will run only when *.scn test data is available.
This change include a Gibson semantic scene generator and parser.
Motivation and Context
Required to support Gibson semantic mesh data.
How Has This Been Tested
Wrote a simple test.
Types of changes
Checklist