MAFAT Satellite Vision Challenge Forum

Go back to competition Back to thread list Post in this thread

> Preprocessing image before predict function

I received a TypeError in the ingestion program with the message: "can't convert np.ndarray of type numpy.uint16. The only supported types are: float64, float32, float16, complex64, complex128, int64, int32, int16, int8, uint8, and bool." I suspect that the issue is with the cv2.imread() function used for loading the image, and I want to switch from using cv2.imread(img, -1) to cv2.imread(img, 0).
Can the predict function be modified to accept the image path as input or allow for the use of cv2.imread(img, 0) instead of cv2.imread(img, -1)?
Thank you for your kind assistance.

Best regards,

Posted by: Danielle @ April 11, 2023, 5:59 a.m.

Unfortunately, we won't provide the images' paths of the test sets.
The error seems to happen in the predict function after receiving a result from your model.
I suggest running the inference pipeline to check what and where the error is in your submission code.
You can run this short code snippet that demonstrates the inference pipeline (without statistic calibration and metadata):

from model import model
import cv2
image_path = '/content/images/126_0_1280.tiff'
predictor = model()
img = cv2.imread(image_path, -1)
res = predictor.predict(img, None)

I hope this example will clear things out,
MAFAT Challenge Team

Posted by: MAFAT_Challenge @ April 11, 2023, 7:53 a.m.
Post in this thread