HTTP service wrapper for U^2-Net

adakoda
2 min readDec 24, 2020
https://github.com/NathanUA/U-2-Net

The source code for wrapping U^2-Net as an http server is now available!

As shown in the previous article, U^2-Net is an attractive machine learning model that can create human portrait drawing from human photo. However, to use this machine model requires a Python environment like that used by developers and is not easily accessible to end-users.

Therefore, in order to make it available to end-users as a web service, like any other service, I have prepared a repository that wraps this machine learning model as an HTTP service. Although this can not be used in final product, but I think it is enough to be used as a reference source code to build a web server. Please try it out for yourself!

U^2Net HTTP Demo

How to use

Run server

To start the server, simply call main.py.

The default source code accepts requests from clients on port 8080 on localhost.

Post an image to test server

Let’s try posting an image from the client to see if the server is working correctly.

Input image

If successful, the image of the posted human photo will be converted into an illustration on the server and returned to the client!

Output image

The image you post to the server can be any human image. Next, try it with an image of your choice!

--

--