Skip to content

Commit

Permalink
unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
serengil committed Nov 10, 2024
1 parent 0b38a3c commit a4479ce
Show file tree
Hide file tree
Showing 3 changed files with 142 additions and 12 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ jobs:
run: |
python -m pip install --upgrade pip
pip install pytest
pip install Werkzeug==2.0.2
pip install flask==2.0.2
pip install .
- name: Test with pytest
Expand Down
150 changes: 139 additions & 11 deletions deepface/api/postman/deepface-api.postman_collection.json
Original file line number Diff line number Diff line change
@@ -1,12 +1,54 @@
{
"info": {
"_postman_id": "4c0b144e-4294-4bdd-8072-bcb326b1fed2",
"_postman_id": "26c5ee53-1f4b-41db-9342-3617c90059d3",
"name": "deepface-api",
"schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json"
},
"item": [
{
"name": "Represent",
"name": "Represent - form data",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "img",
"type": "file",
"src": "/Users/sefik/Desktop/deepface/tests/dataset/img1.jpg"
},
{
"key": "model_name",
"value": "Facenet",
"type": "text"
}
],
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://127.0.0.1:5005/represent",
"protocol": "http",
"host": [
"127",
"0",
"0",
"1"
],
"port": "5005",
"path": [
"represent"
]
}
},
"response": []
},
{
"name": "Represent - default",
"request": {
"method": "POST",
"header": [],
Expand All @@ -20,15 +62,15 @@
}
},
"url": {
"raw": "http://127.0.0.1:5000/represent",
"raw": "http://127.0.0.1:5005/represent",
"protocol": "http",
"host": [
"127",
"0",
"0",
"1"
],
"port": "5000",
"port": "5005",
"path": [
"represent"
]
Expand All @@ -37,7 +79,7 @@
"response": []
},
{
"name": "Face verification",
"name": "Face verification - default",
"request": {
"method": "POST",
"header": [],
Expand All @@ -51,15 +93,62 @@
}
},
"url": {
"raw": "http://127.0.0.1:5000/verify",
"raw": "http://127.0.0.1:5005/verify",
"protocol": "http",
"host": [
"127",
"0",
"0",
"1"
],
"port": "5005",
"path": [
"verify"
]
}
},
"response": []
},
{
"name": "Face verification - form data",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "img1",
"type": "file",
"src": "/Users/sefik/Desktop/deepface/tests/dataset/img1.jpg"
},
{
"key": "img2",
"type": "file",
"src": "/Users/sefik/Desktop/deepface/tests/dataset/img2.jpg"
},
{
"key": "model_name",
"value": "Facenet",
"type": "text"
}
],
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://127.0.0.1:5005/verify",
"protocol": "http",
"host": [
"127",
"0",
"0",
"1"
],
"port": "5000",
"port": "5005",
"path": [
"verify"
]
Expand All @@ -68,29 +157,68 @@
"response": []
},
{
"name": "Face analysis",
"name": "Face analysis - default",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "raw",
"raw": "{\n \"img\": \"/Users/sefik/Desktop/deepface/tests/dataset/couple.jpg\",\n \"actions\": [\"age\", \"gender\", \"emotion\", \"race\"]\n}",
"raw": "{\n \"img\": \"/Users/sefik/Desktop/deepface/tests/dataset/img1.jpg\",\n \"actions\": [\"age\", \"gender\", \"emotion\", \"race\"]\n}",
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://127.0.0.1:5000/analyze",
"raw": "http://127.0.0.1:5005/analyze",
"protocol": "http",
"host": [
"127",
"0",
"0",
"1"
],
"port": "5000",
"port": "5005",
"path": [
"analyze"
]
}
},
"response": []
},
{
"name": "Face analysis - form data",
"request": {
"method": "POST",
"header": [],
"body": {
"mode": "formdata",
"formdata": [
{
"key": "img",
"type": "file",
"src": "/Users/sefik/Desktop/deepface/tests/dataset/img1.jpg"
},
{
"key": "actions",
"value": "\"[age, gender]\"",
"type": "text"
}
],
"options": {
"raw": {
"language": "json"
}
}
},
"url": {
"raw": "http://localhost:5005/analyze",
"protocol": "http",
"host": [
"localhost"
],
"port": "5005",
"path": [
"analyze"
]
Expand Down
2 changes: 1 addition & 1 deletion requirements_local
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ pandas==2.0.3
Pillow==9.0.0
opencv-python==4.9.0.80
tensorflow==2.13.1
keras==2.13.1
keras==2.13.1

0 comments on commit a4479ce

Please sign in to comment.