зеркало из
https://github.com/ssciwr/AMMICO.git
synced 2025-10-30 05:26:05 +02:00
fixed test
Этот коммит содержится в:
родитель
a6ea571478
Коммит
31b006311a
@ -19,21 +19,11 @@ TEST_IMAGE_12 = "./test/data/pic1.png"
|
|||||||
|
|
||||||
|
|
||||||
def test_read_img():
|
def test_read_img():
|
||||||
test_img = ms.read_img(TEST_IMAGE_2)
|
my_dict = {}
|
||||||
assert numpy.array(test_img)[257][34] == [70, 66, 63]
|
test_img = ms.MultimodalSearch.read_img(my_dict, TEST_IMAGE_2)
|
||||||
|
assert list(numpy.array(test_img)[257][34]) == [70, 66, 63]
|
||||||
|
|
||||||
# def test_load_feature_extractor_model_blip2():
|
|
||||||
# multimodal_device = device("cuda" if cuda.is_available() else "cpu")
|
|
||||||
# (model, vis_processors, txt_processors,) = ms.load_feature_extractor_model_blip2(multimodal_device)
|
|
||||||
|
|
||||||
mydict = {}
|
# def test_load_feature_extractor_model_blip2():
|
||||||
for img_path in images:
|
# multimodal_device = device("cuda" if cuda.is_available() else "cpu")
|
||||||
id_ = os.path.splitext(os.path.basename(img_path))[0]
|
# (model, vis_processors, txt_processors,) = ms.load_feature_extractor_model_blip2(multimodal_device)
|
||||||
mydict[id_] = {"filename": img_path}
|
|
||||||
|
|
||||||
for key in mydict:
|
|
||||||
mydict[key] = sm.SummaryDetector(mydict[key]).analyse_image()
|
|
||||||
keys = list(mydict.keys())
|
|
||||||
assert len(mydict) == 12
|
|
||||||
for key in keys:
|
|
||||||
assert len(mydict[key]["3_non-deterministic summary"]) == 3
|
|
||||||
|
|||||||
Загрузка…
x
Ссылка в новой задаче
Block a user