tfjs-yolov5-example icon indicating copy to clipboard operation
tfjs-yolov5-example copied to clipboard

Is there a yolo5-tfjs available?

Open lebron8dong opened this issue 1 year ago • 5 comments

I cannot obtain tfjs-yolo5 via the tutorial.

lebron8dong avatar Mar 27 '23 07:03 lebron8dong

@lebron8dong Plz read the FAQ with a check list and a discussion for reference. What's the output in the terminal and the debug console of your browser?

zldrobit avatar Mar 28 '23 06:03 zldrobit

@zldrobit thanks,The tf.GraphModelLayersModel type I got via the tutorial, but I want to get the tf.LayersModel type.

lebron8dong avatar Mar 28 '23 06:03 lebron8dong

@zldrobit Is there a way to get it? I learned that keras can be converted to tf.LayersModel, but yolov5 cannot be exported to keras.

lebron8dong avatar Mar 28 '23 07:03 lebron8dong

@lebron8dong If you want tf.LayersModel type, you have to convert the model to SavedModel format first. Then, use tensorflowjs_converter to convert the model to tf.LayersModel. By contrast, yolov5 exports a tfjs model using GraphDef *.pb -> tf.GraphModel.

PS: Does using tf.GraphModel type make any difference in your application or scenario, compared with tf.LayersModel?

zldrobit avatar Mar 29 '23 03:03 zldrobit

@zldrobit This is not current possible, unless the model is converted from TensorFlow python keras model. In that case, I can convert the TF keras model to TFJS layers model directly. tf.loadGraphModel The API returns , which means that the parameter has been pinned and you cannot fine-tune the model with the new data. tf.LayersMode can examine the network structure and make modifications, etc.

lebron8dong avatar Mar 30 '23 06:03 lebron8dong