How do I save a cv2 processed image to django models?
问题 I use opencv to crop images and I'd like to save them to the models, I load the file directly to computeLogoFromMemoryFILE where it is processed, from there how can I save the image to TempImage model? views.py: form = myForm(request.FILES) if form.is_valid(): cropped_image = computeLogoFromMemoryFILE(request.FILES.get('logo')) # ... temp_image = TempImage.objects.create(image=?) cv2: # (np == numpy) def computeLogoFromMemoryFILE(logo): logo.seek(0) image = cv2.imdecode(np.fromstring(logo