chensong1995 / HybridPose

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

exact format of occlusion linemod for hybridpose #92

Closed monajalal closed 10 months ago

monajalal commented 11 months ago

I have this from PVNET:

(hybridpose) mona@ada:~/HybridPose/data$ ls /data2/data/BOP/OCCLUSION_LINEMOD
total 44K
drwxrwxr-x  4 mona mona 4.0K Aug  4  2015 RGB-D
drwxrwxr-x 11 mona mona 4.0K Nov  4  2018 poses
drwxrwxr-x 11 mona mona 4.0K Nov  4  2018 models
drwxrwxr-x 12 mona mona 4.0K Nov  4  2018 masks
drwxrwxr-x  2 mona mona 4.0K Mar  9  2019 posedb
drwxrwxr-x 10 mona mona 4.0K Oct  5  2019 blender_poses
drwxrwxr-x 10 mona mona 4.0K Oct  5  2019 contours
drwxrwxr-x 10 mona mona 4.0K Oct  5  2019 amodal_masks
drwxrwxr-x 10 mona mona 4.0K Oct  6  2019 anns
drwxrwxr-x 11 mona mona 4.0K Oct  6  2019 .
drwxrwxr-x  9 mona mona 4.0K Dec 11 15:53 ..

Since, I couldn't download occlusion linemod using your script:

(hybridpose) mona@ada:~/HybridPose/data$ python download_occlusion.py 
Traceback (most recent call last):
  File "/home/mona/HybridPose/data/download_occlusion.py", line 18, in <module>
    download_and_unzip()
  File "/home/mona/HybridPose/data/download_occlusion.py", line 11, in download_and_unzip
    urllib.request.urlretrieve(url, target_file)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 241, in urlretrieve
    with contextlib.closing(urlopen(url, data)) as fp:
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 216, in urlopen
    return opener.open(url, data, timeout)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 557, in error
    result = self._call_chain(*args)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 749, in http_error_302
    return self.parent.open(new, timeout=req.timeout)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 525, in open
    response = meth(req, response)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 634, in http_response
    response = self.parent.error(
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 563, in error
    return self._call_chain(*args)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 496, in _call_chain
    result = func(*args)
  File "/home/mona/anaconda3/envs/hybridpose/lib/python3.10/urllib/request.py", line 643, in http_error_default
    raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 404: 

could you show how you exactly want the occlusion linemod to be formatted?

    os.system('for i in $( ls data/occlusion_linemod/models | grep [A-Z] ); do mv -i data/occlusion_linemod/models/"$i" data/occlusion_linemod/models/"`echo $i | tr \'A-Z\' \'a-z\'`"; done')
    os.system('for i in $( ls data/occlusion_linemod/poses | grep [A-Z] ); do mv -i data/occlusion_linemod/poses/"$i" data/occlusion_linemod/poses/"`echo $i | tr \'A-Z\' \'a-z\'`"; done')

Is it just you wanna lower case the name OCCLUSION_LINEMOD? any explanation or $ls on folder name is helpful

This is what I have for linemod itself:

(hybridpose) mona@ada:~/HybridPose/data$ ls linemod
total 52K
drwxr-xr-x 17 mona mona 4.0K Oct 25  2019 symmetries
drwxr-xr-x 17 mona mona 4.0K Nov 13  2019 keypoints
-rw-r--r--  1 mona mona  186 May 17  2020 label2.sh
-rw-r--r--  1 mona mona  184 May 17  2020 label1.sh
-rw-r--r--  1 mona mona 8.2K May 17  2020 label.py
drwxr-xr-x 17 mona mona 4.0K May 17  2020 masks
drwxr-xr-x 17 mona mona 4.0K May 17  2020 correspondences
drwxr-xr-x  2 mona mona 4.0K Aug 24  2020 ranges
drwxrwxr-x 17 mona mona 4.0K Oct 16 16:01 original_dataset
drwxrwxr-x  8 mona mona 4.0K Oct 16 16:14 .
drwxrwxr-x  5 mona mona 4.0K Dec 13 14:20 ..
chensong1995 commented 11 months ago

Hi Mona,

Thanks for your question!

The old version of the Occlusion Linemod dataset has been taken down from the download website. As a result, this repository no longer supports the Occlusion Linemod dataset. Simply using the PVNet data or the new BOP data will probably not work.

I would suggest you take a very close look at lib/datasets/occlusion_linemod.py, understand the logic, and try to write a new PyTorch Dataset class that loads the new Occlusion Linemod data. In the existing file, there are some transformations to align the Occlusion Linemod labels with the Lindmod labels. Depending on how the new labels are constructed, you may or may not need these transformations.

Unfortunately, I do not have the capacity to help you with this at the moment. My suggestion is to seek help from an experienced person in your organization who is familiar with 3D geometry and debugging. I hope this helps! Let me know if you have further concerns.