Convert images on web !
The webapp is deployed Heroku Web here - https://modnet.herokuapp.com/ (abandoned)
The webapp is deployed IBM Cloud Foundry Web here - https://modnet.mybluemix.net/ (abandoned)
The webapp is deployed Streamlit Web here - https://modnet.streamlit.app/
Convert images on api !
The webapp is deployed Divio-Online here - https://modnet.us.aldryn.io/
The webapp is deployed Divio-Test here - https://modnet-stage.us.aldryn.io/
The webapp is deployed Heroku here - https://modnet-demo.herokuapp.com/ (abandoned)
The webapp is deployed Aliyun Severless here - http://modnet.ovzv.cn/ (abandoned)
The webapp is deployed AWS Lambda here -
- Original address of the projectMODNet
- The project used by this versionMODNet Onnx
Use the associated applications of the model
MODNet-model Human Matting(Look at the picture)
This project is to package the matting program implemented by modnet algorithm as docker image to provide API calling service. If you don't know modnet, please read the original author's warehouse first. What I'm going to talk about is to use docker to build modnet as an API for calling. Of course, you can also directly run the
app.py
in the form of flash. Docker is used to avoid configuration environment errors. Modnet can run on GPU or CPU. This project can use GPU or CPU.
Compiled project on hub.docker.com
Make sure you have
docker
installed
-
Clone the MODNet repository:
git clone https://github.com/LiteraturePro/MODNet.git cd MODNet
-
Input command to build image:
docker build -t mod-matting .
- I also provided the compilation command for
Heroku
, just replace the last command of dockerfile file with each other, - For general
CMD exec gunicorn --bind 0.0.0.0:8080 --workers 1 --threads 8 --timeout 0 app:app
- For heroku
CMD exec gunicorn --bind 0.0.0.0:$PORT --workers 1 --threads 8 --timeout 0 app:app
- For Aliyun Severless
- For Alibaba cloud functional computing service, it specifies that the service must run on port 9000, so two locations need to be changed, one of which is as follows
CMD exec gunicorn --bind 0.0.0.0:9000 --workers 1 --threads 8 --timeout 0 app:app
- The other one needs to be changed
app.py
Change8080
in to9000
port
- I also provided the compilation command for
-
Running image (You can specify the running port yourself):
docker run -p 8080:8080 mod-matting
Make sure you have
docker
installed
I have built the image and can install it directly. The installation command is as follows(You can specify the running port yourself):
-
For general
docker pull literature/modnet-matting:latest docker run -p 8080:8080 literature/modnet-matting:latest
-
For heroku
docker pull literature/modnet-matting:heroku
Please see the specific tutorial for installing container application in heroku
-
For Aliyun Serverless
docker pull literature/modnet-matting:sf
Please see the specific tutorial for installing container application in Aliyun Serverless
Now your service has started to run, but it runs on the local port. If you need to realize the external network call, you need to act as an agent to proxy the service to your domain name,
The call I have shown is based on the agent I have done. If you need to call it, you need to do it yourself
- provided that you have installed
docker
. After you deploy correctly, bothGET
andPOST
requests can be accessed. The actual display is as follows
Thanks for the work of the original author and the revised author. If you like, please give a star
.