Merge pull request 'PK-163-kontrolovat-misto-pri-anonymizaci' (#2) from PK-163-kontrolovat-misto-pri-anonymizaci into main
Reviewed-on: #2
This commit was merged in pull request #2.
This commit is contained in:
@@ -10,11 +10,10 @@ from retinaface import RetinaFace
|
|||||||
|
|
||||||
treashold = float(os.getenv('FACE_TRASHOLD', '0.9'))
|
treashold = float(os.getenv('FACE_TRASHOLD', '0.9'))
|
||||||
sever = os.getenv('API_ROOT', 'localhost:8000')
|
sever = os.getenv('API_ROOT', 'localhost:8000')
|
||||||
disk_treashold = os.getenv('DISK_FREE_TRASHOLD', 'localhost:8000')
|
disk_treashold = os.getenv('DISK_FREE_TRASHOLD', 10)
|
||||||
|
|
||||||
root_api_url = 'http://{}/local'.format(sever)
|
root_api_url = 'http://{}/local'.format(sever)
|
||||||
base_path = '/app/data/'
|
base_path = '/app/data/'
|
||||||
total, used, free = shutil.disk_usage(base_path)
|
|
||||||
|
|
||||||
print("API_ROOT: " + str(root_api_url), flush=True)
|
print("API_ROOT: " + str(root_api_url), flush=True)
|
||||||
print("FACE_TRASHOLD: " + str(treashold), flush=True)
|
print("FACE_TRASHOLD: " + str(treashold), flush=True)
|
||||||
@@ -26,7 +25,8 @@ try:
|
|||||||
|
|
||||||
#Chesk if there is enought free space at destination path
|
#Chesk if there is enought free space at destination path
|
||||||
while True:
|
while True:
|
||||||
if (free // (2**30)) > 10:
|
total, used, free = shutil.disk_usage(base_path)
|
||||||
|
if (free // (2**30)) > ((total / 100) * disk_treashold) // (2**30):
|
||||||
break
|
break
|
||||||
|
|
||||||
data = {"trace": "not enought free space at destination" + str(base_path) + " trashold is: " + str(disk_treashold) + "%"}
|
data = {"trace": "not enought free space at destination" + str(base_path) + " trashold is: " + str(disk_treashold) + "%"}
|
||||||
|
|||||||
@@ -1,4 +1,5 @@
|
|||||||
opencv-python
|
opencv-python
|
||||||
|
requests
|
||||||
numpy
|
numpy
|
||||||
requests
|
requests
|
||||||
retina-face
|
retina-face
|
||||||
|
|||||||
Reference in New Issue
Block a user