I'm doing some image manipulation, and I'm able to download the images, but trying to figure out how to save the images directly to google drive.
mask_out=cv2.subtract(rgb,img)
mask_out=cv2.subtract(rgb,mask_out)
mask_out[rgb == [20, 0, 25]] = 255
cv2.imwrite('out4.jpeg' , mask_out)
cv2_imshow(mask_out)
cv2.waitKey(0)
cv2.imwrite('res.png' , mask_out)
files.download('res.png')
you can see from the code that the desired image exists within the mask-out variable. It's easy enough to read files from Drive in Colab but I can't find the docs on saving files.