|
@@ -1,8 +1,10 @@
|
|
|
import cv2
|
|
import cv2
|
|
|
import numpy as np
|
|
import numpy as np
|
|
|
|
|
+import os
|
|
|
from io import BytesIO
|
|
from io import BytesIO
|
|
|
from PIL import Image
|
|
from PIL import Image
|
|
|
from ppadb.client import Client as AdbClient
|
|
from ppadb.client import Client as AdbClient
|
|
|
|
|
+from dotenv import load_dotenv
|
|
|
|
|
|
|
|
with_cuda = 0
|
|
with_cuda = 0
|
|
|
if cv2.cuda.getCudaEnabledDeviceCount() > 0:
|
|
if cv2.cuda.getCudaEnabledDeviceCount() > 0:
|
|
@@ -12,6 +14,9 @@ else:
|
|
|
print("CUDA is not available")
|
|
print("CUDA is not available")
|
|
|
with_cuda = 0
|
|
with_cuda = 0
|
|
|
|
|
|
|
|
|
|
+load_dotenv()
|
|
|
|
|
+android_address = os.getenv("ANDROID_ADDRESS")
|
|
|
|
|
+
|
|
|
|
|
|
|
|
def get_current_screen():
|
|
def get_current_screen():
|
|
|
return current_screen
|
|
return current_screen
|
|
@@ -186,6 +191,6 @@ def non_max_suppression(boxes, overlapThresh):
|
|
|
|
|
|
|
|
|
|
|
|
|
client = AdbClient(host="127.0.0.1", port=5037)
|
|
client = AdbClient(host="127.0.0.1", port=5037)
|
|
|
-device = client.device("192.168.178.32:5555")
|
|
|
|
|
|
|
+device = client.device(android_address)
|
|
|
|
|
|
|
|
current_screen = capture_current_screen()
|
|
current_screen = capture_current_screen()
|