/SSDMobileNet_CoreML

Real-time object-detection using SSD on Mobilenet on iOS using CoreML, exported using tf-coreml

Primary LanguageSwift

SSDMobileNet_CoreML

Real-time object-detection on iOS using CoreML model of SSD based on Mobilenet. This project contains an example-project for running real-time inference of that model on iOS.

To add the preprocessing to the coreml-model, I included some additional parameters in the convert-step (image_scale and bias). To make use of CoreVision's abilities to convert image-format / scaling, I added the image_input_names parameter:

coreml_model = tfcoreml.convert(
      tf_model_path=frozen_model_file,
      mlmodel_path=coreml_model_file,
      input_name_shape_dict=input_tensor_shapes,
      image_input_names="Preprocessor/sub:0",
      output_feature_names=output_tensor_names,
      image_scale=2./255.,
      red_bias=-1.0,
      green_bias=-1.0,
      blue_bias=-1.0
)