Upload handler.py
Browse files70 unmodified lines71727374747576772 unmodified lines8081828384858687888990919293838485868788899091929394959670 unmodified lines retval , buffer = cv2.imencode('.jpg', clothes) cv2.imwrite("result.jpg", clothes) # create base 64 object jpg_as_text = base64.b64encode(buffer) jpg_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 imageprint(Model(data))# 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