Try stuff
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import cv2
|
||||
import numpy as np
|
||||
import requests
|
||||
|
||||
from services.clock_service import ClockService
|
||||
@@ -22,16 +23,5 @@ class GameService:
|
||||
self.clock_service.stop()
|
||||
self.detection_service.stop()
|
||||
|
||||
def make_move(self) -> None:
|
||||
img, fen = self.detection_service.analyze_single_frame()
|
||||
print(fen)
|
||||
|
||||
encoded_frame = cv2.imencode('.jpg', img)
|
||||
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,
|
||||
headers=headers,
|
||||
verify=False)
|
||||
print(response.status_code)
|
||||
def make_move(self) -> tuple[bytes, str]:
|
||||
return self.detection_service.analyze_single_frame()
|
||||
Reference in New Issue
Block a user