diff --git a/client/sbs_client.py b/client/sbs_client.py index 1232522dba6511bd89042d6cd86aca7fc24b6ff2..58c3ed984ec6d933f168798363ce839f09fe3cbe 100644 --- a/client/sbs_client.py +++ b/client/sbs_client.py @@ -10,9 +10,6 @@ import requests from requests_toolbelt.multipart.encoder import MultipartEncoder import os -# Haarcascade for face detection -face_cascade = cv2.CascadeClassifier(".\haarcascade\haarcascade_frontalface_default.xml") - # Image file name and location image = ".\images\image.jpg" @@ -21,15 +18,15 @@ image = ".\images\image.jpg" def sendImage(): # Send local image file to tensorflow-client multipart_data = MultipartEncoder( - fields={ - # a file upload field - "image": ("image.jpg", open(image, "rb"), "image/jpg"), - "stop_code": "Test" - } - ) + fields={ + # a file upload field + "image": ("image.jpg", open(image, "rb"), "image/jpg"), + "stop_code": "Test" + } + ) - response = requests.post("http://tensorflow.stop.capstone.utu.fi/api/v1/classifyImage/&stop_code=test", data=multipart_data, - headers={"Content-Type": multipart_data.content_type}) + response = requests.post("http://tensorflow.stop.capstone.utu.fi/api/v1/classifyImage/", data=multipart_data, + headers={"Content-Type": multipart_data.content_type}) # Removing image for security purposes def removeImage(): @@ -41,13 +38,9 @@ def takePicture(): 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) cap.release() takePicture() sendImage() -removeImage() +removeImage() \ No newline at end of file