Skip to content

Docker API to generate human masks using Detectron2

Notifications You must be signed in to change notification settings

enric1994/detectron-api

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Human Mask Generator API, made using Facebook's Detectron2 model

Powered by Docker. GPU support

Hits

Input

Output

Dependencies

Usage

  1. From the docker folder run: docker-compose up -d

After building the Docker container (it can take a while), the API will start.

You can check the status of the container with: docker ps -a

You can also see what's going on inside the container with docker logs detectron-api -f

  1. On the main folder run: python send_file.py

This will send demo_img.jpg to the API using the Python requests package.

Feel free to modify the script and add it to your pipeline

import requests

# Load file
with open('demo_img.jpg', 'rb') as f:
    contents = f.read()

    files=dict(img1=contents)
    
    # Send file
    response = requests.post('http://localhost:5000/',
        files=files)

    # Save the received file
    with open('response_file.png', 'wb') as f:
        f.write(response.content)

Tested on Ubuntu 18.04 with a RTX 2080 Ti GPU (drivers 440.36)

Advantages

  • You don't have to install CUDA
  • Language agnostic
  • Very easy to integrate in any pipeline, only a HTTP request needed.
  • The API will be isolated from your code. No dependency errors

About

Docker API to generate human masks using Detectron2

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published