FCOS is an anchor-free model based on the Fully Convolutional Network (FCN) architecture for pixel-wise object detection. It implements a proposal-free solution and introduces the concept of centerness. For more details, please refer to our report on Arxiv.
# Install libGL
## CentOS
yum install -y mesa-libGL
## Ubuntu
apt install -y libgl1-mesa-dev
pip3 install tqdm
pip3 install onnx
pip3 install onnxsim
pip3 install ultralytics
pip3 install pycocotools
pip3 install addict
pip3 install yapf
pip3 install pycuda
pip3 install mmdet==2.28.2
pip3 install opencv-python==4.6.0.66
The inference of the FCOS model requires a dependency on a well-adapted mmcv-v1.7.0 library. Please inquire with the staff to obtain the relevant libraries.
cd mmcv
sh build_mmcv.sh
sh install_mmcv.sh
MMDetection is an open source object detection toolbox based on PyTorch. It is a part of the OpenMMLab project.It is utilized for model conversion. In MMDetection, Execute model conversion command, and the checkpoints folder needs to be created, (mkdir checkpoints) in project
git clone -b v2.25.0 https://github.com/open-mmlab/mmdetection.git
cd mmdetection
python3 tools/deployment/pytorch2onnx.py \
/Path/to/fcos/ixrt/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco.py \
checkpoints/fcos_center-normbbox-centeronreg-giou_r50_caffe_fpn_gn-head_1x_coco-0a0d75a8.pth \
--output-file /Path/To/ixrt/data/checkpoints/r50_fcos.onnx \
--input-img demo/demo.jpg \
--test-img tests/data/color.jpg \
--shape 800 800 \
--show \
--verify \
--skip-postprocess \
--dynamic-export \
--cfg-options \
model.test_cfg.deploy_nms_pre=-1
If there are issues such as input parameter mismatch during model export, it may be due to ONNX version. To resolve this, please delete the last parameter (dynamic_slice) from the return value of the_slice_helper function in the /usr/local/lib/python3.10/site-packages/mmcv/onnx/onnx_utils/symbolic_helper.py file.
export PROJ_DIR=./
export DATASETS_DIR=/Path/to/coco/
export CHECKPOINTS_DIR=/Path/to/checkpoints
export RUN_DIR=./
# Accuracy
bash scripts/infer_fcos_fp16_accuracy.sh
# Performance
bash scripts/infer_fcos_fp16_performance.sh
Model | BatchSize | Precision | FPS | MAP@0.5 | MAP@0.5:0.95 |
---|---|---|---|---|---|
FCOS | 1 | FP16 | 51.62 | 0.546 | 0.360 |
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。