зеркало из
https://github.com/ssciwr/AMMICO.git
synced 2025-10-30 05:26:05 +02:00
fixed opencv version
Этот коммит содержится в:
родитель
75ed827958
Коммит
b9ef52107b
@ -38,14 +38,6 @@ def test_analyse_image():
|
|||||||
id_ = os.path.splitext(os.path.basename(img_path))[0]
|
id_ = os.path.splitext(os.path.basename(img_path))[0]
|
||||||
mydict[id_] = {"filename": img_path}
|
mydict[id_] = {"filename": img_path}
|
||||||
|
|
||||||
summary_device = device("cuda" if cuda.is_available() else "cpu")
|
|
||||||
summary_model, summary_vis_processors, _ = load_model_and_preprocess(
|
|
||||||
name="blip_caption",
|
|
||||||
model_type="base_coco",
|
|
||||||
is_eval=True,
|
|
||||||
device=summary_device,
|
|
||||||
)
|
|
||||||
|
|
||||||
for key in mydict:
|
for key in mydict:
|
||||||
mydict[key] = sm.SummaryDetector(mydict[key]).analyse_image()
|
mydict[key] = sm.SummaryDetector(mydict[key]).analyse_image()
|
||||||
keys = list(mydict.keys())
|
keys = list(mydict.keys())
|
||||||
@ -90,6 +82,17 @@ def test_analyse_image():
|
|||||||
"a person running on a beach near a rock formation"
|
"a person running on a beach near a rock formation"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
del sm.SummaryDetector.summary_model, sm.SummaryDetector.summary_vis_processors
|
||||||
|
cuda.empty_cache()
|
||||||
|
|
||||||
|
summary_device = device("cuda" if cuda.is_available() else "cpu")
|
||||||
|
summary_model, summary_vis_processors, _ = load_model_and_preprocess(
|
||||||
|
name="blip_caption",
|
||||||
|
model_type="base_coco",
|
||||||
|
is_eval=True,
|
||||||
|
device=summary_device,
|
||||||
|
)
|
||||||
|
|
||||||
for key in mydict:
|
for key in mydict:
|
||||||
mydict[key] = sm.SummaryDetector(mydict[key]).analyse_image(
|
mydict[key] = sm.SummaryDetector(mydict[key]).analyse_image(
|
||||||
summary_model, summary_vis_processors
|
summary_model, summary_vis_processors
|
||||||
@ -136,6 +139,9 @@ def test_analyse_image():
|
|||||||
"a person running on a beach near a rock formation"
|
"a person running on a beach near a rock formation"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
del summary_model, summary_vis_processors
|
||||||
|
cuda.empty_cache()
|
||||||
|
|
||||||
summary_model, summary_vis_processors, _ = load_model_and_preprocess(
|
summary_model, summary_vis_processors, _ = load_model_and_preprocess(
|
||||||
name="blip_caption",
|
name="blip_caption",
|
||||||
model_type="large_coco",
|
model_type="large_coco",
|
||||||
@ -210,14 +216,6 @@ def test_analyse_questions():
|
|||||||
id_ = os.path.splitext(os.path.basename(img_path))[0]
|
id_ = os.path.splitext(os.path.basename(img_path))[0]
|
||||||
mydict[id_] = {"filename": img_path}
|
mydict[id_] = {"filename": img_path}
|
||||||
|
|
||||||
summary_device = device("cuda" if cuda.is_available() else "cpu")
|
|
||||||
(
|
|
||||||
summary_VQA_model,
|
|
||||||
summary_VQA_vis_processors,
|
|
||||||
summary_VQA_txt_processors,
|
|
||||||
) = load_model_and_preprocess(
|
|
||||||
name="blip_vqa", model_type="vqav2", is_eval=True, device=summary_device
|
|
||||||
)
|
|
||||||
list_of_questions = [
|
list_of_questions = [
|
||||||
"How many persons on the picture?",
|
"How many persons on the picture?",
|
||||||
"What happends on the picture?",
|
"What happends on the picture?",
|
||||||
|
|||||||
@ -40,7 +40,7 @@ dependencies = [
|
|||||||
"pytest-cov",
|
"pytest-cov",
|
||||||
"matplotlib",
|
"matplotlib",
|
||||||
"pytest",
|
"pytest",
|
||||||
"opencv-contrib-python",
|
"opencv-contrib-python <= 4.6",
|
||||||
"googletrans==3.1.0a0",
|
"googletrans==3.1.0a0",
|
||||||
"spacy",
|
"spacy",
|
||||||
"jupyterlab",
|
"jupyterlab",
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user