Bro please
This commit is contained in:
Binary file not shown.
@@ -67,12 +67,10 @@ def make_move():
|
|||||||
frame, fen = game_service.make_move()
|
frame, fen = game_service.make_move()
|
||||||
print(fen)
|
print(fen)
|
||||||
|
|
||||||
encoded_frame = cv2.imencode('.jpg', frame)
|
|
||||||
image_bytes = encoded_frame[1].tobytes()
|
|
||||||
headers = {'Content-Type': 'image/jpeg'}
|
headers = {'Content-Type': 'image/jpeg'}
|
||||||
response = requests.post(
|
response = requests.post(
|
||||||
"https://192.168.15.125:1880/party/image",
|
"https://192.168.15.125:1880/party/image",
|
||||||
data=image_bytes,
|
data=frame,
|
||||||
headers=headers,
|
headers=headers,
|
||||||
verify=False)
|
verify=False)
|
||||||
print(response.status_code)
|
print(response.status_code)
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ class DetectionService:
|
|||||||
|
|
||||||
board = self.pieces_manager.pieces_to_board(detections, warped_corners, matrix, self.scale_size)
|
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]] :
|
def __run_complete_detection(self, frame : np.ndarray, display=False) -> dict[str, list[Results]] :
|
||||||
pieces_prediction = self.__run_pieces_detection(frame)
|
pieces_prediction = self.__run_pieces_detection(frame)
|
||||||
|
|||||||
Reference in New Issue
Block a user