11# Import benchmark modules
2- from benchmark .operators import (
3- classify_video_zero_shot ,
4- cluster_embeddings ,
5- detect_lewd_images ,
6- detect_text_in_image_tesseract ,
7- dimension_reduction ,
8- image_vec_rep_resnet ,
9- vid_vec_rep_clip ,
10- video_hash_tmk ,
11- )
2+ from benchmark .operators import all_operators
123from benchmark .report import BenchmarkReport
134
145
156def main ():
167 report = BenchmarkReport ()
178
18- # List of benchmark modules to run
19- benchmark_modules = [
20- ("vid_vec_rep_clip" , vid_vec_rep_clip ),
21- ("video_hash_tmk" , video_hash_tmk ),
22- ("image_vec_rep_resnet" , image_vec_rep_resnet ),
23- ("detect_text_in_image_tesseract" , detect_text_in_image_tesseract ),
24- ("detect_lewd_images" , detect_lewd_images ),
25- ("classify_video_zero_shot" , classify_video_zero_shot ),
26- ("dimension_reduction" , dimension_reduction ),
27- ("cluster_embeddings" , cluster_embeddings ),
28- ]
29-
30- for name , module in benchmark_modules :
31- print (f"\n === Benchmarking { name } ===" )
32- results = module .benchmark ()
33- for result in results :
34- report .add (result )
9+ for operator in all_operators :
10+ results = operator .benchmark ()
11+ report .extend (results )
3512
3613 report .save_json ()
3714 report .save_markdown ()
3815
3916
4017if __name__ == "__main__" :
4118 main ()
42-
43-
44- import operators
45- for op in operators .__all__ :
46- print (f"Loaded operator: { op } " )
0 commit comments