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

modifying for multiple classes #15

Open
ZoharKapach opened this issue Nov 8, 2019 · 2 comments
Open

modifying for multiple classes #15

ZoharKapach opened this issue Nov 8, 2019 · 2 comments

Comments

@ZoharKapach
Copy link

Could you provide a list of required modifications in order for this to work for multiple classes?

@javiribera
Copy link
Owner

Some of the things that need to be done to extend this implementation to multiple classes:

  1. 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.
  2. 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
  3. Apply the loss function of Equation 9 to each of the p^k_x and \hat{C}_k separately.
  4. Average all the loss functions
  5. 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 class CSVDataset, and the function csv_collator, would need to be adapted accordingly.
  6. train.py and locate.py would also need modification
  7. (optional) If you want to mark each object class with a different color you would have to modify paint.py

@nupur0294
Copy link

Could you specify the codes where the above changes has to be made? For example FCN we need to put n_classes=2.

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

No branches or pull requests

3 participants