6
0
Эх сурвалжийг харах

fixed some installation issues; updated makefile

Dimitri Korsch 1 жил өмнө
parent
commit
5f2eee380d

+ 2 - 0
.dockerignore

@@ -3,6 +3,7 @@ venv/
 webui/node_modules/
 frontend/node_modules/
 db.backups/
+db_backup*
 projects/
 htmlcov/
 labels/
@@ -15,4 +16,5 @@ notebooks/
 *.sqlite
 *.sqlite-journal
 *.sqlite3
+*.json
 *.sqlite3-journal

+ 2 - 0
Makefile

@@ -31,6 +31,8 @@ run_pylint:
 	pylint --rcfile=.pylintrc app.py pycs
 
 build_docker:
+	@docker pull python:3.9
+	@docker pull node:14
 	docker build . \
 		--tag pycs:latest \
 		--build-arg UID=${UID} \

+ 4 - 2
app.py

@@ -20,5 +20,7 @@ logging.config.dictConfig(settings.logging)
 setup_commands(app)
 
 if __name__ == '__main__':
-    server = WebServer(app, htpasswd, settings)
-    server.run()
+
+    with app.app_context():
+        server = WebServer(app, htpasswd, settings)
+        server.run()

+ 2 - 1
docker-compose.yml

@@ -21,7 +21,8 @@ services:
       - ./external_data:/data
 
     depends_on:
-      - migration
+      migration:
+        condition: service_completed_successfully
 
   migration:
     user: ${UID:-0}:${GID:-0}

Файлын зөрүү хэтэрхий том тул дарагдсан байна
+ 2 - 2
notebooks/show_results.ipynb


+ 3 - 3
pycs/database/Project.py

@@ -314,9 +314,9 @@ class Project(NamedBaseModel):
         file.fps = fps
 
         # Pre-load common thumbnail sizes if the given file is an image.
-        if file.type == 'image' and os.path.isfile(path):
-            for max_width, max_height in [(200, 200), (2000, 800)]:
-                tpool.execute(resize_file, file, self.root_folder, max_width, max_height)
+        # if file.type == 'image' and os.path.isfile(path):
+        #     for max_width, max_height in [(200, 200), (2000, 800)]:
+        #         tpool.execute(resize_file, file, self.root_folder, max_width, max_height)
 
         return file, is_new
 

+ 1 - 1
pycs/frontend/WebServer.py

@@ -88,7 +88,7 @@ class WebServer:
             @self.app.after_request
             def after_request(response):
                 # pylint: disable=unused-variable
-                response.headers['Access-Control-Allow-Origin'] = 'http://localhost:8080'
+                response.headers['Access-Control-Allow-Origin'] = 'http://localhost:8081'
                 response.headers['Access-Control-Allow-Credentials'] = 'true'
                 response.headers['Access-Control-Allow-Methods'] = 'POST, GET'
                 response.headers['Access-Control-Allow-Headers'] = 'Authorization'

+ 2 - 1
pycs/management/result.py

@@ -3,6 +3,7 @@ import flask
 import simplejson as json
 
 from flask.cli import AppGroup
+from tqdm import tqdm
 
 from pycs import app
 from pycs import database as db
@@ -44,7 +45,7 @@ def export(project_id, output, indent):
                     dict(**r.serialize(), label=r.label.serialize() if r.label is not None else None)
                         for r in f.results.all()
                 ])
-                for f in project.files.all() if f.results.count() != 0
+                for f in tqdm(project.files.all()) if f.results.count() != 0
             ]
 
         results.append(dict(

+ 17 - 16
requirements.txt

@@ -1,20 +1,21 @@
-numpy
-opencv-python-headless~=4.6
-opencv-contrib-python-headless~=4.6
-Pillow
-scipy
-eventlet
-flask
-flask-socketio
-flask-sqlalchemy
-sqlalchemy_serializer
-flask-migrate
-flask-htpasswd
-itsdangerous~=2.0.1
-python-socketio
+numpy==1.21.4
+opencv-python-headless~=4.6.0
+opencv-contrib-python-headless~=4.6.0
+Pillow==8.4.0
+eventlet==0.33.0
+Flask==2.0.2
+flask-htpasswd==0.4.0
+Flask-Migrate==3.1.0
+Flask-SocketIO==5.1.1
+Flask-SQLAlchemy==2.5.1
+SQLAlchemy==1.4.27
+SQLAlchemy-serializer==1.4.1
+itsdangerous==2.0.1
+python-socketio==5.5.0
 munch
-scikit-image
-pandas
+scipy==1.7.2
+scikit-image==0.18.3
+pandas==1.3.5
 tqdm
 
 chainer~=7.8

+ 5 - 1
settings.json

@@ -1,7 +1,11 @@
 {
   "host": "",
   "port": 5000,
-  "allowedOrigins": ["https://ammod.inf-cv.uni-jena.de", "https://deimos.inf-cv.uni-jena.de", "http://localhost:5000"],
+  "allowedOrigins": [
+    "https://ammod.inf-cv.uni-jena.de",
+    "https://deimos.inf-cv.uni-jena.de",
+    "http://localhost:5000"
+  ],
   "projects_folder": "projects",
   "database": "db/data.sqlite3",
   "pipeline_cache_time": 1,

+ 1 - 1
webui/src/main.js

@@ -10,7 +10,7 @@ import io from "socket.io-client";
 import vueDebounce from "vue-debounce";
 
 // establish socket connection
-const host = Vue.config.devtools ? window.location.hostname + ':5000' : window.location.host;
+const host = Vue.config.devtools ? window.location.hostname + ':5001' : window.location.host;
 const self = window.location.protocol + '//' + host;
 const sio = io(self);
 

Энэ ялгаанд хэт олон файл өөрчлөгдсөн тул зарим файлыг харуулаагүй болно