Skip to content
Snippets Groups Projects
Commit 46511284 authored by Vesa Halenius's avatar Vesa Halenius
Browse files

Update sbs_client.py

parent 477657e1
Branches
No related tags found
No related merge requests found
...@@ -10,9 +10,6 @@ import requests ...@@ -10,9 +10,6 @@ import requests
from requests_toolbelt.multipart.encoder import MultipartEncoder from requests_toolbelt.multipart.encoder import MultipartEncoder
import os import os
# Haarcascade for face detection
face_cascade = cv2.CascadeClassifier(".\haarcascade\haarcascade_frontalface_default.xml")
# Image file name and location # Image file name and location
image = ".\images\image.jpg" image = ".\images\image.jpg"
...@@ -28,7 +25,7 @@ def sendImage(): ...@@ -28,7 +25,7 @@ def sendImage():
} }
) )
response = requests.post("http://tensorflow.stop.capstone.utu.fi/api/v1/classifyImage/&stop_code=test", data=multipart_data, response = requests.post("http://tensorflow.stop.capstone.utu.fi/api/v1/classifyImage/", data=multipart_data,
headers={"Content-Type": multipart_data.content_type}) headers={"Content-Type": multipart_data.content_type})
# Removing image for security purposes # Removing image for security purposes
...@@ -41,10 +38,6 @@ def takePicture(): ...@@ -41,10 +38,6 @@ def takePicture():
ret, frame = cap.read() ret, frame = cap.read()
# Trying to detect faces
gray = cv2.cvtColor(frame, cv2.COLOR_BGR2GRAY)
faces = face_cascade.detectMultiScale(gray, 1.3, 5)
cv2.imwrite(image,frame) cv2.imwrite(image,frame)
cap.release() cap.release()
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment