[LAB 10 · 从 RGB 图像训练小型检测器](/course/notebooks/a14237bfa9dd413d959ab4e458e11f42.html) # 实际训练与可复查的输出 · 实现代码 [独立阅读](/course/notebook-blocks/e4979dd3569c4ce4855112dd4b062c23.html) 主线阅读与优先实验 RGB图像、单特征层锚框检测器、分类/位置损失、NMS、独立检测评价 展开完整实现代码 ``` import subprocess,sys,json subprocess.run([sys.executable,'lab10_detector.py','--out','lab10-results-rerun','--epochs','28'],check=True) R=json.loads(Path('lab10-results-rerun/run.json').read_text()) for setting in ['random_initialization','validation','heldout','condition_half_object_scale','condition_NMS_065']: r=R[setting] print(setting, 'mAP50=',round(r['AP50']['mAP'],4),'mAP75=',round(r['AP75']['mAP'],4), 'P@.4=',round(r['operating_point']['precision'],4),'R@.4=',round(r['operating_point']['recall'],4)) print(R['provenance']) from IPython.display import Image,display for filename in ['heldout-predictions.png','failure-predictions.png','half-scale-predictions.png','training-curve.png']: display(Image(filename='lab10-results-rerun/'+filename)) ```