How tianzhi0549/fcos works
FCOS is a PyTorch, anchor-free object-detection implementation. Its principal workflow takes images through a configured detector to bounding-box predictions; training builds datasets and a model, then optimizes and checkpoints it, while evaluation aggregates predictions and evaluates datasets. The graph also includes the RetinaNet alternative, ROI heads, ONNX export, and shared box/layer utilities. Some subsystem links rely on the README or SOURCE INDEX references; unsampled implementation details are not inferred as direct calls.
Main entry points: generalized_rcnn.py Detector assembly · train_net.py Training command · fcos.py Image detector API · inference.py FCOS postprocessing
Components 24
User entry points
- Training command
tools/train_net.py - Image detector API
fcos/fcos.py - ONNX export
onnx/export_model_to_onnx.py
Training data and loop
- COCO and VOC data
fcos_core/data/datasets - Data loader
fcos_core/data/build.py - Image transforms
fcos_core/data/transforms - Training loop
fcos_core/engine/trainer.py - Optimizer scheduler
fcos_core/solver/build.py
Detection model
- Detector assembly
fcos_core/modeling/detector/generalized_rcnn.py - Backbone and FPN
fcos_core/modeling/backbone - FCOS prediction head
fcos_core/modeling/rpn/fcos/fcos.py - RetinaNet head
fcos_core/modeling/rpn/retinanet/retinanet.py - Box mask keypoints
fcos_core/modeling/roi_heads
Inference and results
- FCOS postprocessing
fcos_core/modeling/rpn/fcos/inference.py - Inference evaluator
fcos_core/engine/inference.py - Dataset evaluation
fcos_core/data/datasets/evaluation
Shared runtime support
- Model configuration
fcos_core/config/defaults.py - Box encoding
fcos_core/modeling/box_coder.py - Box data structure
fcos_core/structures/bounding_box.py - Box filtering NMS
fcos_core/structures/boxlist_ops.py - Tensor and vision ops
fcos_core/layers/misc.py - Checkpoint loading
fcos_core/utils/checkpoint.py - Runtime utilities
fcos_core/utils
Other components
- Image user
Connections 26
- Image user → Image detector API: submits image
README.md - Image detector API → Model configuration: loads settings
fcos/fcos.py - Image detector API → Detector assembly: builds detector
fcos/fcos.py - Image detector API → Checkpoint loading: loads weights
fcos/fcos.py - Training command → Model configuration: reads settings
tools/train_net.py - Training command → Detector assembly: builds detector
tools/train_net.py - Training command → Data loader: builds batches
tools/train_net.py - Training command → Optimizer scheduler: builds optimizer
tools/train_net.py - Training command → Training loop: starts training
tools/train_net.py - Data loader → COCO and VOC data: constructs datasets
fcos_core/data/build.py - Data loader → Image transforms: builds transforms
fcos_core/data/build.py - Detector assembly → Backbone and FPN: assembles model
- Detector assembly → FCOS prediction head: assembles model
- Detector assembly → RetinaNet head: supports alternative
- Detector assembly → Box mask keypoints: supports heads
- FCOS prediction head → FCOS postprocessing: produces predictions
- FCOS postprocessing → Box encoding: decodes boxes
fcos_core/modeling/rpn/fcos/inference.py - FCOS postprocessing → Box data structure: creates detections
fcos_core/modeling/rpn/fcos/inference.py - FCOS postprocessing → Box filtering NMS: filters boxes
fcos_core/modeling/rpn/fcos/inference.py - Box filtering NMS → Box data structure: operates on boxes
fcos_core/structures/boxlist_ops.py - Box filtering NMS → Tensor and vision ops: uses NMS ops
fcos_core/structures/boxlist_ops.py - Inference evaluator → Dataset evaluation: evaluates results
fcos_core/engine/inference.py - Inference evaluator → Runtime utilities: gathers predictions
fcos_core/engine/inference.py - ONNX export → Detector assembly: builds detector
onnx/export_model_to_onnx.py - ONNX export → Checkpoint loading: loads weights
onnx/export_model_to_onnx.py - ONNX export → Inference evaluator: imports evaluator
onnx/export_model_to_onnx.py