Skip to content

Minimal scripts for testing U-2-Net models in Keras

License

Notifications You must be signed in to change notification settings

Voinic/u2net-keras

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

u2net-keras

Simple scripts for testing U-2-Net models in Keras.
Based on https://github.com/NathanUA/U-2-Net and https://github.com/shreyas-bk/U-2-Net-Keras
Keras u2net, u2netp and u2net_portrait models were converted from the original pytorch models.

Quick start

  1. Clone this repo to local
git clone https://github.com/Voinic/u2net-keras.git
  1. Get models from here

  2. Test u2net/u2netp (background substraction) models

python u2net-keras.py images/input.jpg images/output.png
  1. Test u2net_portrait model
python u2net_portrait-keras.py images/input_portrait.jpg images/output_portrait.png

Results

Background substraction model
input
output
Portrait creation model
input_portrait
output_portrait

Known issues

  • Dont work with tensorflow without CUDA support.