habitat-sim
habitat-sim copied to clipboard
--[BE][WIP] - Dataset Diagnostics and Repairs
Motivation and Context
This PR introduces a transparent dataset diagnostics protocol that can be controlled by setting flags using the optional tag "request_diagnostics" placed in the scene dataset config, followed by either an individual string or a list of strings, each specifying a desired diagnostic to be performed.
As a proof of concept, as well as to address an existing issue with the base hssd scene instances, the following tags are currently supported :
SaveCorrected: save any files that have been tested and corrected. Ignored if no tests specifiedTestForSceneInstanceDuplicates: test for duplicate rigid/articulated object instances on scene instance load, not loading duplicates if found.TestForSemanticRegionDuplicates: test for duplicate semantic region definitions on semantic attributes load, not loading duplicates if found.All: perform all diagnostic tests but do not save results to file.AllSaveCorrected: perform all diagnostic tests and save corrected configurations
This PR will perform conditional de-duplication of any loaded subconfiguration, such as Object Instances from the Scene Instance configuration file, if the appropriate test (TestForSceneInstanceDuplicates) is requested. If multiple such object instances are loaded that have identical data, then the extra duplicates will not be saved as part of the internal representation of the scene instance.
If SaveCorrected is specified, the scene instance, in this case, minus the extra duplicates, will be saved to disk. Otherwise, it will just be retained in memory for the lifetime of the execution.
This functionality is also available for SemanticAttributes/configs, should identical SemanticRegion definitions exist within the original json config description.
This PR is currently set up to prevent any duplicate SceneObjectInstanceAttributes or SceneAOInstanceAttributes from being saved when a SceneInstanceAttributes is being created for manual save to disk.
This PR also includes a renaming refactor for attributes and attributes manager base classes to fall in line with standard naming protocol and be less confusing.
Still needed :
- Tests
How Has This Been Tested
Locally c++ and python tests pass (currently transparent pass-through)
Types of changes
- [x] Docs change / refactoring / dependency upgrade
- [ ] Bug fix (non-breaking change which fixes an issue)
- [x] New feature (non-breaking change which adds functionality)
- [ ] Breaking change (fix or feature that would cause existing functionality to change)
Checklist
- [x] My code follows the code style of this project.
- [x] My change requires a change to the documentation.
- [x] I have updated the documentation accordingly.
- [x] I have read the CONTRIBUTING document.
- [x] I have completed my CLA (see CONTRIBUTING)
- [ ] I have added tests to cover my changes.
- [x] All new and existing tests passed.
So currently to request a diagnostic, say on duplicate scene object instances, you would add the following line to the scene dataset config :
"request_diagnostics":"TestForSceneInstanceDuplicates",
or
"request_diagnostics":["TestForSceneInstanceDuplicates"],
if you wanted to save the scene instances that were corrected by the diagnostic process, you would use
"request_diagnostics":["TestForSceneInstanceDuplicates", "SaveCorrected"],
and when you do not wish for any diagnostics anymore, you would just delete the line from the scene dataset config.
Other mechanisms for performing these diagnostics would be easy to implement, this was just the mechanism I started with.