aau-cns / poet

PoET: Pose Estimation Transformer for Single-View, Multi-Object 6D Pose Estimation
Other
71 stars 12 forks source link

How to run PoET in inference mode. #13

Closed AyshaMK closed 1 year ago

AyshaMK commented 1 year ago

Throwing errors while running the inference in docker container. Traceback (most recent call last): File "../opt/project/main.py", line 372, in inference(args) File "/opt/project/inference_tools/inference_engine.py", line 31, in inference model, criterion, matcher = build_model(args) File "/opt/project/models/init.py", line 11, in build_model return build(args) File "/opt/project/models/pose_estimation_transformer.py", line 594, in build backbone = build_backbone(args) File "/opt/project/models/backbone.py", line 61, in build_backbone raise NotImplementedError NotImplementedError

tgjantos commented 1 year ago

Dear @AyshaMK,

in the main.py file, which backbone are you choosing? If you use the default runtime argument, i.e. "yolo", this error is thrown, as the option for the YOLO backbone is by default not included in this repository.

I kindly refer you to the README section regarding the usage of Scaled-YOLOv4. You simply have to copy our wrapper and put it into the models directory. Afterwards, you have to correctly call the build yolo function by extending backbone.py.

I hope this helps you! If you have any additional questions please do not hesitate to contact me.

Best, Thomas

AyshaMK commented 1 year ago

I have used poet_ycbv_maskrcnn.pth as the pretrained model for performing inference. Additionally, I have modified the default value of the --backbone argument to "maskrcnn". Could you please let me know the value of the --backbone_cfg argument that needs to be provided?

tgjantos commented 1 year ago

With the maskrcnn argument you can use this config file. The --backbone_cfg argument needs to be changed to 'configs/ycbv_rcnn.yaml' .

Best Thomas

AyshaMK commented 1 year ago

But this throws errors. Traceback (most recent call last): File "../opt/project/main.py", line 372, in inference(args) File "/opt/project/inference_tools/inference_engine.py", line 31, in inference model, criterion, matcher = build_model(args) File "/opt/project/models/init.py", line 11, in build_model return build(args) File "/opt/project/models/pose_estimation_transformer.py", line 594, in build backbone = build_backbone(args) File "/opt/project/models/backbone.py", line 59, in build_backbone backbone = build_maskrcnn(args) File "/opt/project/models/backbone_maskrcnn.py", line 127, in build_maskrcnn rcnn_cfg = yaml.load(Path(args.backbone_cfg).read_text(), Loader=yaml.FullLoader) File "/opt/conda/lib/python3.8/pathlib.py", line 1236, in read_text with self.open(mode='r', encoding=encoding, errors=errors) as f: File "/opt/conda/lib/python3.8/pathlib.py", line 1222, in open return io.open(self, mode, buffering, encoding, errors, newline, File "/opt/conda/lib/python3.8/pathlib.py", line 1078, in _opener return self._accessor.open(self, flags, mode) FileNotFoundError: [Errno 2] No such file or directory: 'configs/ycbv_rcnn.yaml'

tgjantos commented 1 year ago

You can try then the absolute path for the Docker container. This would be '/opt/project/configs/ycbv_rcnn.yaml'.

Best, Thomas

AyshaMK commented 1 year ago

Ok that works. Thank you.

Do we need to convert the inference data to poet format ?

tgjantos commented 1 year ago

If you want to make use of the data utils of this repository, then you need to convert the data into the PoET format. Alternatively, you can use any dataloader and thus data format you want. Only the inputs to PoET have to be in the same format such that they are processed correctly.

Best, Thomas

AyshaMK commented 1 year ago

Do yo have any link to get the inference dataset in the PoET format

tgjantos commented 1 year ago

To get the data right now, you can use the data annotation scripts provided in the repository. The annotation files I have are quite large. I will look into a way to add those files permanently to this repository. In the meantime you can shoot me an email and I can provide you with a one time download link.

Best, Thomas

AyshaMK commented 1 year ago

Thank You. Could you please provide me with your email address so that I can reach out to you for the one-time download link?

tgjantos commented 1 year ago

thomas.jantos@aau.at

AyshaMK commented 1 year ago

Thank you