chensong1995 / HybridPose

HybridPose: 6D Object Pose Estimation under Hybrid Representation (CVPR 2020)
MIT License
412 stars 64 forks source link

Getting inference on ape saved_weights (from OneDrive) #79

Closed monajalal closed 10 months ago

monajalal commented 11 months ago

I am trying to get an inference on trained weights of ape however it tells me that I need the blender_linemod. Have you shared this data somewhere or are you able to share the link to downloading the data that is produced using PVNet-Rendering?

Also, why is there a need for synthetic data access in order to run the inference?

(hybridpose) mona@mona-ThinkStation-P7:~/HybridPose$ python src/train_core.py --load_dir saved_weights/linemod/ape/checkpoints/0.001/199 --object_name ape
Traceback (most recent call last):
  File "/home/mona/HybridPose/src/train_core.py", line 98, in <module>
    train_loader, test_loader, val_loader = setup_loaders(args)
  File "/home/mona/HybridPose/src/train_core.py", line 52, in setup_loaders
    blender_set = BlenderLinemodDataset(object_name=args.object_name, augment=True, occlude=False)
  File "/home/mona/HybridPose/lib/datasets/blender_linemod.py", line 40, in __init__
    self.length = len(list(filter(lambda x: x.endswith('jpg'), os.listdir(data_dir))))
FileNotFoundError: [Errno 2] No such file or directory: 'data/blender_linemod/ape'

https://github.com/chensong1995/HybridPose/issues/43#issuecomment-1586262802

chensong1995 commented 11 months ago

Hello Mona,

Thanks for your interest in our work! To run the inference, you do not need to have the synthetic data. Feel free to remove the part that uses Blender data (i.e., this line, this line, and take out blender_set from this line). You do not need any of the training data to run the inference. If you are having trouble setting up other parts of the training data (e.g., fuse_set), please feel free to remove them as well.

I hope this helps! Let me know if you have further concerns.

monajalal commented 10 months ago

@chensong1995 thanks a lot for your response. Isn't fuse_set also dependent on the blender dataset?

I commented both blender_set and fuse_set and get the following error:

(hybridpose) mona@mona-ThinkStation-P7:~/HybridPose$ python src/train_core.py --load_dir saved_weights/linemod/ape/checkpoints/0.001/199 --object_name ape
number of model parameters: 12959563
Successfully loaded model from saved_weights/linemod/ape/checkpoints/0.001/199
Traceback (most recent call last):
  File "/home/mona/HybridPose/src/train_core.py", line 112, in <module>
    trainer.generate_data(val_loader)
  File "/home/mona/HybridPose/./trainers/coretrainer.py", line 548, in generate_data
    regressor = load_wrapper()
  File "/home/mona/HybridPose/lib/regressor/regressor.py", line 13, in load_wrapper
    regressor = CDLL('wrapper.so')
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/ctypes/__init__.py", line 374, in __init__
    self._handle = _dlopen(self._name, mode)
OSError: wrapper.so: cannot open shared object file: No such file or directory
monajalal commented 10 months ago

https://github.com/chensong1995/HybridPose/issues/22#issuecomment-862615326

chensong1995 commented 10 months ago

Hi Mona,

Thanks for your follow-up! The error message suggests the program cannot find the file wrapper.so. Please follow README and compile the pose regressor. I hope this helps! Let me know if you have further concerns.