将RetinaNet与FastAi一起使用
object-detection-fastai的Python项目详细描述
目标检测
Pythorch和FastAi中目标检测的一些实验。 创建此repo是出于教育目的,并对RetinaNet和对象检测常规有更深入的了解。如果你喜欢,请让我知道,如果你发现任何缺陷或改进的技巧。在
安装
pip install object-detection-fastai
测试:Coco Colab
图像注释
本文对EXACT服务器进行了深入的描述,EXACT使您能够用此存储库对数据进行注释并训练对象检测模型。如果您在研究中使用此工具,请引用:
Marzahl等人
^{pr2}$更新旧代码
# Old imports:fromhelper.object_detection_helperimport*fromloss.RetinaNetFocalLossimportRetinaNetFocalLossfrommodels.RetinaNetimportRetinaNetfromcallbacks.callbacksimportBBLossMetrics,BBMetrics,PascalVOCMetric# New importsfromobject_detection_fastai.helper.object_detection_helperimport*fromobject_detection_fastai.loss.RetinaNetFocalLossimportRetinaNetFocalLossfromobject_detection_fastai.models.RetinaNetimportRetinaNetfromobject_detection_fastai.callbacks.callbacksimportBBLossMetrics,BBMetrics,PascalVOCMetric
此笔记本的基线是由来自FastAiDevNotebook的Sylvain Gugger创建的。非常感谢,这是一个很好的起点,我非常喜欢你的工作。在
使用此代码的出版物:
[x]Deep Learning-Based Quantification of Pulmonary Hemosiderophages in Cytology Slides
示例:
结果:
特点:
[x]列车时间通过回叫的Coco指标
[x] 灵活性
# use the feature map sizes 32,18,8,4 with 32 channels and two conv layers for detection and classificationRetinaNet(encoder,n_classes=data.train_ds.c,n_anchors=18,sizes=[32,16,8,4],chs=32,final_bias=-4.,n_conv=2)''' (classifier): Sequential( (0): Sequential( (0): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (1): ReLU() ) (1): Sequential( (0): Conv2d(32, 32, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) (1): ReLU() ) (2): Conv2d(32, 18, kernel_size=(3, 3), stride=(1, 1), padding=(1, 1)) )
# use the feature map sizes 32 with 8 channels and three conv layers for detection and classificationRetinaNet(encoder,n_classes=data.train_ds.c,n_anchors=3,sizes=[32],chs=8,final_bias=-4.,n_conv=3)
[x]为训练调试锚定匹配项。在
在左图中,我们可以看到由锚点表示的对象。
在正确的对象上没有相应的锚来训练。
最小锚的大小应该进一步减小,以匹配右图像上的小对象。在
- 项目
标签: