-
Notifications
You must be signed in to change notification settings - Fork 144
Open
Description
OpenFace provided a docker image to use and I extended based on it with conda and flask to provide an api access to get au.csv from videos.
The image is available on aliyun registry: docker pull registry.cn-hangzhou.aliyuncs.com/sanbingyouyong/openface_extract_flask:latest
- run with
docker run -d --name openface_auto -p 8601:8601 openface_extract_flask:latest
The request can be sent using the following Python codes:
with open(video_full_path, 'rb') as f:
files = {'video': f}
form = {'video_name': video_name}
response = requests.post(openface_service_url, files=files, data=form)And the response is sent with send_file(output_file_path, as_attachment=True) and you can save the csv file like this:
with open(os.path.join(DATA_DIR, f'{video_name}/au.csv'), 'w') as f:
f.write(response.content.decode('utf-8'))If people are interested I can also post the Dockerfile (I need to make one then since I commit the image from my working container) and also the flask .py file that runs the service. Or as a PR, idk.
References:
OpenFace docker image from its wiki
Why we need to set OPENBLAS_NUM_THREADS
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels