From ba41005b24ba7e94467de32e7e0a41a31f7d1d07 Mon Sep 17 00:00:00 2001 From: FEIJINTI <83849113+FEIJINTI@users.noreply.github.com> Date: Fri, 16 Sep 2022 09:33:04 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=8A=A0=E4=BA=86=E6=94=B9=E5=8F=98?= =?UTF-8?q?=E6=A8=A1=E5=9E=8B=E8=B7=AF=E5=BE=84=E5=92=8C=E8=AE=AD=E7=BB=83?= =?UTF-8?q?=E4=BB=A3=E7=A0=81=EF=BC=88=E6=9C=AA=E6=B5=8B=E8=AF=95=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- socket_detector.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/socket_detector.py b/socket_detector.py index b77b7ac..3fc2685 100644 --- a/socket_detector.py +++ b/socket_detector.py @@ -3,6 +3,7 @@ import numpy as np import cv2 from classifer import WoodClass import time +import os def main(): @@ -53,7 +54,12 @@ def main(): detector.fit_pictures(data_path=r"C:\Users\FEIJINTI\PycharmProjects\wood_color") socket_send.send(b'G') elif (size_buff[4] == 2): - pass + str_size = size_buff[0] << 8 | size_buff[1] + select_model = socket_receive.recv(str_size) + model_path = os.path.join("models", select_model) + detector = WoodClass(w=4096, h=1200, n=3000, debug_mode=False) + detector.load(path=model_path) + break