p2irc / deepplantphenomics

Deep learning for plant phenotyping.
GNU General Public License v2.0
135 stars 46 forks source link

Heatmap-based Object Counting #33

Closed donovanlavoie closed 5 years ago

donovanlavoie commented 5 years ago

This pull request is mostly for documentation as opposed to an actual request, since I'm requesting to merge it into my own branch outside of master and develop.

This adds a new problem type to DPP: object counting by performing semantic segmentation on heatmaps.

A new subclass of DPPModel was added for this problem type. It includes a loader for datasets with images and a CSV file with multiple x,y points as labels; those labels are used to generate label heatmaps with 2D gaussian distributions at the label points. An alternative loader that works similarly to the one for semantic segmentation problems with image masks as labels is also provided.

Within the overridden test accuracy output, the differences in the total sum/object count between the test images and labels are included in the output (as well as the mean of those differences).

A number of bugs, both old and new with regards to the subclass refactoring for problem types, were also found and fixed while implementing the new problem type. Some of the more serious ones include:

The test suite was updated to include heatmap-based object counting and all of the test pass. All of the examples should also run fine as well.