From b3be2f47a3e13a772ea8251f6a825af76869788b Mon Sep 17 00:00:00 2001 From: ST-TEN-1 Date: Mon, 18 Jul 2022 14:45:24 +0200 Subject: [PATCH] dev --- init.sh | 36 ++++++++++++++++---------------- src/components/galaxy_camera.py | 2 +- src/components/gxipy/__init__.py | 4 ++-- src/components/gxipy/gxiapi.py | 6 +++--- src/components/vision.py | 5 +++++ 5 files changed, 29 insertions(+), 24 deletions(-) diff --git a/init.sh b/init.sh index 1e2c7f6..1378d63 100755 --- a/init.sh +++ b/init.sh @@ -41,23 +41,23 @@ source "./venv/bin/activate" || source "./venv/Scripts/activate" || : # DOCKER_IMAGE="ubuntu:18.04" DOCKER_TARGETS=libedgetpu make docker-build # sudo make install # cd "$here" -echo "---------- install gxlpy ----------" -sudo apt-get install -y g++ libc-bin -mkdir -p "$here/tmp" -cd "$here/tmp" -wget --continue --timestamping "http://downloads.get-cameras.com/Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122.tar.gz" -7z x -y "Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122.tar.gz" -7z x -y "Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122.tar" -cd "Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122" -chmod +x "Galaxy_camera.run" -echo -en "\nY\nY\nEn\nY\n" | ./Galaxy_camera.run -cd "$here/tmp" -wget --continue --timestamping "http://downloads.get-cameras.com/Galaxy_Linux_Python_1.0.1905.9081.tar.gz" -7z x -y "Galaxy_Linux_Python_1.0.1905.9081.tar.gz" -7z x -y "Galaxy_Linux_Python_1.0.1905.9081.tar" -cd "Galaxy_Linux_Python_1.0.1905.9081/api" -python3 setup.py build -python3 setup.py install -cd "$here" +#echo "---------- install gxlpy ----------" +#sudo apt-get install -y g++ libc-bin +#mkdir -p "$here/tmp" +#cd "$here/tmp" +#wget --continue --timestamping "http://downloads.get-cameras.com/Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122.tar.gz" +#7z x -y "Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122.tar.gz" +#7z x -y "Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122.tar" +#cd "Galaxy_Linux-x86_Gige-U3_32bits-64bits_1.2.1911.9122" +#chmod +x "Galaxy_camera.run" +#echo -en "\nY\nY\nEn\nY\n" | ./Galaxy_camera.run +#cd "$here/tmp" +#wget --continue --timestamping "http://downloads.get-cameras.com/Galaxy_Linux_Python_1.0.1905.9081.tar.gz" +#7z x -y "Galaxy_Linux_Python_1.0.1905.9081.tar.gz" +#7z x -y "Galaxy_Linux_Python_1.0.1905.9081.tar" +#cd "Galaxy_Linux_Python_1.0.1905.9081/api" +#python3 setup.py build +#python3 setup.py install +#cd "$here" cd "$here" diff --git a/src/components/galaxy_camera.py b/src/components/galaxy_camera.py index e0851a6..90c1c6b 100644 --- a/src/components/galaxy_camera.py +++ b/src/components/galaxy_camera.py @@ -3,7 +3,7 @@ import sys from itertools import cycle import cv2 -import gxipy as gx +from . import gxipy as gx import imutils import numpy as np from PyQt5.QtCore import QMutex, Qt, QThread, pyqtSignal diff --git a/src/components/gxipy/__init__.py b/src/components/gxipy/__init__.py index 96d090f..debe30e 100644 --- a/src/components/gxipy/__init__.py +++ b/src/components/gxipy/__init__.py @@ -2,8 +2,8 @@ # -*- coding:utf-8 -*- # -*-mode:python ; tab-width:4 -*- ex:set tabstop=4 shiftwidth=4 expandtab: -*- -from gxiapi import * -from gxidef import * +from .gxiapi import * +from .gxidef import * __all__ = ["gxwrapper", "dxwrapper", "gxiapi", "gxidef"] diff --git a/src/components/gxipy/gxiapi.py b/src/components/gxipy/gxiapi.py index 837df3d..0a43502 100644 --- a/src/components/gxipy/gxiapi.py +++ b/src/components/gxipy/gxiapi.py @@ -3,9 +3,9 @@ # -*-mode:python ; tab-width:4 -*- ex:set tabstop=4 shiftwidth=4 expandtab: -*- import numpy -from gxwrapper import * -from dxwrapper import * -from gxidef import * +from .gxwrapper import * +from .dxwrapper import * +from .gxidef import * import types ERROR_SIZE = 1024 diff --git a/src/components/vision.py b/src/components/vision.py index 31b98b4..00c1336 100644 --- a/src/components/vision.py +++ b/src/components/vision.py @@ -3,6 +3,7 @@ import sys import traceback from configparser import ConfigParser from pathlib import Path +import logging import cv2 import numpy as np @@ -20,6 +21,8 @@ if "--no-edgetpu" not in sys.argv: try: from pycoral.utils.edgetpu import make_interpreter except (ImportError, ModuleNotFoundError): + logging.exception(traceback.format_exc()) + def make_interpreter(*args, **kwargs): raise ValueError("the 'pycoral' module is not available") else: @@ -30,6 +33,8 @@ if "--no-tflite" not in sys.argv: try: from tflite_runtime.interpreter import Interpreter except (ImportError, ModuleNotFoundError): + logging.exception(traceback.format_exc()) + def Interpreter(*args, **kwargs): raise ValueError("the 'tflite-runtime' module is not available") else: