mirror of
https://github.com/NanjingForestryUniversity/supermachine--tomato-passion_fruit.git
synced 2025-11-09 06:44:02 +00:00
refactor:调整部分结构,删去不用的库
This commit is contained in:
parent
68fd790823
commit
f10aee7753
@ -6,7 +6,6 @@
|
|||||||
|
|
||||||
import os
|
import os
|
||||||
import cv2
|
import cv2
|
||||||
import json
|
|
||||||
import utils
|
import utils
|
||||||
import joblib
|
import joblib
|
||||||
import logging
|
import logging
|
||||||
@ -21,7 +20,6 @@ from sklearn.ensemble import RandomForestRegressor
|
|||||||
# import torch.nn as nn
|
# import torch.nn as nn
|
||||||
# from torchvision import transforms
|
# from torchvision import transforms
|
||||||
|
|
||||||
|
|
||||||
#番茄RGB处理模型
|
#番茄RGB处理模型
|
||||||
class Tomato:
|
class Tomato:
|
||||||
def __init__(self, find_reflection_threshold=setting.find_reflection_threshold, extract_g_r_factor=setting.extract_g_r_factor):
|
def __init__(self, find_reflection_threshold=setting.find_reflection_threshold, extract_g_r_factor=setting.extract_g_r_factor):
|
||||||
@ -709,8 +707,6 @@ class Data_processing:
|
|||||||
defect_num=max_defect_num, total_defect_area=max_total_defect_area, rp=rp_result)
|
defect_num=max_defect_num, total_defect_area=max_total_defect_area, rp=rp_result)
|
||||||
return response
|
return response
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
# #下面封装的是ResNet18和ResNet34的网络模型构建
|
# #下面封装的是ResNet18和ResNet34的网络模型构建
|
||||||
# #原定用于构建RGB图像有果无果判断,后续发现存在纰漏,暂时搁置并未实际使用
|
# #原定用于构建RGB图像有果无果判断,后续发现存在纰漏,暂时搁置并未实际使用
|
||||||
# class BasicBlock(nn.Module):
|
# class BasicBlock(nn.Module):
|
||||||
|
|||||||
@ -6,17 +6,14 @@
|
|||||||
|
|
||||||
import sys
|
import sys
|
||||||
import os
|
import os
|
||||||
import cv2
|
|
||||||
from root_dir import ROOT_DIR
|
from root_dir import ROOT_DIR
|
||||||
from classifer import Spec_predict, Data_processing
|
from classifer import Spec_predict, Data_processing
|
||||||
# from classifer import ImageClassifier
|
# from classifer import ImageClassifier
|
||||||
import logging
|
import logging
|
||||||
from utils import Pipe
|
from utils import Pipe
|
||||||
import numpy as np
|
import numpy as np
|
||||||
import time
|
|
||||||
from config import Config
|
from config import Config
|
||||||
|
|
||||||
|
|
||||||
def main(is_debug=False):
|
def main(is_debug=False):
|
||||||
setting = Config()
|
setting = Config()
|
||||||
file_handler = logging.FileHandler(os.path.join(ROOT_DIR, 'tomato.log'), encoding='utf-8')
|
file_handler = logging.FileHandler(os.path.join(ROOT_DIR, 'tomato.log'), encoding='utf-8')
|
||||||
@ -120,7 +117,6 @@ def main(is_debug=False):
|
|||||||
# print(f'第{q}组全流程时间:{(end_time - start_time) * 1000}毫秒')
|
# print(f'第{q}组全流程时间:{(end_time - start_time) * 1000}毫秒')
|
||||||
# q += 1
|
# q += 1
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
'''
|
'''
|
||||||
python与qt采用windows下的命名管道进行通信,数据流按照约定的通信协议进行
|
python与qt采用windows下的命名管道进行通信,数据流按照约定的通信协议进行
|
||||||
|
|||||||
@ -13,7 +13,6 @@ from PIL import Image
|
|||||||
import numpy as np
|
import numpy as np
|
||||||
import cv2
|
import cv2
|
||||||
|
|
||||||
|
|
||||||
class MainWindow(QMainWindow):
|
class MainWindow(QMainWindow):
|
||||||
def __init__(self):
|
def __init__(self):
|
||||||
super().__init__()
|
super().__init__()
|
||||||
|
|||||||
@ -4,8 +4,6 @@
|
|||||||
# @File : utils.py
|
# @File : utils.py
|
||||||
# @Software: PyCharm
|
# @Software: PyCharm
|
||||||
|
|
||||||
|
|
||||||
import shutil
|
|
||||||
import os
|
import os
|
||||||
import win32file
|
import win32file
|
||||||
import win32pipe
|
import win32pipe
|
||||||
@ -13,8 +11,6 @@ import time
|
|||||||
import logging
|
import logging
|
||||||
import numpy as np
|
import numpy as np
|
||||||
from config import Config as setting
|
from config import Config as setting
|
||||||
from PIL import Image
|
|
||||||
import io
|
|
||||||
|
|
||||||
class Pipe:
|
class Pipe:
|
||||||
def __init__(self, rgb_receive_name, rgb_send_name, spec_receive_name):
|
def __init__(self, rgb_receive_name, rgb_send_name, spec_receive_name):
|
||||||
@ -244,7 +240,6 @@ class Pipe:
|
|||||||
# print(f'发送时间:{end_time - start_time}秒')
|
# print(f'发送时间:{end_time - start_time}秒')
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
def create_file(file_name):
|
def create_file(file_name):
|
||||||
"""
|
"""
|
||||||
创建文件
|
创建文件
|
||||||
@ -260,7 +255,6 @@ def create_file(file_name):
|
|||||||
open(file_name, 'a').close()
|
open(file_name, 'a').close()
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
class Logger(object):
|
class Logger(object):
|
||||||
def __init__(self, is_to_file=False, path=None):
|
def __init__(self, is_to_file=False, path=None):
|
||||||
self.is_to_file = is_to_file
|
self.is_to_file = is_to_file
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user