vikit.video.building.handlers.quality_check_handler =================================================== .. py:module:: vikit.video.building.handlers.quality_check_handler Overview -------- .. list-table:: Classes :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`QualityCheckHandler ` - Checks the quality of a video and rebuilds it if necessary Classes ------- .. py:class:: QualityCheckHandler(video_gen_handler, is_good_until, max_attempts, prompt_updater_fn=None) Bases: :py:obj:`vikit.common.handler.Handler` Checks the quality of a video and rebuilds it if necessary :param video_gen_handler: The video generation handler to call if the quality check is not qualitative enough :type video_gen_handler: Handler :param is_good_until: The quality check function :type is_good_until: function :param max_attempts: The maximum number of times to attempt the video generation. :type max_attempts: int :param prompt_updater_fn: A optional hook function that updates the video generation prompt for each attempt. If not specified, the same prompt is reused for every attempt. :type prompt_updater_fn: function :returns: The same video if the quality check was positive, and a regeneration if not .. rubric:: Overview .. list-table:: Methods :header-rows: 0 :widths: auto :class: summarytable * - :py:obj:`execute_async `\ (video, ml_models_gateway, min_good_secs) - Checks the quality of a video and rebuilds it if necessary * - :py:obj:`get_is_good_up_to_secs_for_video `\ (video, ml_models_gateway) - Gets the second until the video is considered good, or -1 if the video is qualitative. .. rubric:: Members .. py:method:: execute_async(video, ml_models_gateway: vikit.gateways.ML_models_gateway.MLModelsGateway, min_good_secs=3) :async: Checks the quality of a video and rebuilds it if necessary :param video: The video to process :type video: Video :returns: The same video if the quality check was positive, and a regeneration if not .. py:method:: get_is_good_up_to_secs_for_video(video, ml_models_gateway) :async: Gets the second until the video is considered good, or -1 if the video is qualitative. :param video: The video to test :type video: Video :param ml_models_gateway: The ML Models Gateway :type ml_models_gateway: MLModelGateway :returns: The second until the video is considered good, or -1