hopefully non-breaking changes to remove tensorflow requirement in systems that don't use it

This commit is contained in:
Neo 2025-06-19 11:27:58 +02:00
parent ababfe25f1
commit 935ed5174b
5 changed files with 40 additions and 12 deletions

View File

@ -2,16 +2,22 @@
:: RUN FROM POWERSHELL W/ADMIN RIGHTS:
:: Set-ExecutionPolicy Unrestricted -Scope CurrentUser
pip install -r src/requirements.txt
pip -m venv .venv
pip install -r src/requirements_win.txt
mkdir tmp
cd tmp
:: Advantech XNAVI
Invoke-WebRequest -uri "https://downloadt.advantech.com/download/downloadsr.aspx?File_Id=1-2BZC0F1" -usebasicparsing -outfile xnavi.zip
Expand-Archive .\xnavi.zip
cd xnavi
./xnavi.exe
:: BROKEN curl -o xnavi.zip "https://downloadt.advantech.com/download/downloadsr.aspx?File_Id=1-2BZC0F1"
:: Expand-Archive .\xnavi.zip
:: cd xnavi
:: ./xnavi.exe
:: GXIPY
Invoke-WebRequest -uri "https://dahengimaging.com/downloads/Galaxy_Windows_EN_32bits%2064bits_1.18.2208.9301.zip" -usebasicparsing -OutFile Galaxy_Windows_EN_32bits_64bits_1.18.2208.9301.zip
:: BROKEN curl -o gxipy.zip "https://dahengimaging.com/downloads/Galaxy_Windows_EN_32bits%2064bits_1.18.2208.9301.zip"
:: GXIPY
curl -o vc_redist.x64.exe "https://aka.ms/vs/17/release/vc_redist.x64.exe"
./vc_redist.x64.exe

View File

@ -20,7 +20,7 @@ from .consumer import Consumer
if "--no-gpu" in sys.argv:
os.environ["CUDA_VISIBLE_DEVICES"] = "-1"
import tensorflow as tf
#import tensorflow as tf
from lib.helpers.object_detection.utils import label_map_util
if "--edgetpu" in sys.argv:
@ -35,7 +35,7 @@ else:
def make_interpreter(*args, **kwargs):
raise ValueError("\"--no-edgetpu\" in sys.argv")
if "--no-tflite" not in sys.argv:
if "--tflite" in sys.argv:
try:
Interpreter = tf.lite.Interpreter
# from tflite_runtime.interpreter import Interpreter

View File

@ -24,7 +24,7 @@ import logging
import numpy as np
from six import string_types
from six.moves import range
import tensorflow.compat.v1 as tf
#import tensorflow.compat.v1 as tf
from google.protobuf import text_format
from lib.helpers.object_detection.protos import string_int_label_map_pb2
@ -168,7 +168,7 @@ def load_labelmap(path):
Returns:
a StringIntLabelMapProto
"""
with tf.io.gfile.GFile(path, 'r') as fid:
with open(path, 'r') as fid:
label_map_string = fid.read()
label_map = string_int_label_map_pb2.StringIntLabelMap()
try:

View File

@ -21,4 +21,3 @@ requests
#tflite-runtime
zebra
pylibdmtx~=0.1.10
pandas~=1.3.3

23
src/requirements_win.txt Normal file
View File

@ -0,0 +1,23 @@
--extra-index-url https://google-coral.github.io/py-repo/
argon2-cffi
bottle
google-cloud-storage
imutils
lxml
nfcpy
numpy
opencv-python-headless
peewee
pillow
pycoral
pymodbus~=3.6.8
pyqt5
#pyqt5-tools
pyserial
pyserial-asyncio
qrcode
requests
tensorflow-cpu
#tflite-runtime
zebra
pylibdmtx~=0.1.10