hollance / YOLO-CoreML-MPSNNGraph

Tiny YOLO for iOS implemented using CoreML but also using the new MPS graph API.
MIT License
933 stars 252 forks source link

Lower input sizes issues #21

Closed anonym24 closed 6 years ago

anonym24 commented 6 years ago
  public static let inputWidth = 416
  public static let inputHeight = 416

I tried to set smaller values

  public static let inputWidth = 256
  public static let inputHeight = 256

but the rects aren't drawn correctly

hollance commented 6 years ago

The input size is 416x416 because it gets scaled down 5 times to be 13x13. If you set the input to 256x256 and scale it down 5 times the final grid becomes 8x8, and so you'll have to adjust the code that computes the bounding boxes for that too. (But I'm not sure how well this will actually work...)

anonym24 commented 6 years ago

of course accuracy will become much worse but it should process faster, thanks for the answer I'll try to change grid values

could you also please tell me on which devices did you tested this project and how fast it works, iPhone 7, 8 or mb even X?

I had time to test only on old iPad mini 2 (2 core, 1.3 GHz) :)

anonym24 commented 6 years ago

also would be great to implement Tensorflow object model (ssd_mobilenet_v1_coco) for CoreMl

https://github.com/tensorflow/models/tree/master/research/object_detection https://github.com/tensorflow/models/blob/master/research/object_detection/g3doc/detection_model_zoo.md

There is already a project to run Tensorflow object detection model on iOS, but it works with Tensorflow (and it's Objective-C) https://github.com/JieHe96/iOS_Tensorflow_ObjectDetection_Example

hollance commented 6 years ago

I think this gets about 10 FPS on the iPhone 7. I haven't tried on 8 or X. However, I did implement MobileNet+SSD (for a client, so I cannot share the code) and it gets 30 FPS on iPhone 7. So it's a lot faster than Tiny YOLO, and I think it's similar in accuracy.

anonym24 commented 6 years ago

wow results sounds good:) yeah I understand you can't share it

thanks for answers