Open SohaibShafiq1 opened 3 years ago
In case if Someone deploys the app, he got the valid files on server running.
I found the other solution as well. (image-url=The url of the image user wants to classify.) import numpy as np image_bytes = io.BytesIO(image-url) image = Image.open(image_bytes) result=classifier.classify(np.array(image)) It worked.
First i use io as:
image_bytes = io.BytesIO(image-url) image = Image.open(image_bytes) result=classifier.classify(image)
then: in .virtaulenv>(venv-name)>lib>site-packages>nudenet>image_utils.py>load_img
Previous: if isinstance(path, type("")): img = pil_image.open(path) else: path = cv2.cvtColor(path, cv2.COLOR_BGR2RGB) img = pil_image.fromarray(path)
Now: if isinstance(path, type("")): img = pil_image.open(np.array(path)) else: path = cv2.cvtColor(np.array(path), cv2.COLOR_BGR2RGB) img = pil_image.fromarray(path)
It worked.
But if nudenet edit this from their end it will be good. Because when i will deploy the app, the actuall files be the files of nudenet not mine(image_utils.py file). So i wants to request the nudenet to update the code.