WIP on main: 782d99a Merge branch 'main' of https://code.sdsdev.co.kr/SDSRV-IDP/sbt-idp into main

This commit is contained in:
TannedCung 2024-06-11 14:22:17 +07:00
parent e4b3d1079f
commit 9ff1174b89
6 changed files with 213 additions and 47 deletions

View File

@ -12,8 +12,8 @@ docker compose --profile local up -d
## Run tests
```bash
pip3 install pytest requests deepdiff
pip install pytest requests deepdiff
IDP_HOST=https://sbt.idp.sdsrv.ai IDP_USERNAME=sbt IDP_PASSWORD=7Eg4AbWIXDnufgn python3 -m pytest --log-cli-level=DEBUG --capture=sys tests
```
IDP_HOST=http://ec2-13-212-90-87.ap-southeast-1.compute.amazonaws.com:9881 IDP_USERNAME=sbt IDP_PASSWORD=abc python3 -m pytest --log-cli-level=DEBUG --capture=sys tests
IDP_HOST=http://ec2-54-169-227-39.ap-southeast-1.compute.amazonaws.com:9881 IDP_USERNAME=sbt IDP_PASSWORD=abc python3 -m pytest --log-cli-level=DEBUG --capture=sys tests

File diff suppressed because one or more lines are too long

View File

@ -136,12 +136,12 @@ def create_accuracy_report(report_id, **kwargs):
# rq_accuracy["feedback"] += rpf.feedback_accuracy[cl]
# for cl in rpf.reviewed_accuracy.keys():
# rq_accuracy["reviewed"] += rpf.reviewed_accuracy[cl]
request.is_required = False
if len(rq_accuracy["reviewed"]) > 0:
request.raw_accuracy = mean_list(rq_accuracy["reviewed"])
elif len(rq_accuracy["feedback"]) > 0:
request.raw_accuracy = mean_list(rq_accuracy["feedback"])
request.is_required = request.raw_accuracy < settings.BAD_THRESHOLD if isinstance(request.raw_accuracy, float) else False # No need to review by default
request.is_required = request.raw_accuracy < settings.NEED_REVIEW if isinstance(request.raw_accuracy, float) else False # No need to review by default
request.save()
number_images += request_att["total_images"]

View File

@ -846,7 +846,7 @@ def calculate_a_request(report, request):
fb_avg_acc = avg_dict(att["acc"]["feedback"])
rv_avg_acc = avg_dict(att["acc"]["reviewed"])
image.is_required = fb_avg_acc < settings.BAD_THRESHOLD
image.is_required = fb_avg_acc < settings.NEED_REVIEW
if image.processing_time < 0:
continue

View File

@ -24,7 +24,7 @@ jsonschema==4.17.1
MarkupSafe==2.1.1
packaging==21.3
Pillow==9.3.0
psycopg2==2.9.5
# psycopg2==2.9.5
psycopg2-binary==2.9.5
pycparser==2.21
pyparsing==3.0.9

View File

@ -20,7 +20,7 @@ services:
environment:
- PYTHONPATH=${PYTHONPATH}:/workspace/cope2n-ai-fi # For import module
- CELERY_BROKER=amqp://${RABBITMQ_DEFAULT_USER}:${RABBITMQ_DEFAULT_PASS}@rabbitmq-sbt:5672
- CUDA_VISIBLE_DEVICES=1
- CUDA_VISIBLE_DEVICES=0
volumes:
- ./cope2n-ai-fi:/workspace/cope2n-ai-fi # for dev container only
working_dir: /workspace/cope2n-ai-fi
@ -89,12 +89,12 @@ services:
depends_on:
db-sbt:
condition: service_started
# command: sh -c "chmod -R 777 /app; sleep 5; python manage.py collectstatic --no-input &&
# python manage.py makemigrations &&
# python manage.py migrate &&
# python manage.py compilemessages &&
# gunicorn fwd.asgi:application -k uvicorn.workers.UvicornWorker --timeout 300 -b 0.0.0.0:9000" # pre-makemigrations on prod
command: "sleep infinity"
command: sh -c "chmod -R 777 /app; sleep 5; python manage.py collectstatic --no-input &&
python manage.py makemigrations &&
python manage.py migrate &&
python manage.py compilemessages &&
gunicorn fwd.asgi:application -k uvicorn.workers.UvicornWorker --timeout 300 -b 0.0.0.0:9000" # pre-makemigrations on prod
# command: "sleep infinity"
minio:
image: minio/minio
@ -179,8 +179,8 @@ services:
- ./cope2n-api:/app
working_dir: /app
# command: sh -c "celery -A fwd_api.celery_worker.worker worker -l INFO -c 5"
command: bash -c "tail -f > /dev/null"
command: sh -c "celery -A fwd_api.celery_worker.worker worker -l INFO -c 5"
# command: bash -c "tail -f > /dev/null"
# Back-end persistent
db-sbt:
@ -220,7 +220,7 @@ services:
shm_size: 10gb
privileged: true
ports:
- 29881:80
- 9881:80
depends_on:
be-ctel-sbt:
condition: service_started