I have a form where users can upload up to 1,000 images at a time. I have changed my FILE_UPLOAD_MAX_MEMORY_SIZE in Django settings to 0 so all files uploaded via a form are written to a temp directory in my root folder.
I am then trying to process the images with OpenCV.
original_img = cv2.imread(temp_image.temporary_file_path())
gray = cv2.cvtColor(original_img,cv2.COLOR_BGR2GRAY)
temp_image.temporary_file_path()
This returns the absolute file path of the temp image in a string format
So I put that in the cv2.imread, however, it creates a NoneType instead of a numpy array like it should and then my program cannot run when it reaches
gray = cv2.cvtColor(original_img,cv2.COLOR_BGR2GRAY)
How do I read the temporary file into OpenCV?
Any help is much appreciated.