Fixed None exception when no board is detected
This commit is contained in:
@@ -62,10 +62,13 @@ class DetectionService:
|
|||||||
edges_prediction = result["edges"]
|
edges_prediction = result["edges"]
|
||||||
pieces_prediction = result["pieces"]
|
pieces_prediction = result["pieces"]
|
||||||
|
|
||||||
warped_corners, matrix = self.board_manager.process_frame(edges_prediction[0], frame, self.scale_size)
|
processed_frame = self.board_manager.process_frame(edges_prediction[0], frame, self.scale_size)
|
||||||
if matrix is None:
|
if processed_frame is None:
|
||||||
return None
|
return None
|
||||||
|
|
||||||
|
warped_corners = processed_frame[0]
|
||||||
|
matrix = processed_frame[1]
|
||||||
|
|
||||||
detections = self.pieces_manager.extract_pieces(pieces_prediction)
|
detections = self.pieces_manager.extract_pieces(pieces_prediction)
|
||||||
|
|
||||||
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user