vikit.video.building.handlers.quality_check_handler

Overview

Classes

QualityCheckHandler

Checks the quality of a video and rebuilds it if necessary

Classes

class vikit.video.building.handlers.quality_check_handler.QualityCheckHandler(video_gen_handler, is_good_until, max_attempts, prompt_updater_fn=None)

Bases: vikit.common.handler.Handler

Checks the quality of a video and rebuilds it if necessary

Parameters:
  • video_gen_handler (Handler) -- The video generation handler to call if the quality check is not qualitative enough

  • is_good_until (function) -- The quality check function

  • max_attempts (int) -- The maximum number of times to attempt the video generation.

  • prompt_updater_fn (function) -- A optional hook function that updates the video generation prompt for each attempt. If not specified, the same prompt is reused for every attempt.

Returns:

The same video if the quality check was positive, and a regeneration if not

Overview

Methods

execute_async(video, ml_models_gateway, min_good_secs)

Checks the quality of a video and rebuilds it if necessary

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.

Members

async execute_async(video, ml_models_gateway: vikit.gateways.ML_models_gateway.MLModelsGateway, min_good_secs=3)

Checks the quality of a video and rebuilds it if necessary

Parameters:

video (Video) -- The video to process

Returns:

The same video if the quality check was positive, and a regeneration if not

async 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. :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