Upload handler.py
Browse files70 unmodified lines717273747576772 unmodified lines808182838485868788899091929394959670 unmodified linesretval , buffer = cv2.imencode('.jpg', clothes)cv2.imwrite("result.jpg", clothes)# create base 64 objectjpg_as_text = base64.b64encode(buffer)print("checkpoint 4")###########################################################################return jpg_as_text2 unmodified lines# test runModel = EndpointHandler()data = {"inputs": {"isurl": True,# "path": "http://10.10.2.100/cam-lo.jpg","path": "https://www.next.us/nxtcms/resource/blob/5791586/ee0fc6a294be647924fa5f5e7e3df8e9/hoodies-data.jpg",# "key": "iJuYzEzNEFSaQq4e0hfE",}}# test file imageprint(Model(data))#test url# print(Model("http://10.10.2.100/cam-lo.jpg", 1))70 unmodified lines717273747576772 unmodified lines808182838485868788899091929394959670 unmodified linesretval , buffer = cv2.imencode('.jpg', clothes)cv2.imwrite("result.jpg", clothes)# create base 64 objectjpg_as_text = base64.b64encode(buffer).decode("utf-8") # Decode bytes to string")print("checkpoint 4")###########################################################################return jpg_as_text2 unmodified lines# test run# Model = EndpointHandler()# data = {# "inputs": {# "isurl": True,# # "path": "http://10.10.2.100/cam-lo.jpg",# "path": "https://www.next.us/nxtcms/resource/blob/5791586/ee0fc6a294be647924fa5f5e7e3df8e9/hoodies-data.jpg",# # "key": "iJuYzEzNEFSaQq4e0hfE",# }# }# # test file image# print(Model(data))#test url# print(Model("http://10.10.2.100/cam-lo.jpg", 1))
handler.py+12-12