Skip to content

3 step pipeline to convert u2net model from .pth format to .tflite format

Notifications You must be signed in to change notification settings

zhangyuan1283/u2net-converter

Repository files navigation

Instructions for use

Overview

This repository provides functionality for a 3 step conversion process to convert the U2Net model from its original PyTorch format to TensorFlowLite format.

Pre-Requisites

  1. Install the required dependencies via pip install -r requirements.txt
  2. Download the pre-trained u2net model here and place it in content/.
  3. Place an image of choice(.jpg) in content/
  4. Run the pth_onnx script. The output model should appear in the root directory.
  5. Verify the successfulness of the conversion by examining the console statements.
  6. Run the convert_onnx_tf script. The converted model will appear in the root directory.
  7. Run the convert_tf_tflite script. The converted model will appear in the root directory.

Notes

The repository also includes model-dimensions.py, which is a python script that prints the input requirements of a model. This is to facilitiate ease of integration of the model into your program.

Credits

Source code taken from farmaker47, which can be found here

About

3 step pipeline to convert u2net model from .pth format to .tflite format

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages