aau-cns / poet

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

Question for the ycbv2poet.py #6

Closed Van5SE closed 1 year ago

Van5SE commented 1 year ago

The ycbv2poet.py file seems so weird.

base_path = '/data'
data_paths = ['test/', 'train_real/', 'train_synt/']
img_types = ['real', 'synt', 'test']

output_base_path = '/data/ycbv/annotations/'
annotation_paths = ['train_real.json', 'train_synt.json']
...
for data_path, ann_path, img_type in zip(data_paths, annotation_paths, img_types):

It looks like you only create 2 files train_real.json and train_synt.json with test/ write into train_real.json and train_real write into train_synt.json.

Besides it seems like the test/ data was also written into the train_synt.json since you didn't reinitialize the "annotations".

This is my modification of the file, but I'm not sure if the output is the same as yours.

Could you please update the file you used for model training? Thanks a lot!

...
base_path = 'path/to/ycbv'
data_paths = ['test/', 'train_real/', 'train_synt/']
img_types = ['test','real', 'synt']

output_base_path = 'annotations/'
annotation_paths = ['test.json','train_real.json', 'train_synt.json']

...

annotations = {'images': [],
               'categories': categories,
               'annotations': []}
image_id = 0
annotation_id = 0
annotations_removed = 0
for data_path, ann_path, img_type in zip(data_paths, annotation_paths, img_types):
    annotations = {'images': [], #reinitialize annotations
               'categories': categories,
               'annotations': []}
    image_id = 0
    annotation_id = 0
    annotations_removed = 0
    print(data_path,ann_path, img_type)
    print("Annotating: {}".format(data_path))
   ...
end of file
tgjantos commented 1 year ago

Dear @Van5SE,

thank you for pointing out these inconsistencies. Initially it was not planned to release this script and thus it is not as user friendly as I would like it to be.

You are definitely right, that the annotations for the test data was written wrongfully into the train annotations. That was an oversight from me and should not have happened. The script should be run separately for the test data and the train data.

The initial idea for not reinitializing the annotations is that I wanted to have progressive annotation files, i.e. one file containing only the annotations for the real data, one containing the annotations for real + synthetic data and one file containing the real, synthetic and PBR generated data, just by executing the script once. However, this intention is not at all conveyed in the script. I am sorry for that.

I just reworked and pushed a new version of this script. Please check it out. There you can configure which data you want to be annotated and only a single annotation file is written at the end of the script, which should make the usage more intuitive.

Best, Thomas

Van5SE commented 1 year ago

Thank your very much for your replay. This is a great work and I am trying my best to reproduce it. Thanks again for open source. Best wishes!

tgjantos commented 1 year ago

Awesome! Thanks for using PoET.

I will close the issue. Please open a new one, if you encounter any further issues.

Best, Thomas