hollance / YOLO-CoreML-MPSNNGraph

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

Question of implementation #45

Open jack-chui opened 5 years ago

jack-chui commented 5 years ago

Hi, I saw you implementation about Tiny YOLO in

YOLO-CoreML-MPSNNGraph/TinyYOLO-CoreML/TinyYOLO-CoreML/Helpers.swift

I modified some parameters without changing any main logic. However, I found that the confidence result on iPhone is significantly different with computer version.

I got 0.91 in computer version and 0.18 for iPhone version. Do you know what happen? Computer version: https://github.com/thtrieu/darkflow

hollance commented 5 years ago

That is a really vague question... there is not enough information here to give an answer.

jack-chui commented 5 years ago

I saw your implementation which refer in the following link: https://github.com/tensorflow/tensorflow/blob/master/tensorflow/examples/android/src/org/tensorflow/demo/TensorFlowYoloDetector.java

But the offset calculation is different with the reference. Your implementation determine channel -> y position -> x position The reference code determine y position -> x position -> channel

What is the output sequence in Tiny YOLO features? Is that x, y, w, h, c?

hollance commented 5 years ago

In CoreML the output order is always channels, height, width. It does this automatically, which is why it is different from the reference code.