Code repository for THOR presented in Persistent Homology Meets Object Unity: Object Recognition in Clutter (and the framework presented in Topologically Persistent Features-based Object Recognition in Cluttered Indoor Environments).
The UW Indoor Scenes (UW-IS) Occluded Dataset proposed in the above paper for systematically evaluating object recognition methods under varying environmental conditions can be found here. This dataset, which is recorded using commodity hardware, consists of two different indoor environments, multiple lighting conditions, and multiple degrees of clutter.
- Panda3D
- Open3D
- persim 0.3.1
- scikit-learn
- Keras
- Platform: This code has been tested on Ubuntu 18.04 (except synthetic data generation using Panda3D, which is done on a computer running Windows 10).
-
-
Follow instructions from here to install Panda3D for synthetic data generation. Create a new folder
syndata
in the directory where Panda3D is installed and placegenerateSyntheticData.py
from the training folder in this repository into thesyndata
folder. Create subfoldersmodels
anddata
inside thesyndata
folder. Withinmodels
, create subfolders for all objects and place respective object meshes and texture maps inside them. Obtain synthetic depth images from the object meshes using Panda3D using the following command.python generateSyntheticData.py --obj_name <obj_name> --h <h> --p <p> --r <r>
<obj_name>
is the name of object for which data is to be generated, and the parametersh
,p
, andr
are set to reorient the object mesh as required (details in the paper) before rendering. This command will create synthetic depth (and RGB) images for the object under a subfolder<obj_name>
inside thedata
folder. -
From within the THOR directory run the following to generate point clouds corresponding to all the generated depth images.
python3 training/getPCDsFromSyntheticData.py --data_path <path_to_data_folder_from_step_i>
-
From within the THOR directory run the following to perform view normalization on the generated point clouds.
python3 training/saveAllViewNormalizedPCDs.py --data_path <path_to_data_folder_from_step_i>
-
From within the THOR directory run the following to generate Persistence Images (PIs) for the TOPS descriptor of all the point clouds.
python3 training/computePIsFromViewNormalizedPCDs.py --data_path <path_to_data_folder_from_step_i>
A subfolder named
libpis
containing all the PIs will be generated inside thetraining
folder . -
Run the following to train an SVM library using the TOPS descriptors obtained from the computed PIs. (Add the path to the data folder from step i in
trainSVMLibrary.sh
as indicated).cd training sh trainSVMLibrary.sh
Alternatively, to train an MLP library run the following. (Add the path to the data folder from step i in
trainMLPLibrary.sh
as indicated).cd training sh trainMLPLibrary.sh
A folder
librarymodels
will be created inside thetraining
directory and trained models will be stored in it.
-
-
-
Download the UWISOccludedDataset.zip from here and unzip it. Place
reogranizeUWISOccluded.sh
inside theUWISOccludedDataset
folder and run the following from within that folder.sh reorganizeUWISOccluded.sh
-
Run the following to test THOR
-
Using an SVM library:
cd testing sh testUWISOccludedSVMLibrary.sh
Note that in the
testUWISOccludedSVMLibrary.sh
script<environment_name>
must be replaced with one ofwarehouse
,lounge
, orboth
as desired. Similarly<category_name>
can bekitchen
,food
,tools
orall
;<separation>
can belevel1
,level2
,level3
oralllevels
;<light>
can be1
,2
, orboth
. Also provide the path to the UW-IS Occluded dataset folder from the previous step, and the path to the folder containing saved SVM models.A subfolder named
predictions
is created in thetesting
folder and predictions for every video will be saved as a.txt
file. Corresponding ground truth will be saved in a newly createdgroundtruth
subfolder. -
Using an MLP library:
cd testing sh testUWISOccludedMLPLibrary.sh
Note that
<environment_name>
,<category_name>
,<separation>
, and<light>
are to be replaced as described above. The path to the dataset folder and the folder containing trained MLP models must also be provided. As in the SVM case, a subfolder namedpredictions
is created in thetesting
folder and predictions for every video will be saved as a.txt
file. Corresponding ground truth will be saved in a newly createdgroundtruth
subfolder.
-
-