§
    Wp«f£  ã                   ó<   — d Z ddlZddlmZ ddlmZ ddlmZ d„ Z	dS )zMediaPipe vision benchmarker.é    N)Úbenchmark_utils)Úbase_vision_benchmark_api)Úbase_optionsc           
      ó´  — t          j        t           j        ¬¦  «        }|                     dddd¬¦  «         |                     ddd	¬
¦  «         |                     ddt          d¬¦  «         |                     ddt
          d¬¦  «         |                     ¦   «         }t          j        t          j
        |¦  «        }t          j        |j        |¦  «        }d|j        ii dœ}|j        |vrt          d|j        › ¦  «        ‚||j                 }i }t           j        j        j        t           j        j        j        fD ]W}	 | ||j        |	¦  «        }
|j        dk    rt          j        |
fi |¤Ž||	<   Œ5|j        dk    rt          j        |
¦  «        ||	<   ŒX|                     ¦   «         D ]*\  }	}t3          d|	› d||j                 › d|d›d¦  «         Œ+d	S )a  Executes a benchmarking process using a specified function ann model.

  Args:
      benchmark_function: A callable function to be executed for benchmarking.
        This function should contain the logic of the task to be benchmarked and
        should be capable of utilizing a model specified by its name.
      default_model_name: The name or path of the default model to be used in
        the benchmarking process. This is useful when the benchmarking function
        requires a model and no other model is explicitly specified.
  )Úformatter_classz--modez+Benchmarking mode (e.g., "nth_percentile").FÚnth_percentile)ÚhelpÚrequiredÚdefaultz--modelzPath to the model.N)r	   r   z--iterationsz&Number of iterations for benchmarking.éd   )r	   Útyper   z--percentilez'Percentile for benchmarking statistics.g     ÀW@Ú
percentile)r   ÚaveragezUnsupported benchmarking mode: r   zInference time ú z: z.6fz milliseconds)ÚargparseÚArgumentParserÚArgumentDefaultsHelpFormatterÚadd_argumentÚintÚfloatÚ
parse_argsÚbuÚget_test_data_pathr   ÚVISION_TEST_DATA_DIRÚget_model_pathÚmodelr   ÚmodeÚ
ValueErrorr   ÚBaseOptionsÚDelegateÚCPUÚGPUÚ
iterationsr   r   ÚitemsÚprint)Úbenchmark_functionÚdefault_model_nameÚparserÚargsÚdefault_model_pathÚ
model_pathÚmode_args_mappingÚ	mode_argsÚresultsÚdelegate_typeÚinference_timesÚresults               úq/var/www/html/nettyfy-visnx/env/lib/python3.11/site-packages/mediapipe/tasks/python/benchmark/vision/benchmark.pyÚbenchmarkerr3      so  € õ Ô"ÝÔ<ðñ ô €&ð 	×ÒØØ8ØØð	 ñ ô ð ð 	×ÒiÐ&:ÀDÐÑIÔIÐIØ×ÒØØ3ÝØð	 ñ ô ð ð 	×ÒØØ4ÝØð	 ñ ô ð ð 
×	Ò	Ñ	Ô	€$õ Ô,ÝÔ4Ð6Hñô Ðõ Ô  ¤Ð-?Ñ@Ô@€*ð & t¤Ð7Øðð Ðð 
„YÐ'Ð'Ð'Ý
ÐB°t´yÐBÐBÑ
CÔ
CÐCà ¤	Ô*€)ð €'åÔÔ'Ô+ÝÔÔ'Ô+ðð ;ð ;€mð )Ð(ØD”O ]ñô €Oð
 „yÐ$Ò$Ð$Ý!Ô0°ÐNÐNÀIÐNÐN€gˆmÑÐØ	ŒiÒ	Ð	Ý!œz¨/Ñ:Ô:€gˆmÑøð  'Ÿ}š}™œð ð Ñ€mVÝ	ð	%˜-ð 	%ð 	%Ð*;¸D¼IÔ*Fð 	%ð 	%ØÐ$ð	%ð 	%ð 	%ñô ð ð ðð ó    )
Ú__doc__r   Ú mediapipe.tasks.python.benchmarkr   r   Ú,mediapipe.tasks.python.benchmark.vision.corer   Úmediapipe.tasks.python.corer   r3   © r4   r2   ú<module>r:      sj   ðð $Ð #à €€€à BÐ BÐ BÐ BÐ BÐ BØ RÐ RÐ RÐ RÐ RÐ RØ 4Ð 4Ð 4Ð 4Ð 4Ð 4ðLð Lð Lð Lð Lr4   