The majority of the work on this PR is to add/modify a few methods for the Detector class.
Rather than predict being implemented by each derived class, now predict_batch is, only for a single batch.
The predict_as_generator method can be used to generate predictions sequentially from a dataloader. This method handles most of the boilerplate functionality.
The predict method now returns either a list of RegionDetections or a single RegionDetectionSet.
The random detector is now fairly simple. It generates a fixed number of detections of a given size for each image. Additional sophistication could be added (e.g. a range of sizes, or a specified distribution of spatial locations) but I didn't see an immediate need for this functionality.
The majority of the work on this PR is to add/modify a few methods for the
Detector
class.predict
being implemented by each derived class, nowpredict_batch
is, only for a single batch.predict_as_generator
method can be used to generate predictions sequentially from a dataloader. This method handles most of the boilerplate functionality.predict
method now returns either a list ofRegionDetections
or a singleRegionDetectionSet
.The random detector is now fairly simple. It generates a fixed number of detections of a given size for each image. Additional sophistication could be added (e.g. a range of sizes, or a specified distribution of spatial locations) but I didn't see an immediate need for this functionality.