[go: nahoru, domu]

Skip to content

Latest commit

 

History

History
33 lines (22 loc) · 1.58 KB

File metadata and controls

33 lines (22 loc) · 1.58 KB

Semantic Segmentation Sample with DETR

This sample demonstrates the use of DETR converted to Core ML. It allows semantic segmentation on iOS devices, where each pixel in an image is classified according to the most probable category it belongs to.

We leverage coremltools for model conversion and compression. You can read more about it here.

Instructions

  1. Download DETRResnet50SemanticSegmentationF16.mlpackage from the Hugging Face Hub and place it inside the models folder of the project.
  2. Open SemanticSegmentationSample.xcodeproj in Xcode.
  3. Build & run the project!

DEtection TRansformer (DETR) was introduced in the paper End-to-End Object Detection with Transformers by Carion et al. and first released in this repository.

Download

Core ML packages are available in apple/coreml-detr-semantic-segmentation. Install huggingface-cli

brew install huggingface-cli

Download DETRResnet50SemanticSegmentationF16.mlpackage to the models directory:

huggingface-cli download \
  --local-dir models --local-dir-use-symlinks False \
  apple/coreml-detr-semantic-segmentation \
  --include "DETRResnet50SemanticSegmentationF16.mlpackage/*"

To download all the model versions, including quantized ones, skip the --include argument.