GithubHelp home page GithubHelp logo

jeremyleonardo / insightface-api Goto Github PK

View Code? Open in Web Editor NEW
8.0 2.0 4.0 114 KB

A simple deepinsight/insightface implementation with FastAPI for face verification.

Python 88.38% Dockerfile 9.85% Shell 1.77%
insightface face-identification fastapi api face-verification face-verification-api face-recognition python python3 uvicorn

insightface-api's Introduction

Insightface API

About

A simple deepinsight/insightface implementation with FastAPI for face verification.

Possible Improvements

  • Use a proper db migration package such as alembic

Available APIs

It is recommended to test the available APIs from [GET] /docs

  • [GET] / - Root

    • Check API status
  • [POST] /upload-selfie - Upload Selfie

    • Upload selfie image file with person name and store it to database
  • [POST] /face-verification - Face Verification

    • Upload selfie image file and a person name from the database to verify
  • [POST] /face-search - Face Search

    • Upload selfie image file to search for similar faces in database
  • [PUT] /faces - Update Face

    • Update face data (name or face data) in the database
  • [GET] /faces - Get Faces

    • Get faces from database
  • [DELETE] /faces - Delete Face

    • Delete a face from database using name from database
  • [POST] /analyze-image-url - Analyze Image Url

    • Send image url to analyze (does not save to database)
  • [POST] โ€‹/analyze-image-file - Analyze Image File

    • Upload image file to analyze (does not save to database)
  • [POST] /compute-selfie-image-files-similarity - Compute Selfie Image Files Similarity

    • Compute similarity of 2 selfie image files (does not save to database)

Quickstart

Setup

First you must run setup_model.sh to load the model.

Run

Using docker-compose (RECOMMENDED):

docker-compose up

Using pipenv (you'll need to setup postgresql and .env on your own):

pipenv run uvicorn app.main:app --reload

Using poetry (you'll need to setup postgresql and .env on your own):

poetry run uvicorn app.main:app --reload

Models

You can download the model files and move them into ~/.insightface/models manually or just use setup_model.sh

Original source:

Alternative:

insightface-api's People

Contributors

jeremyleonardo avatar vleeuwenmenno avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

insightface-api's Issues

`jeremyleo/postgres-2k-cube` docker image

Hi @jeremyleonardo , i come across your repo lately, can I know what is the docker file you use to build jeremyleo/postgres-2k-cube docker image? Because I try to mount the volume from the database to my local but I fail to do so, can you show me you docker file to build the jeremyleo/postgres-2k-cube docker image and how to set or find out where will the database store in the docker container created?

Issues uploading selfie, cube limit 100

This project looks like basically what I need! I tried running docker compose up but it failed while building the postgress image complaining about clang7 binaries not being found. Out of curiousity, why bother building your own image instead of using one from docker.io?

Aside from that I managed to run it using the default postgres container but obviously now I run into the issue of the cube max dim of 100.

27.02 postgresql-13.1/configure.in
27.02 postgresql-13.1/INSTALL
27.02 + cd /build/postgresql-13.1/contrib/cube
27.02 + sed -i s/#define CUBE_MAX_DIM (100)/#define CUBE_MAX_DIM (2000)/ cubedata.h
27.02 + USE_PGXS=true make
27.05 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o cube.o cube.c
27.36 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2   -c -o cubeparse.o cubeparse.c
27.55 gcc -Wall -Wmissing-prototypes -Wpointer-arith -Wdeclaration-after-statement -Werror=vla -Wendif-labels -Wmissing-format-attribute -Wimplicit-fallthrough=3 -Wformat-security -fno-strict-aliasing -fwrapv -fexcess-precision=standard -Wno-format-truncation -Wno-stringop-truncation -g -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -fno-omit-frame-pointer -fPIC -shared -o cube.so  cube.o cubeparse.o -L/usr/lib/x86_64-linux-gnu  -Wl,-z,relro -Wl,-z,now -L/usr/lib/llvm-7/lib  -Wl,--as-needed  -lm 
27.56 /usr/bin/clang-7 -Wno-ignored-attributes -fno-strict-aliasing -fwrapv -O2  -I. -I./ -I/usr/include/postgresql/13/server -I/usr/include/postgresql/internal  -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -I/usr/include/libxml2  -flto=thin -emit-llvm -c -o cube.bc cube.c
27.56 make: /usr/bin/clang-7: Command not found
27.56 make: *** [/usr/lib/postgresql/13/lib/pgxs/src/makefiles/../../src/Makefile.global:1051: cube.bc] Error 127

Maybe I'm doing something wrong?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.