This PR focuses on fitting DeepForest into the framework including - training and predicting.
Major changes to look out for:
preprocessing.py has a CustomDataModule class which inherits from LightningDataModule. I was unable to directly use the DataLoaders created by preprocessing.create_dataloader for lightning since it expects a LightningdataModule.
I created a derived class DeepForestDetector from LightningDetector following our initial logic. Also included DeepForestModule as a new class.
training_step() in DeepForestModule had to be heavily modified to make sure the images and labels are in the format expected by RetinaNet (backbone for deepforest).
predict() method in DeepForestDetector : I decided to directly use deepforest library's method for this to avoid unnecessary replication of code and rewriting.
Included 3 staticmethods (defined by David) to help post-process the prediction outputs to RegionDetectionsSet objects.
Included a notebook deepforest_train_and_predict.ipynb for demonstration.
This PR focuses on fitting DeepForest into the framework including - training and predicting.
Major changes to look out for:
preprocessing.py
has aCustomDataModule
class which inherits fromLightningDataModule
. I was unable to directly use the DataLoaders created bypreprocessing.create_dataloader
for lightning since it expects aLightningdataModule
.DeepForestDetector
fromLightningDetector
following our initial logic. Also includedDeepForestModule
as a new class.training_step()
inDeepForestModule
had to be heavily modified to make sure the images and labels are in the format expected byRetinaNet
(backbone for deepforest).predict()
method inDeepForestDetector
: I decided to directly usedeepforest
library's method for this to avoid unnecessary replication of code and rewriting.RegionDetectionsSet
objects.deepforest_train_and_predict.ipynb
for demonstration.