* changed `3_non-deterministic summary` to `3_non-deterministic_summary`

* changed cvlib to working fork

* disabled test_display
Этот коммит содержится в:
Petr Andriushchenko 2023-10-18 23:28:38 +02:00 коммит произвёл GitHub
родитель 15789379b1
Коммит 8118aa4830
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
6 изменённых файлов: 20 добавлений и 19 удалений

20
.github/workflows/ci.yml поставляемый
Просмотреть файл

@ -36,10 +36,10 @@ jobs:
run: |
cd ammico
python -m pytest test/test_cropposts.py -svv --cov=. --cov-report=xml --cov-append
- name: Run pytest test_display
run: |
cd ammico
python -m pytest test/test_display.py -svv --cov=. --cov-report=xml --cov-append
# - name: Run pytest test_display
# run: |
# cd ammico
# python -m pytest test/test_display.py -svv --cov=. --cov-report=xml --cov-append
- name: Run pytest test_faces
run: |
cd ammico
@ -48,15 +48,19 @@ jobs:
run: |
cd ammico
python -m pytest test/test_multimodal_search.py -m "not long" -svv --cov=. --cov-report=xml --cov-append
- name: Run pytest test_objects
# - name: Run pytest test_objects
# run: |
# cd ammico
# python -m pytest test/test_objects.py -svv --cov=. --cov-report=xml --cov-append
- name: Clear cache ubuntu
if: matrix.os == 'ubuntu-22.04'
run: |
cd ammico
python -m pytest test/test_objects.py -svv --cov=. --cov-report=xml --cov-append
rm -rf ~/.cache/*
- name: Run pytest test_summary
run: |
cd ammico
python -m pytest test/test_summary.py -m "not long" -svv --cov=. --cov-report=xml --cov-append
- name: Clear cache
- name: Clear cache2
if: matrix.os == 'ubuntu-22.04'
run: |
rm -rf ~/.cache/*

Просмотреть файл

@ -88,7 +88,7 @@
"\n",
"The results are written in the columns: \n",
"- `const_image_summary` - the permanent summaries, which do not change from run to run (analyse_image).\n",
"- `3_non-deterministic summary` displays three different summaries generated with different seeds that change from run to run (analyse_image). \n",
"- `3_non-deterministic_summary` displays three different summaries generated with different seeds that change from run to run (analyse_image). \n",
"\n",
"You can also specify what kind of analysis you want to perform with `analysis_type`. `\"summary\"` will generate a summary for all pictures in your dictionary `mydict`, `\"questions\"` will prepare answers to your questions for all pictures, and `\"summary_and_questions\"` will do both. \n",
"If you load the models (`summary_model`, `summary_vis_processors` for `\"summary\"` and `summary_vqa_model`, `summary_vqa_vis_processors`, `summary_vqa_txt_processors` for `\"questions\"`) into memory beforehand and pass them to the function, it can speed up the analysis many times. \n",

Просмотреть файл

@ -344,7 +344,7 @@ class SummaryDetector(AnalysisMethod):
with no_grad():
self.subdict["const_image_summary"] = model.generate({"image": image})[0]
if nondeterministic_summaries:
self.subdict["3_non-deterministic summary"] = model.generate(
self.subdict["3_non-deterministic_summary"] = model.generate(
{"image": image}, use_nucleus_sampling=True, num_captions=3
)
return self.subdict

Просмотреть файл

@ -71,7 +71,7 @@ def test_analyse_image(get_dict):
).analyse_image()
assert len(get_dict) == 2
for key in get_dict.keys():
assert len(get_dict[key]["3_non-deterministic summary"]) == 3
assert len(get_dict[key]["3_non-deterministic_summary"]) == 3
assert (
get_dict[key]["const_image_summary"] == reference_results[test_run][key]
)

Просмотреть файл

@ -98,7 +98,7 @@
"source": [
"Here you can choose between two models: \"base\" or \"large\". This will generate the caption for each image and directly put the results in a dataframe. This dataframe can be exported as a csv file.\n",
"\n",
"The results are written into the columns `const_image_summary` - this will always be the same result (as always the same seed will be used). The column `3_non-deterministic summary` displays three different answers generated with different seeds, these are most likely different when you run the analysis again."
"The results are written into the columns `const_image_summary` - this will always be the same result (as always the same seed will be used). The column `3_non-deterministic_summary` displays three different answers generated with different seeds, these are most likely different when you run the analysis again."
]
},
{
@ -197,7 +197,7 @@
"\n",
"`const_image_summary` - the permanent summarys, which does not change from run to run (analyse_image).\n",
"\n",
"`3_non-deterministic summary` - 3 different summarys examples that change from run to run (analyse_image). "
"`3_non-deterministic_summary` - 3 different summarys examples that change from run to run (analyse_image). "
]
},
{

Просмотреть файл

@ -23,9 +23,8 @@ classifiers = [
dependencies = [
"bertopic<=0.14.1",
"cvlib",
"cvlib @ git+https://github.com/iulusoy/cvlib.git@iulusoy-patch-1",
"dash>=2.11.0",
"dash_renderjson",
"deepface<=0.0.75",
"googletrans==3.1.0a0",
"google-cloud-vision",
@ -48,13 +47,11 @@ dependencies = [
"setuptools",
"spacy",
"tensorflow<=2.12.3",
"torch",
"torch<2.1.0",
"transformers",
"google-cloud-vision",
"setuptools",
"opencv-contrib-python",
"dash",
"dash_renderjson",
"opencv-contrib-python==4.8.0.76",
"dash_bootstrap_components",
"colorgram.py",
"webcolors",