weecology / DeepForest

Python Package for Airborne RGB machine learning

Home Page:https://deepforest.readthedocs.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Single label detection

jyo94 opened this issue · comments

In my annotation file, I have two labels (cassava and weed). I'm performing 2 actions(filtering and renaming of the classes) and proceeding with a single label for model training.
Reasons for the above 2 steps:

  1. Filtering one label because I don't know how to perform multi label
  2. Renaming the cropname (cassava) as Tree because it throwed keyerror if kept as such

All other steps - training, evaluation and prediction are done as per the documentation. Kindly refer the file for more details.

Issue:

  1. All objects are detected (though filtered out for one). If it is misclassified, it is fine but here it is not the case.
  2. All are detected as tree and not as cassava

main.zip

Predicted Image:
sample_output.zip

Nice work on this issue @jyo94!

  1. All objects are detected (though filtered out for one). If it is misclassified, it is fine but here it is not the case.

Distinguishing between these two will be a bit tricky without the multi-class setup since they are both plants that appear somewhat similar relative to the background. It would probably require a fair bit of training data to overcome this. There are some other approaches, but let's start with seeing if we can get your multi-class setup up and running.

  1. All are detected as tree and not as cassava

You can change the label name for a single class model by setting the label_dict argument when creating the model

m = main.deepforest(label_dict={"cassava":0})

There's an example in the docs for birds.