10
10
create_directory (output_path )
11
11
12
12
config = {
13
- 'lime' : {
14
- 'num_features' : 128 * 128 ,
15
- 'mask_features' : 5 ,
16
- 'num_samples' : 1000 ,
17
- },
18
- 'counterfactual' : {
19
- 'threshold_pct' : 0.98 ,
20
- 'block_size' : 32
21
- },
13
+ # 'lime': {
14
+ # 'num_features': 128*128,
15
+ # 'mask_features': 5,
16
+ # 'num_samples': 1000,
17
+ # },
18
+ # 'counterfactual': {
19
+ # 'threshold_pct': 0.98,
20
+ # 'block_size': 32
21
+ # },
22
22
'shap' : {
23
- 'blend_alpha' : 0.85 ,
23
+ 'blend_alpha' : 0.7 ,
24
24
'background_samples' : 100
25
25
},
26
- 'elrp' : {
27
- 'max_loss_value' : 1000
28
- },
26
+ # 'elrp': {
27
+ # 'max_loss_value': 1000
28
+ # },
29
29
'output_path' : output_path ,
30
30
'test_data_path' : join_paths (["TEST_SETS/" , train_data .__name__ , "" ]),
31
31
'train_data' : train_data .data , # np.array of normal images
38
38
rec_model = get_model (model_path )
39
39
loss_model = get_model (model_path , rec = False )
40
40
41
- p = Pipeline (rec_model , loss_model , config )
42
- p .run ()
41
+ # p = Pipeline(rec_model, loss_model, config)
42
+ # p.run()
43
43
44
- # output_path = config["output_path"]
45
- # test_path = config['test_data_path']
46
- # for category_dir in read_directory_contents(test_path):
47
- # category_type = os.path.split(category_dir)[-1]
48
- # INFO(category_type)
49
- # config["output_path"] = join_paths([output_path, category_type, ""])
50
- # config['data_name'] = category_type
51
- # create_directory(config["output_path"])
52
- # config['test_data_path'] = category_dir
44
+ output_path = config ["output_path" ]
45
+ test_path = config ['test_data_path' ]
46
+ for category_dir in read_directory_contents (test_path ):
47
+ category_type = os .path .split (category_dir )[- 1 ]
48
+ INFO (category_type )
49
+ config ["output_path" ] = join_paths ([output_path , category_type , "" ])
50
+ config ['data_name' ] = category_type
51
+ create_directory (config ["output_path" ])
52
+ config ['test_data_path' ] = category_dir
53
53
54
- # _pipline = Pipeline(rec_model, loss_model, config)
55
- # _pipline.run()
54
+ _pipline = Pipeline (rec_model , loss_model , config )
55
+ _pipline .run ()
0 commit comments