Commit 5a723b3c authored by Manoj Kumar's avatar Manoj Kumar

Merge branch 'manoj_dev' into 'master'

testing with bavan  - file locations

See merge request !61
parents f288dac3 c7b0b64d
......@@ -18,10 +18,12 @@ from PIL import Image
from tensorflow import keras
sys.path.append('.')
#from translation.modelUp import sign_predict
from translation.trans import sign_predict
from translation.trans import Translation
from object_detection.utils import label_map_util
from object_detection.utils import visualization_utils as vis_util
from skimage.transform import resize
#Set Base Path
PATH = os.path.dirname(os.path.abspath(__file__))
......@@ -81,6 +83,8 @@ def run_inference_for_single_image(image, graph):
output_dict['detection_masks'] = output_dict['detection_masks'][0]
return output_dict
translation = Translation()
#initialize camera
cap = cv2.VideoCapture(0)
from PIL import Image
......@@ -104,7 +108,7 @@ try:
while True:
ret, image_np = cap.read()
temp_image = image_np.copy()
# Expand dimensions since the model expects images to have shape: [1, None, None, 3]
image_np_expanded = np.expand_dims(image_np, axis=0)
# Actual detection.
......@@ -125,9 +129,14 @@ try:
###
# I will be sending a POST request to u. a hand picture
if score > 80:
print(image_np_expanded.shape)
img = Image.fromarray(image_np,'RGB')
sign_predict(img)
#print(image_np_expanded.shape)
img = Image.fromarray(temp_image)
#print(image_np.shape)
img.save(os.getcwd() + "\\" + "capture.jpg")
# array_for_translation = resize(image_np,(224,224,3))
# print(array_for_translation.shape)
translation.sign_predict(os.getcwd() + "\\" + "capture.jpg")
# sign_predict(image_np) <-- still under development
#waiting for the API on that component to be built
# end send request
......
import os
path_to_static = os.getcwd() + '\\static'
print(path_to_static)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment