Bro please

This commit is contained in:
2025-12-31 14:22:00 +01:00
parent 2286108be1
commit 13ec518d2a
3 changed files with 2 additions and 4 deletions

Binary file not shown.

View File

@@ -67,12 +67,10 @@ def make_move():
frame, fen = game_service.make_move()
print(fen)
encoded_frame = cv2.imencode('.jpg', frame)
image_bytes = encoded_frame[1].tobytes()
headers = {'Content-Type': 'image/jpeg'}
response = requests.post(
"https://192.168.15.125:1880/party/image",
data=image_bytes,
data=frame,
headers=headers,
verify=False)
print(response.status_code)

View File

@@ -58,7 +58,7 @@ class DetectionService:
board = self.pieces_manager.pieces_to_board(detections, warped_corners, matrix, self.scale_size)
return pieces_prediction[0].plot().tobytes(), self.pieces_manager.board_to_fen(board)
return cv2.imencode(".jpg", pieces_prediction[0].plot())[1].tobytes(), self.pieces_manager.board_to_fen(board)
def __run_complete_detection(self, frame : np.ndarray, display=False) -> dict[str, list[Results]] :
pieces_prediction = self.__run_pieces_detection(frame)