Skip to content
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

Add HOPE dataset #13

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open

Add HOPE dataset #13

wants to merge 7 commits into from

Conversation

swtyree
Copy link

@swtyree swtyree commented Jan 24, 2023

I've integrated the HOPE dataset (https://bop.felk.cvut.cz/datasets/#HOPE) into the necessary configs and BOP scripts.

I have verified that the following scripts result in a correctly formatted BOP submission file that achieves the expected scores in the BOP evaluation server:

python -m cosypose.scripts.download --bop_dataset=hope
python -m cosypose.scripts.convert_models_to_urdf --models=hope
# manually copied trained model weights
python -m cosypose.scripts.run_bop_inference --config bop-pbr --dataset hope  # added --dataset flag
python -m cosypose.scripts.run_bop20_eval_multi --result_id=bop-pbr--383758 \
  --method=maskrcnn_detections/refiner/iteration=4 --convert_only

The final script (cosypose.scripts.run_bop20_eval_multi) does currently produce an error that I would like help to resolve:

Traceback (most recent call last):
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/big_white/code/cosypose_SR/cosypose/scripts/run_bop20_eval_multi.py", line 61, in <module>
    main()
  File "/home/big_white/code/cosypose_SR/cosypose/scripts/run_bop20_eval_multi.py", line 57, in main
    print(scores_path.read_text())
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/pathlib.py", line 1216, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/pathlib.py", line 1203, in open
    opener=self._opener)
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/pathlib.py", line 1058, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/big_white/code/cosypose_SR/local_data/bop_eval_outputs/challenge2020-383758_hope-test/scores_bop19.json'

The following files need to be uploaded to the appropriate cloud drive for cosypose.scripts.download to work correctly:

python -m cosypose.scripts.download --model=detector-bop-hope-pbr--15246
python -m cosypose.scripts.download --model=coarse-bop-hope-pbr--225203
python -m cosypose.scripts.download --model=refiner-bop-hope-pbr--955392
python -m cosypose.scripts.download --urdf_models=hope

PBR training images are not publicly available, so I have commented out the relevant settings in the HOPE config, e.g. in cosypose/bop_config.py:

    # train_pbr_ds_name=[hope.pbr]

@swtyree swtyree mentioned this pull request Jan 25, 2023
@ylabbe
Copy link
Collaborator

ylabbe commented Feb 15, 2023

I uploaded the network weights and urdfs in the common google drive with the other ones.

@swtyree
Copy link
Author

swtyree commented Feb 17, 2023

I just resolved the merge conflict that resulted from #14. I also confirmed that the following download scripts are working:

python -m cosypose.scripts.download --urdf_models=hope
python -m cosypose.scripts.download --model=detector-bop-hope-pbr--15246
python -m cosypose.scripts.download --model=coarse-bop-hope-pbr--225203
python -m cosypose.scripts.download --model=refiner-bop-hope-pbr--955392

The error mentioned in my opening comment is still unresolved. I will take another look, but @ylabbe let me know if you have any ideas for fixing it.

FileNotFoundError: [Errno 2] No such file or directory: '/home/big_white/code/cosypose_SR/local_data/bop_eval_outputs/challenge2020-383758_hope-test/scores_bop19.json'

@swtyree
Copy link
Author

swtyree commented Feb 17, 2023

As noted above, there is one unresolved error:

The final script (cosypose.scripts.run_bop20_eval_multi) does currently produce an error that I would like help to resolve:

Traceback (most recent call last):
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/runpy.py", line 193, in _run_module_as_main
    "__main__", mod_spec)
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/runpy.py", line 85, in _run_code
    exec(code, run_globals)
  File "/home/big_white/code/cosypose_SR/cosypose/scripts/run_bop20_eval_multi.py", line 61, in <module>
    main()
  File "/home/big_white/code/cosypose_SR/cosypose/scripts/run_bop20_eval_multi.py", line 57, in main
    print(scores_path.read_text())
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/pathlib.py", line 1216, in read_text
    with self.open(mode='r', encoding=encoding, errors=errors) as f:
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/pathlib.py", line 1203, in open
    opener=self._opener)
  File "/home/big_white/miniconda3/envs/cosypose_SR/lib/python3.7/pathlib.py", line 1058, in _opener
    return self._accessor.open(self, flags, mode)
FileNotFoundError: [Errno 2] No such file or directory: '/home/big_white/code/cosypose_SR/local_data/bop_eval_outputs/challenge2020-383758_hope-test/scores_bop19.json'

Is it possible that the following loop needs to be skipped when using the --convert_only flag?

for ds_name, (cfg, _) in processes.items():
results_dir = LOCAL_DATA_DIR / 'bop_eval_outputs' / cfg.csv_path.with_suffix('').name
scores_path = results_dir / 'scores_bop19.json'
print(f"{'-'*80}")
print(f'{ds_name}: {scores_path}')
print(scores_path.read_text())

@swtyree
Copy link
Author

swtyree commented Jun 2, 2023

@ylabbe, I was reminded earlier today that we hadn't merged support for the HOPE dataset into CosyPose. The only script that fails, to my knowledge, is cosypose.scripts.run_bop20_eval_multi. Do you have any ideas why it's failing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants