Upload README.md with huggingface_hub
Browse files123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990---license: apache-2.0library_name: pytorchpipeline_tag: object-detectiontags:- object-center-detection- keypoint-detection- edge- npu- mobilenetv4- coco---
# OCDet: Object Center Detection via Bounding Box-Aware Heatmap Prediction on Edge Devices with NPUs
OCDet is a lightweight Object Center Detection framework optimized for edge deviceswith NPUs. It predicts heatmaps of object center probabilities and extracts centerpoints via peak identification. Built on an NPU-friendly Semantic FPN withMobileNetV4 backbones, OCDet is trained with Balanced Continuous Focal Loss (BCFL)and evaluated with the Center Alignment Score (CAS).
- **Code:** https://github.com/chen-xin-94/ocdet- **Backbones:** MobileNetV4 (conv small / medium / large)- **Tasks:** COCO 80-class object center detection (OCDet) and person-only center detection (PCDet)
## Files
This repo hosts 10 checkpoints. **Each `<model>.pt` has a matching `<model>.yaml`**that records the exact architecture and hyperparameters it was trained with.Always load a weight together with its own `.yaml` β the training templates in theGitHub `configs/` folder can disagree with the released weights (e.g. `pcdet-n`was trained with `out_channel=32`, not `64`).
| Group | Weights ||-------|---------|| OCDet (COCO 80-class) | `ocdet-{n,s,m,l,x}.pt` (+ `.yaml`) || PCDet (person-only) | `pcdet-{n,s,m,l,x}.pt` (+ `.yaml`) |
## Model Zoo
### COCO 80-class Object Center Detection (OCDet)
| Model | #Params (M) | FLOPs (G) | NPU Latency i.MX 8M Plus (ms) | CAS β | CP β | MD β | P β | R β | F1 β ||-------|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|| OCDet-N | 1.51 | 0.54 | 10.94 | 0.297 | 0.645 | 0.059 | 0.634 | 0.466 | 0.510 || OCDet-S | 1.59 | 0.94 | 24.25 | 0.313 | 0.644 | 0.055 | 0.621 | 0.507 | 0.531 || OCDet-M | 8.25 | 3.54 | 63.26 | 0.362 | 0.573 | 0.065 | 0.643 | 0.585 | 0.599 || OCDet-L | 31.88 | 7.67 | 94.14 | 0.389 | 0.563 | 0.064 | 0.694 | 0.596 | 0.630 || OCDet-X | 22.20 | 7.00 | 181.81 | 0.410 | 0.525 | 0.066 | 0.713 | 0.643 | 0.669 |
### Person Center Detection (PCDet)
| Model | #Params (M) | FLOPs (G) | NPU Latency i.MX 8M Plus (ms) | CAS β | CP β | MD β | P β | R β | F1 β ||-------|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|:---:|| PCDet-N | 1.51 | 0.52 | 9.99 | 0.472 | 0.440 | 0.088 | 0.815 | 0.745 | 0.779 || PCDet-S | 1.59 | 0.92 | 18.41 | 0.506 | 0.411 | 0.083 | 0.830 | 0.762 | 0.794 || PCDet-M | 7.79 | 2.75 | 39.68 | 0.546 | 0.379 | 0.075 | 0.910 | 0.715 | 0.801 || PCDet-L | 30.96 | 6.06 | 60.47 | 0.557 | 0.366 | 0.077 | 0.894 | 0.750 | 0.816 || PCDet-X | 21.91 | 6.49 | 160.37 | 0.582 | 0.337 | 0.081 | 0.831 | 0.848 | 0.840 |
## Usage
Clone the [code](https://github.com/chen-xin-94/ocdet) and install itsdependencies, then download a weight together with its config:
```bashmkdir -p weights# either grab a single model + its config ...wget -P weights https://huggingface.co/Moonxc/OCDet/resolve/main/pcdet-n.ptwget -P weights https://huggingface.co/Moonxc/OCDet/resolve/main/pcdet-n.yaml# ... or pull the whole repo at once# pip install -U huggingface_hub && hf download Moonxc/OCDet --local-dir weights```
Run inference (`predict.py` auto-loads `weights/pcdet-n.yaml` next to the weight):
```bashpython predict.py \ --input_path images/000000032081.jpg \ --trained weights/pcdet-n.pt \ --n_classes 1 \ --gpu -1 \ --min_distance 3 --threshold_abs 0.5 --input_size 320 \ --vis --save```
## Citation
If you use OCDet, please cite the work and link back to the[GitHub repository](https://github.com/chen-xin-94/ocdet).README.mdAdded+90