locating-objects-without-bboxes
locating-objects-without-bboxes copied to clipboard
modifying for multiple classes
Could you provide a list of required modifications in order for this to work for multiple classes?
Some of the things that need to be done to extend this implementation to multiple classes:
- Make the FCN output multiple probability maps at the output layer (one per object type). Denoted as p_x in Figure 3 of the paper. So now we would have up to p^K_x, being K the number of classes/object types we want to have.
- Make the lateral network (the fully-connected layer) at the bottom of Figure 3 output multiple estimations (one per type of object), so we would have one object count estimate per object type, as \hat{C}_1, \hat{C}_2, ... \hat{C}_K
- Apply the loss function of Equation 9 to each of the p^k_x and \hat{C}_k separately.
- Average all the loss functions
- Modify the CSV format to be able to indicate which class corresponds to each object location. This can be done for example by adding a new column called "classes" and indicating them for example as [0, 5, 3]. This way the first object would be of class 0, the second one of class 5 and the third one of class 3. In
data.py
, the method__getitem__
of the classCSVDataset
, and the functioncsv_collator
, would need to be adapted accordingly. -
train.py
andlocate.py
would also need modification - (optional) If you want to mark each object class with a different color you would have to modify
paint.py
Could you specify the codes where the above changes has to be made? For example FCN we need to put n_classes=2.