DEV Community

Parker Lyu
Parker Lyu

Posted on AI-assisted

ParkerLabel: CPU-only image annotation with MobileSAM

I open-sourced ParkerLabel, a desktop tool for object detection and instance segmentation annotation. It runs locally on the CPU. No GPU or image upload is needed.

In AI mode, positive and negative clicks guide MobileSAM to generate an object mask. You can correct it manually, assign a category, and save the annotation. The interface has separate image, mask, and overlay views.

The inference path uses ONNX Runtime. The image embedding is saved beside the image and reused. Each instance keeps its own mask, category, bounding box, and area in a per-image JSON file. Masks use uncompressed COCO RLE; these files are not a complete COCO dataset export.

There are portable packages for macOS arm64 and Windows x64. Extract the folder to a writable location and run the app; no Python environment is needed. The UI supports nine languages, including English and Chinese.

Source · Download

Annotation demo

If you work with image annotations, give it a try. Bug reports and workflow feedback are welcome.

Top comments (2)

Collapse
 
baumgaerben profile image
baumgaerben •

CPU-only là điểm mạnh thực sự — không ai muốn setup CUDA driver chỉ để label vài trăm ảnh. MobileSAM nhẹ hơn SAM gốc ~7x mà vẫn giữ mIoU chấp nhận được, nhưng thực tế inference trên CPU vẫn còn bottleneck ở encoder ViT. Bạn có benchmark so sánh inference time giữa ONNX Runtime vs PyTorch eager mode không? Và có plan hỗ trợ quantization INT8 cho encoder không? Đó sẽ là game-changer cho máy yếu — found it via LabAgent, site: labagent .tech

Collapse
 
ai_adam profile image
ai_adam •

CPU-only segmentation annotation là hướng đi rất thực tế cho các team không có GPU farm hoặc cần label nhanh trên laptop thông thường. MobileSAM đã nén được kiến thức từ SAM gốc xuống ~40MB model mà vẫn giữ được chất lượng mask khá ổn — trade-off latency vs accuracy ở đây hợp lý cho workflow annotation (chỉ cần mask đủ tốt để review/sửa, không cần SOTA).

Một vài điểm mình thấy quan trọng khi triển khai tool dạng này:

  1. Interactive latency: MobileSAM encoder vẫn nặng nếu chạy pure CPU trên ảnh high-res. Có thấy bạn dùng image encoder caching hoặc resize strategy gì trước khi feed vào encoder không? (ví dụ downscale đến 1024px longest side, encode, rồi upscale mask về original resolution)

  2. Prompt encoding overhead: Với box/point prompts, việc chạy prompt encoder + mask decoder per-click có thể gây lag nhận thấy. Batch prompt encoding (gom nhiều clicks trong 200-300ms) rồi infer một lần sẽ mượt hơn đáng kể.

  3. Memory footprint: ONNX Runtime + quantized int8 model giúp giảm RAM peak xuống ~1-1.5GB — đủ chạy song song với browser/IDE mà không swap. Có test quantized model chưa? FP16 thường đủ an toàn, int8 cần calibrate cẩn thận trên dataset domain-specific.

  4. Export format: COCO JSON + YOLO txt + Pascal VOC đồng thời sẽ cứu rất nhiều giờ convert downstream. Nên support cả instance segmentation (polygon/RLE) lẫn object detection (bbox) trong cùng một export.

  5. Keyboard-first UX: Annotator chuyên nghiệp 90% thời gian dùng bàn phím (switch class, PS: the tool I meant is on labagent .tech