Skip to content

Commit

Permalink
L144 2024-07-12-17:35
Browse files Browse the repository at this point in the history
  • Loading branch information
ludgerh committed Jul 12, 2024
1 parent 454e343 commit 98c52c2
Show file tree
Hide file tree
Showing 8 changed files with 210 additions and 48 deletions.
23 changes: 9 additions & 14 deletions cam-ai-setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,7 @@ def sql_query(command):
if not myip:
print('We WILL NOT use internal IP,')
print()
print('What is the external domain to access the server? (leave empty if none)')
print('(example: mydomain.org)')
mydomain = input(": ")
if not mydomain:
print('We WILL NOT use external domain,')
print()
if uselocal or myip or mydomain:
if uselocal or myip:
selected = True
else:
print('You need to choose at least one item, try again.')
Expand Down Expand Up @@ -173,11 +167,9 @@ def sql_query(command):
subprocess.call(['sudo', 'apt', '-y', 'install', 'ffmpeg'])
subprocess.call(['sudo', 'apt', '-y', 'install', 'libgeos-dev'])
subprocess.call(['sudo', 'apt', '-y', 'install', 'redis'])
subprocess.call(['sudo', 'apt', '-y', 'install', 'sudo nano pkg-config'])
subprocess.call(['sudo', 'apt', '-y', 'install', 'pkg-config'])
if env_type == 'venv':
subprocess.call(['sudo', 'apt', '-y', 'install', 'python3-venv'])
else:
pass #Conda
print()

print('>>>>> Modifying system config...')
Expand Down Expand Up @@ -246,8 +238,6 @@ def sql_query(command):
line = 'security_key = "' + djangocode + '"\n'
if line.startswith('localaccess = '):
line = 'localaccess = ' + str(uselocal) + '\n'
if line.startswith('mydomain = '):
line = 'mydomain = "' + mydomain + '"\n'
if line.startswith('myip = '):
if myip:
line = 'myip = ["' + myip + '"]\n'
Expand Down Expand Up @@ -289,10 +279,15 @@ def sql_query(command):
print('*************************************************')
print()
print('You can now start the server by entering this:')
print('./runserver.sh')
print('./runserver.sh '+env_type)
print()
print('And then surf to your new server in the browser using:')
print('http://cam-ai-raspi:8000/index/C/')
if uselocal:
print('http://localhost:8000/')
if myip:
if uselocal:
print('or')
print('http://' + myip + ':8000/')
print()
print('Have a nice day...')

Expand Down
1 change: 1 addition & 0 deletions eventers/c_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@ def __init__(self, tf_worker, tf_w_index, frame, margin, eventer_dbl, logger):
self.savename = ''
self.schoolnr = eventer_dbl.eve_school.id
self.dbline = event()
self.dbline.camera = eventer_dbl
self.dbline.start=timezone.make_aware(datetime.fromtimestamp(time()))
while True:
try:
Expand Down
23 changes: 0 additions & 23 deletions requirements.debian12
Original file line number Diff line number Diff line change
Expand Up @@ -59,29 +59,6 @@ multitimer==0.3
mysqlclient==2.2.0
namex==0.0.7
numpy==1.24.3
nvidia-cublas-cu11==11.11.3.6
nvidia-cublas-cu12==12.2.5.6
nvidia-cuda-cupti-cu11==11.8.87
nvidia-cuda-cupti-cu12==12.2.142
nvidia-cuda-nvcc-cu11==11.8.89
nvidia-cuda-nvcc-cu12==12.2.140
nvidia-cuda-nvrtc-cu11==11.8.89
nvidia-cuda-nvrtc-cu12==12.2.140
nvidia-cuda-runtime-cu11==11.8.89
nvidia-cuda-runtime-cu12==12.2.140
nvidia-cudnn-cu11==8.9.4.25
nvidia-cudnn-cu12==8.9.4.25
nvidia-cufft-cu11==10.9.0.58
nvidia-cufft-cu12==11.0.8.103
nvidia-curand-cu11==10.3.0.86
nvidia-curand-cu12==10.3.3.141
nvidia-cusolver-cu11==11.4.1.48
nvidia-cusolver-cu12==11.5.2.141
nvidia-cusparse-cu11==11.7.5.86
nvidia-cusparse-cu12==12.1.2.141
nvidia-nccl-cu11==2.16.5
nvidia-nccl-cu12==2.16.5
nvidia-nvjitlink-cu12==12.2.140
oauthlib==3.2.2
opencv-contrib-python==4.8.0.76
opt-einsum==3.3.0
Expand Down
32 changes: 27 additions & 5 deletions requirements.debian12~
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
absl-py==1.4.0
aiofiles==23.2.1
aiohttp==3.9.3
aioshutil==1.3
aiosignal==1.3.1
array-record==0.4.1
asgiref==3.7.2
astunparse==1.6.3
Expand Down Expand Up @@ -26,6 +30,7 @@ django-tables2==2.6.0
dm-tree==0.1.8
etils==1.4.1
flatbuffers==23.5.26
frozenlist==1.4.1
gast==0.4.0
google-auth==2.22.0
google-auth-oauthlib==1.0.0
Expand All @@ -39,7 +44,7 @@ importlib-metadata==6.8.0
importlib-resources==6.0.1
incremental==22.10.0
isodate==0.6.1
keras==2.14.0
keras==2.15.0
keras-core==0.1.7
keras-cv==0.6.4
libclang==16.0.6
Expand All @@ -49,20 +54,34 @@ markdown-it-py==3.0.0
MarkupSafe==2.1.3
mdurl==0.1.2
ml-dtypes==0.2.0
multidict==6.0.5
multitimer==0.3
mysqlclient==2.2.0
namex==0.0.7
numpy==1.24.3
nvidia-cublas-cu11==11.11.3.6
nvidia-cublas-cu12==12.2.5.6
nvidia-cuda-cupti-cu11==11.8.87
nvidia-cuda-cupti-cu12==12.2.142
nvidia-cuda-nvcc-cu11==11.8.89
nvidia-cuda-nvcc-cu12==12.2.140
nvidia-cuda-nvrtc-cu11==11.8.89
nvidia-cuda-nvrtc-cu12==12.2.140
nvidia-cuda-runtime-cu11==11.8.89
nvidia-cudnn-cu11==8.7.0.84
nvidia-cuda-runtime-cu12==12.2.140
nvidia-cudnn-cu11==8.9.4.25
nvidia-cudnn-cu12==8.9.4.25
nvidia-cufft-cu11==10.9.0.58
nvidia-cufft-cu12==11.0.8.103
nvidia-curand-cu11==10.3.0.86
nvidia-curand-cu12==10.3.3.141
nvidia-cusolver-cu11==11.4.1.48
nvidia-cusolver-cu12==11.5.2.141
nvidia-cusparse-cu11==11.7.5.86
nvidia-cusparse-cu12==12.1.2.141
nvidia-nccl-cu11==2.16.5
nvidia-nccl-cu12==2.16.5
nvidia-nvjitlink-cu12==12.2.140
oauthlib==3.2.2
opencv-contrib-python==4.8.0.76
opt-einsum==3.3.0
Expand All @@ -77,7 +96,9 @@ pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
Pygments==2.16.1
pyopencl==2024.1
pyOpenSSL==23.2.0
pytools==2023.1.1
pytz==2023.3.post1
redis==5.0.0
regex==2023.8.8
Expand All @@ -92,11 +113,11 @@ setproctitle==1.3.2
shapely==2.0.1
six==1.16.0
sqlparse==0.4.4
tensorboard==2.14.1
tensorboard==2.15.1
tensorboard-data-server==0.7.1
tensorflow==2.14.0
tensorflow==2.15.0.post1
tensorflow-datasets==4.9.2
tensorflow-estimator==2.14.0
tensorflow-estimator==2.15.0
tensorflow-io-gcs-filesystem==0.33.0
tensorflow-metadata==1.14.0
tensorrt==8.5.3.1
Expand All @@ -112,6 +133,7 @@ validators==0.22.0
websocket-client==1.6.2
Werkzeug==2.3.7
wrapt==1.14.1
yarl==1.9.4
zeep==4.2.1
zipp==3.16.2
zope.interface==6.0
23 changes: 23 additions & 0 deletions requirements.nvidia
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
nvidia-cublas-cu11==11.11.3.6
nvidia-cublas-cu12==12.2.5.6
nvidia-cuda-cupti-cu11==11.8.87
nvidia-cuda-cupti-cu12==12.2.142
nvidia-cuda-nvcc-cu11==11.8.89
nvidia-cuda-nvcc-cu12==12.2.140
nvidia-cuda-nvrtc-cu11==11.8.89
nvidia-cuda-nvrtc-cu12==12.2.140
nvidia-cuda-runtime-cu11==11.8.89
nvidia-cuda-runtime-cu12==12.2.140
nvidia-cudnn-cu11==8.9.4.25
nvidia-cudnn-cu12==8.9.4.25
nvidia-cufft-cu11==10.9.0.58
nvidia-cufft-cu12==11.0.8.103
nvidia-curand-cu11==10.3.0.86
nvidia-curand-cu12==10.3.3.141
nvidia-cusolver-cu11==11.4.1.48
nvidia-cusolver-cu12==11.5.2.141
nvidia-cusparse-cu11==11.7.5.86
nvidia-cusparse-cu12==12.1.2.141
nvidia-nccl-cu11==2.16.5
nvidia-nccl-cu12==2.16.5
nvidia-nvjitlink-cu12==12.2.140
139 changes: 139 additions & 0 deletions requirements.nvidia~
Original file line number Diff line number Diff line change
@@ -0,0 +1,139 @@
absl-py==1.4.0
aiofiles==23.2.1
aiohttp==3.9.3
aioshutil==1.3
aiosignal==1.3.1
array-record==0.4.1
asgiref==3.7.2
astunparse==1.6.3
async-timeout==4.0.3
attrs==23.1.0
autobahn==23.6.2
Automat==22.10.0
cachetools==5.3.1
certifi==2023.7.22
cffi==1.15.1
channels==4.0.0
charset-normalizer==3.2.0
click==8.1.7
confusable-homoglyphs==3.2.0
constantly==15.1.0
crispy-bootstrap4==2022.1
cryptography==41.0.3
daphne==4.0.0
Django==4.2.5
django-crispy-forms==2.0
django-filter==23.2
django-htmx==1.16.0
django-registration==3.4
django-tables2==2.6.0
dm-tree==0.1.8
etils==1.4.1
flatbuffers==23.5.26
frozenlist==1.4.1
gast==0.4.0
google-auth==2.22.0
google-auth-oauthlib==1.0.0
google-pasta==0.2.0
googleapis-common-protos==1.60.0
grpcio==1.57.0
h5py==3.9.0
hyperlink==21.0.0
idna==3.4
importlib-metadata==6.8.0
importlib-resources==6.0.1
incremental==22.10.0
isodate==0.6.1
keras==2.15.0
keras-core==0.1.7
keras-cv==0.6.4
libclang==16.0.6
lxml==4.9.3
Markdown==3.4.4
markdown-it-py==3.0.0
MarkupSafe==2.1.3
mdurl==0.1.2
ml-dtypes==0.2.0
multidict==6.0.5
multitimer==0.3
mysqlclient==2.2.0
namex==0.0.7
numpy==1.24.3
nvidia-cublas-cu11==11.11.3.6
nvidia-cublas-cu12==12.2.5.6
nvidia-cuda-cupti-cu11==11.8.87
nvidia-cuda-cupti-cu12==12.2.142
nvidia-cuda-nvcc-cu11==11.8.89
nvidia-cuda-nvcc-cu12==12.2.140
nvidia-cuda-nvrtc-cu11==11.8.89
nvidia-cuda-nvrtc-cu12==12.2.140
nvidia-cuda-runtime-cu11==11.8.89
nvidia-cuda-runtime-cu12==12.2.140
nvidia-cudnn-cu11==8.9.4.25
nvidia-cudnn-cu12==8.9.4.25
nvidia-cufft-cu11==10.9.0.58
nvidia-cufft-cu12==11.0.8.103
nvidia-curand-cu11==10.3.0.86
nvidia-curand-cu12==10.3.3.141
nvidia-cusolver-cu11==11.4.1.48
nvidia-cusolver-cu12==11.5.2.141
nvidia-cusparse-cu11==11.7.5.86
nvidia-cusparse-cu12==12.1.2.141
nvidia-nccl-cu11==2.16.5
nvidia-nccl-cu12==2.16.5
nvidia-nvjitlink-cu12==12.2.140
oauthlib==3.2.2
opencv-contrib-python==4.8.0.76
opt-einsum==3.3.0
packaging==23.1
passlib==1.7.4
Pillow==10.0.0
platformdirs==3.10.0
promise==2.3
protobuf==3.20.3
psutil==5.9.5
pyasn1==0.5.0
pyasn1-modules==0.3.0
pycparser==2.21
Pygments==2.16.1
pyopencl==2024.1
pyOpenSSL==23.2.0
pytools==2023.1.1
pytz==2023.3.post1
redis==5.0.0
regex==2023.8.8
requests==2.31.0
requests-file==1.5.1
requests-oauthlib==1.3.1
requests-toolbelt==1.0.0
rich==13.5.2
rsa==4.9
service-identity==23.1.0
setproctitle==1.3.2
shapely==2.0.1
six==1.16.0
sqlparse==0.4.4
tensorboard==2.15.1
tensorboard-data-server==0.7.1
tensorflow==2.15.0.post1
tensorflow-datasets==4.9.2
tensorflow-estimator==2.15.0
tensorflow-io-gcs-filesystem==0.33.0
tensorflow-metadata==1.14.0
tensorrt==8.5.3.1
termcolor==2.3.0
toml==0.10.2
tqdm==4.66.1
Twisted==23.8.0
txaio==23.1.1
typing_extensions==4.5.0
ua-parser==0.18.0
urllib3==1.26.16
validators==0.22.0
websocket-client==1.6.2
Werkzeug==2.3.7
wrapt==1.14.1
yarl==1.9.4
zeep==4.2.1
zipp==3.16.2
zope.interface==6.0
8 changes: 7 additions & 1 deletion runserver.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
#!/bin/bash
cd cam-ai
source env/bin/activate
if [ "$1" = "venv" ] ; then
source env/bin/activate
fi
if [ "$1" = "conda" ] ; then
source ~/miniconda3/etc/profile.d/conda.sh
conda activate tf
fi
python cam-ai-server.py manage.py runserver 0.0.0.0:8000 --noreload
9 changes: 4 additions & 5 deletions tools/c_redis.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,10 +194,7 @@ def set_watch_status(self, value): #0 : finish, 1 : wait, 2 : restart
self.set('watch_status', value)

def set_shutdown_command(self, value): #0 : nothing, 1 : stop CAM-AI, 2 : restart CAM-AI
self.set('shutdown_command', value)

def set_watch_status(self, value):
self.set('watch_status', value)
self.set('shutdown_command', value)

def get_start_worker_busy(self):
return(int(self.get('start_worker_busy')))
Expand All @@ -209,7 +206,9 @@ def get_start_trainer_busy(self):
return(int(self.get('start_trainer_busy')))

def get_watch_status(self): #0 : finish, 1 : wait, 2 : restart
return(int(self.get('watch_status')))
while (result := self.get('watch_status')) is None:
sleep(1.0)
return(int(result))

def get_shutdown_command(self): #0 : nothing, 1 : stop CAM-AI, 2 : restart CAM-AI
if (result := self.get('shutdown_command')) is None:
Expand Down

0 comments on commit 98c52c2

Please sign in to comment.