@@ -318,23 +318,37 @@ function demo(set,user_path,varargin)
318
318
319
319
%% Labelling Quality
320
320
if LABELLING_QUALITY
321
- for i = 1 : length(seg_overlap )
322
- load(fullfile(project_path ,' segmentation' ,seg_name(i ).name));
323
- p = strsplit(files(i ).name,' .mat' );
321
+ labs = dir(fullfile(project_path ,' labels' ,' *.mat' ));
322
+ segs = dir(fullfile(project_path ,' segmentation' ,' *.mat' ));
323
+ for i = 1 : length(labs )
324
+ [~ ,len ,ovl ,~ ,~ ] = split_labels_name(labs(i ).name);
325
+ if isequal(len ,' 0' ) || isequal(ovl ,' 0' )
326
+ continue
327
+ end
328
+ p = strsplit(labs(i ).name,' .mat' );
324
329
p = p{1 };
325
330
output_path = char(fullfile(project_path ,' labels' ,strcat(p ,' _check' )));
326
331
if ~exist(output_path ,' dir' )
327
332
mkdir(output_path );
328
333
end
329
- [nc ,res1bare ,res2bare ,res1 ,res2 ,res3 ,covering ] = results_clustering_parameters(segmentation_configs ,fullfile(project_path ,' labels' ,lab_name(i ).name),0 ,output_path ,10 ,100 ,10 ,' WAITBAR' , WAITBAR , ' DISPLAY' , DISPLAY );
334
+ for s = 1 : length(segs )
335
+ seg = fullfile(project_path ,' segmentation' ,segs(s ).name);
336
+ [~ ,~ ,sl ,so ] = split_segmentation_name(seg );
337
+ if isequal(sl ,len ) && isequal(so ,ovl )
338
+ load(fullfile(project_path ,' segmentation' ,segs(s ).name));
339
+ break ;
340
+ end
341
+ end
342
+ mkdir(output_path );
343
+ [nc ,res1bare ,res2bare ,res1 ,res2 ,res3 ,covering ] = cross_validation(segmentation_configs ,fullfile(project_path ,' labels' ,labs(i ).name),10 ,[10 ,100 ,10 ],output_path ,' labels' ,0 ,' WAITBAR' , WAITBAR , ' DISPLAY' , DISPLAY );
344
+ [nc ,per_errors1 ,per_undefined1 ,coverage ,per_errors1_true ] = algorithm_statistics(1 ,1 ,nc ,res1bare ,res2bare ,res1 ,res2 ,res3 ,covering );
345
+ data = [nc ' , per_errors1 ' , per_undefined1 ' , coverage ' , per_errors1_true ' ];
346
+ % export results to CSV file
347
+ export_num_of_clusters(output_path ,data );
330
348
output_path = char(fullfile(project_path ,' results' ,strcat(p ,' _cross_validation' )));
331
- if exist(output_path ,' dir' );
349
+ if exist(output_path ,' dir' )
332
350
rmdir(output_path ,' s' );
333
351
end
334
- mkdir(output_path );
335
- [nc ,per_errors1 ,per_undefined1 ,coverage ] = algorithm_statistics(1 ,1 ,nc ,res1bare ,res2bare ,res1 ,res2 ,res3 ,covering );
336
- data = [nc ' , per_errors1 ' , per_undefined1 ' , coverage ' ];
337
- % export results to CSV file
338
352
export_num_of_clusters(output_path ,data );
339
353
% generate graphs
340
354
results_clustering_parameters_graphs(output_path ,nc ,res1bare ,res2bare ,res1 ,res2 ,res3 ,covering );
0 commit comments