Closed preddythandra closed 1 year ago
Solution: Changed the flag of reader function of IMREAD_COLOR
uploaded_image=request.files["image"]
# Update the code to read RGB image.
image = cv2.imdecode(np.fromstring(uploaded_image.read(), np.uint8), cv2.IMREAD_COLOR)
model = YOLO("yolov5s.pt")
Detailed Description:
The Image decoder is by default using the grayscale color encoding, where in the data from the android application is a RGB image and also if the YOLO model is feed with grayscale image, it results in loss of feature which could produce different boundary box generated by the algorithm.
Steps to Reproduce:
Simply run the server and provide a image as a multimedia file in the HTTP Request to the server.
Expected Behavior:
The image/ video frame with the boundary box must be returned to the client application.
Actual Behavior:
The server sends an error since YOLO used in supervision is trained on a RGB or three feature 2d image, this by giving a grayscale image it leades to error on the server side.
Before Fixing the bug: [Server Log]
After Fixing the bug: