Init funtional of api
This commit is contained in:
parent
9667bd64b9
commit
086fdd6958
|
@ -0,0 +1 @@
|
|||
__pycache__/main.cpython-311.pyc
|
10
README.md
10
README.md
|
@ -0,0 +1,10 @@
|
|||
Api to get emotions, age, gender , race and rectangle of face.
|
||||
|
||||
in a Post in http://127.0.0.1:7860/faces/ with a json in body with this format:
|
||||
|
||||
{"path":"data/3.jpg","actions":["age", "gender", "emotion", "race"]}
|
||||
|
||||
|
||||
** install
|
||||
|
||||
install requeriments.txt
|
Binary file not shown.
After Width: | Height: | Size: 127 KiB |
Binary file not shown.
After Width: | Height: | Size: 124 KiB |
Binary file not shown.
After Width: | Height: | Size: 124 KiB |
Binary file not shown.
After Width: | Height: | Size: 123 KiB |
Binary file not shown.
After Width: | Height: | Size: 123 KiB |
|
@ -0,0 +1,37 @@
|
|||
from deepface import DeepFace
|
||||
from fastapi import FastAPI
|
||||
from pydantic import BaseModel
|
||||
from typing import Optional
|
||||
# objs = DeepFace.analyze(img_path = "data/1.jpg",
|
||||
# actions = ['age', 'gender', 'race', 'emotion']
|
||||
# )
|
||||
# print(objs)
|
||||
# objs = DeepFace.analyze(img_path = "data/2.jpg",
|
||||
# actions = ['age', 'gender', 'race', 'emotion']
|
||||
# )
|
||||
# print(objs)
|
||||
# objs = DeepFace.analyze(img_path = "data/3.jpg",
|
||||
# actions = ['age', 'gender', 'race', 'emotion']
|
||||
# )
|
||||
# print(objs)
|
||||
# objs = DeepFace.analyze(img_path = "data/4.jpg",
|
||||
# actions = ['age', 'gender', 'race', 'emotion']
|
||||
# )
|
||||
# print(objs)
|
||||
|
||||
# print(objs)
|
||||
|
||||
class Response(BaseModel):
|
||||
path: str
|
||||
actions : Optional[list] = ['age', 'gender', 'race', 'emotion']
|
||||
app = FastAPI()
|
||||
@app.get("/")
|
||||
def read_main():
|
||||
return {"message": "This is your main app"}
|
||||
@app.post("/faces/")
|
||||
def calculate_api(response: Response):
|
||||
path = response.path
|
||||
actions = response.actions
|
||||
objs = DeepFace.analyze(img_path =path,
|
||||
actions = actions)
|
||||
return objs
|
|
@ -0,0 +1,71 @@
|
|||
absl-py==2.0.0
|
||||
annotated-types==0.6.0
|
||||
anyio==3.7.1
|
||||
astunparse==1.6.3
|
||||
beautifulsoup4==4.12.2
|
||||
blinker==1.7.0
|
||||
cachetools==5.3.2
|
||||
certifi==2023.11.17
|
||||
charset-normalizer==3.3.2
|
||||
click==8.1.7
|
||||
deepface==0.0.80
|
||||
Deprecated==1.2.14
|
||||
fastapi==0.106.0
|
||||
filelock==3.13.1
|
||||
fire==0.5.0
|
||||
Flask==3.0.0
|
||||
flatbuffers==23.5.26
|
||||
gast==0.5.4
|
||||
gdown==4.7.1
|
||||
google-auth==2.25.2
|
||||
google-auth-oauthlib==1.2.0
|
||||
google-pasta==0.2.0
|
||||
grpcio==1.60.0
|
||||
gunicorn==21.2.0
|
||||
h11==0.14.0
|
||||
h5py==3.10.0
|
||||
idna==3.6
|
||||
itsdangerous==2.1.2
|
||||
Jinja2==3.1.2
|
||||
keras==2.15.0
|
||||
libclang==16.0.6
|
||||
Markdown==3.5.1
|
||||
MarkupSafe==2.1.3
|
||||
ml-dtypes==0.2.0
|
||||
mtcnn==0.1.1
|
||||
numpy==1.26.2
|
||||
oauthlib==3.2.2
|
||||
opencv-python==4.8.1.78
|
||||
opt-einsum==3.3.0
|
||||
packaging==23.2
|
||||
pandas==2.1.4
|
||||
Pillow==10.1.0
|
||||
protobuf==4.23.4
|
||||
pyasn1==0.5.1
|
||||
pyasn1-modules==0.3.0
|
||||
pydantic==2.5.3
|
||||
pydantic_core==2.14.6
|
||||
PySocks==1.7.1
|
||||
python-dateutil==2.8.2
|
||||
pytz==2023.3.post1
|
||||
requests==2.31.0
|
||||
requests-oauthlib==1.3.1
|
||||
retina-face==0.0.13
|
||||
rsa==4.9
|
||||
six==1.16.0
|
||||
sniffio==1.3.0
|
||||
soupsieve==2.5
|
||||
starlette==0.27.0
|
||||
tensorboard==2.15.1
|
||||
tensorboard-data-server==0.7.2
|
||||
tensorflow==2.15.0.post1
|
||||
tensorflow-estimator==2.15.0
|
||||
tensorflow-io-gcs-filesystem==0.35.0
|
||||
termcolor==2.4.0
|
||||
tqdm==4.66.1
|
||||
typing_extensions==4.9.0
|
||||
tzdata==2023.3
|
||||
urllib3==2.1.0
|
||||
uvicorn==0.25.0
|
||||
Werkzeug==3.0.1
|
||||
wrapt==1.14.1
|
Loading…
Reference in New Issue