зеркало из
				https://github.com/ssciwr/AMMICO.git
				synced 2025-10-30 21:46:04 +02:00 
			
		
		
		
	[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
Этот коммит содержится в:
		
							родитель
							
								
									e889fb95f7
								
							
						
					
					
						Коммит
						fc04ee12d8
					
				| @ -370,18 +370,20 @@ sorted_clip_vitl14_336 = [ | |||||||
|     [6, 5, 4, 10, 2, 3, 0, 1, 11, 7, 9, 8], |     [6, 5, 4, 10, 2, 3, 0, 1, 11, 7, 9, 8], | ||||||
| ] | ] | ||||||
| 
 | 
 | ||||||
| itm_scores_for_blib_base = [0.09277121722698212, | itm_scores_for_blib_base = [ | ||||||
|  0.020782141014933586, |     0.09277121722698212, | ||||||
|  0.020832309499382973, |     0.020782141014933586, | ||||||
|  0.004225197248160839, |     0.020832309499382973, | ||||||
|  0.00020702541223727167, |     0.004225197248160839, | ||||||
|  0.00410003075376153, |     0.00020702541223727167, | ||||||
|  0.0009893759852275252, |     0.00410003075376153, | ||||||
|  0.00015318581426981837, |     0.0009893759852275252, | ||||||
|  1.9936736862291582e-05, |     0.00015318581426981837, | ||||||
|  4.0083985368255526e-05, |     1.9936736862291582e-05, | ||||||
|  0.0006117734010331333, |     4.0083985368255526e-05, | ||||||
|  4.1486648115096614e-05] |     0.0006117734010331333, | ||||||
|  |     4.1486648115096614e-05, | ||||||
|  | ] | ||||||
| 
 | 
 | ||||||
| 
 | 
 | ||||||
| @pytest.mark.parametrize( | @pytest.mark.parametrize( | ||||||
| @ -627,26 +629,26 @@ def test_parsing_images( | |||||||
|     del model, vis_processor, txt_processor |     del model, vis_processor, txt_processor | ||||||
|     cuda.empty_cache() |     cuda.empty_cache() | ||||||
| 
 | 
 | ||||||
|     if (pre_model == "blip"): |     if pre_model == "blip": | ||||||
|         for itm_model in ["blip_base", "blip_large", "blip2_coco"]: |         for itm_model in ["blip_base", "blip_large", "blip2_coco"]: | ||||||
|             itm_scores, image_gradcam_with_itm = ms.MultimodalSearch.image_text_match_reordering( |             ( | ||||||
|             testdict, |                 itm_scores, | ||||||
|             search_query2, |                 image_gradcam_with_itm, | ||||||
|             itm_model, |             ) = ms.MultimodalSearch.image_text_match_reordering( | ||||||
|             image_keys, |                 testdict, | ||||||
|             sorted_list, |                 search_query2, | ||||||
|             batch_size=1, |                 itm_model, | ||||||
|             need_grad_cam=True, |                 image_keys, | ||||||
|  |                 sorted_list, | ||||||
|  |                 batch_size=1, | ||||||
|  |                 need_grad_cam=True, | ||||||
|             ) |             ) | ||||||
|             for i,itm in zip(range(len(itm_scores_for_blib_base)), itm_scores_for_blib_base): |             for i, itm in zip( | ||||||
|  |                 range(len(itm_scores_for_blib_base)), itm_scores_for_blib_base | ||||||
|  |             ): | ||||||
|                 assert ( |                 assert ( | ||||||
|                     math.isclose(itm_scores[0].tolist()[i], itm, rel_tol = 100*related_error) is True |                     math.isclose( | ||||||
|  |                         itm_scores[0].tolist()[i], itm, rel_tol=100 * related_error | ||||||
|  |                     ) | ||||||
|  |                     is True | ||||||
|                 ) |                 ) | ||||||
|              |  | ||||||
| 
 |  | ||||||
|              |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
| 
 |  | ||||||
|      |  | ||||||
		Загрузка…
	
	
			
			x
			
			
		
	
		Ссылка в новой задаче
	
	Block a user
	![66853113+pre-commit-ci[bot]@users.noreply.github.com](/assets/img/avatar_default.png) pre-commit-ci[bot]
						pre-commit-ci[bot]