HTTP service wrapper for 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!

How to use

To start the server, simply call

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

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

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

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



Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store