pieterblok/boxal

Add more parameters to boxal.yaml

Closed this issue · 2 comments

Hello,
I would like to add new parameters to the boxal.yaml file to:

  1. include data with empty annotations in the training:
cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = False

This does not have any effect. I implement it as follows:

  • add filter_empty_annotations to the types.yaml.
  • assign filter_empty_annotations in boxal.yaml to False
  • add this cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = config['filter_empty_annotations'] to here in the boxal.py file.
    I think the reason is because of the function which is used to register the dataset: register_coco_instances
  • I also tried changing the default value of cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS in the detectron2/config/defaults.py file. It didn't change anything.
    Any help to solve this would be much appreciated!
  1. specify the sizes and aspect ratios of the anchor boxes:
cfg.MODEL.ANCHOR_GENERATOR.SIZES = [[32, 64, 128 , 256, 512]]
cfg.MODEL.ANCHOR_GENERATOR.ASPECT_RATIOS = [[0.002, 0.01, 0.02, 0.05]]

I did this by including the following lines to types.yaml and do similar as the previous case.

anchor_sizes: ['integer', 'list']
anchor_aspect_ratios: ['float', 'list']

This one seems to work. However, in the original detectron2, these are defined as a list of lists. It was not possible for me to define such a type in types.yaml.

Hello, I would like to add new parameters to the boxal.yaml file to:

  1. include data with empty annotations in the training:
cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = False

This does not have any effect. I implement it as follows:

  • add filter_empty_annotations to the types.yaml.
  • assign filter_empty_annotations in boxal.yaml to False
  • add this cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS = config['filter_empty_annotations'] to here in the boxal.py file.
    I think the reason is because of the function which is used to register the dataset: register_coco_instances
  • I also tried changing the default value of cfg.DATALOADER.FILTER_EMPTY_ANNOTATIONS in the detectron2/config/defaults.py file. It didn't change anything.
    Any help to solve this would be much appreciated!
  1. specify the sizes and aspect ratios of the anchor boxes:
cfg.MODEL.ANCHOR_GENERATOR.SIZES = [[32, 64, 128 , 256, 512]]
cfg.MODEL.ANCHOR_GENERATOR.ASPECT_RATIOS = [[0.002, 0.01, 0.02, 0.05]]

I did this by including the following lines to types.yaml and do similar as the previous case.

anchor_sizes: ['integer', 'list']
anchor_aspect_ratios: ['float', 'list']

This one seems to work. However, in the original detectron2, these are defined as a list of lists. It was not possible for me to define such a type in types.yaml.

I've given it some thoughts, but I think that option 1 (using images with empty annotations) is not recommended when using my active learning pipeline.

Reason 1 (most important): the uncertainty calculation for selecting the most relevant images depends on the object detection output. Having images with empty annotations and potentially empty detections also means there cannot be uncertainty scores calculated. This is against the assumptions of the active learning method I've implemented from literature. I guess a learning loss method like this paper would more more applicable for this purpose.

Reason 2 (why it not works): the sampling and auto-annotate scripts depend fully on annotated images. Rewriting them means that the entire pipeline has to be rewritten as well, something I don't have time for and quite honestly don't see the purpose given reason 1.

One of the reasons why it not works, is for example this function:

def highlight_missing_annotations(annot_folder, cur_annot_diff):

Of course feel free to alter the code for your purpose / dataset. Implementing it for the BoxAL main source code is something I don't think there is interest for the general purpose of doing active learning.

I see your points.
Thanks for taking your time and the clarification.