Cognitive-Face-Python
Cognitive-Face-Python copied to clipboard
Add type bytes, then You can read image file by yourself.
I add a type bytes, then user can read file by itself. For example, I use opencv to capture image from ipcam, then change it type from ndarray to bytes.
I = ipcam.getframe()
I = cv2.resize(I, (720, 480))
Ibyte = cv2.imencode(".jpg", I)[1].tostring()
Hi @LuxunHuang, thanks for your contribution.
- Could you please also take care of the comments in this query?
- Can you confirm this works both under Python 3.6 (& 3.7) and Python 2.7?
@LuxunHuang when I use this patch, I get stat: embedded null character in path because the os.path.isfile(image) comes before your check; and image at that point is bytes. Just need to have your elif block come before the isfile check