edit : 요청값보다 벡터파일에 등록된 갯수가 적을경우 각 항목 null로 처리

This commit is contained in:
2025-12-04 16:48:17 +09:00
parent fce9eedfae
commit 7eed2e9868
4 changed files with 39 additions and 10 deletions

View File

@@ -128,6 +128,11 @@ def get_clip_info(model, query_image_path, item_info, top_k=4):
# index_type=model.value[1].index_type)
inference_times, result_img_paths, result_percents = vector_model.query_faiss(query_image_path, top_k=top_k)
for i in range(len(result_percents)):
if float(result_percents[i]) < 0.0:
result_percents[i] = None
result_img_paths[i] = None
report_info = ReportInfo(
feature_extraction_model=ReportInfoConst.feature_extraction_model,

View File

@@ -7,6 +7,14 @@ def search_glass_parts(image_path_list):
result = []
for image_path in image_path_list:
if image_path is None:
result.append(None)
continue
elif not os.path.exists(image_path):
result.append(None)
continue
parts_path = Path(os.path.join(os.path.dirname(os.path.dirname(image_path)),ImageDepths.parts))
parts_files_generator = parts_path.rglob('*.png')