Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

edit #21

Merged
merged 1 commit into from
Apr 15, 2024
Merged

edit #21

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ tf-keras = "*"
numpy = "*"
pillow = "*"
jinja2 = "*"
coverage = "*"


[dev-packages]
Expand Down
64 changes: 63 additions & 1 deletion Pipfile.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions machine-learning-client/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
Machine learning client for detecting emotions in images.
This client connects to a MongoDB Atlas database, retrieves images.
It then processes the images to detect emotions for target faces, and updates db with the results.
OS: to set environment variable for ffmpeg
Time: to sleep for a second
Pymongo: to connect to MongoDB
FER: to detect emotions in images
Time: sleep for a second
Pymongo: connect to MongoDB
Deepface: to detect emotions in images
Numpy: numerical operations
...
"""
import base64
Expand Down
4 changes: 2 additions & 2 deletions machine-learning-client/test_client.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
from unittest.mock import patch, MagicMock
import pytest, os
from client import get_emotion, connect_db, FER
#from PIL import Image
from client import connect_db, get_emotion
from PIL import Image

os.environ["IMAGEIO_FFMPEG_EXE"] = "/usr/bin/ffmpeg"

Expand Down
2 changes: 0 additions & 2 deletions web-app/main.py
Original file line number Diff line number Diff line change
@@ -1,13 +1,11 @@
"""
Pymongo: Connecting to MongoDB via Python
Flask: Python web framework
Werkzeug: WSGI utility library for Python
Base64: Encode and decode images
"""
import base64
from flask import Flask, render_template, request, jsonify
from pymongo import MongoClient
#from werkzeug.utils import secure_filename


app = Flask(__name__)
Expand Down
2 changes: 1 addition & 1 deletion web-app/test_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
io: work with file-like objects
"""
from io import BytesIO
from app import app as flask_app
from main import app as flask_app
from flask import url_for
import pytest

Expand Down
Loading