Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -70,15 +70,15 @@ def get_detections_from_job(
return audio_tracks

def get_detections_from_audio(self, job: mpf.AudioJob) -> List[mpf.AudioTrack]:
logger.info('Received audio job')
logger.debug('Received audio job: {job}')
return self.get_detections_from_job(job)


def get_detections_from_video(
self,
job: mpf.VideoJob
) -> List[mpf.VideoTrack]:
logger.info('Received video job')
logger.debug('Received video job: {job}')

if 'FPS' not in job.media_properties:
error_str = 'FPS must be included in video job media properties.'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,7 +209,7 @@ def process_audio(self, job_config: AzureJobConfig) -> List[mpf.AudioTrack]:
)

missing_models = set()
default_locale = AzureConnection._convert_case_bcp(job_config.language)
default_locale = AzureConnection.convert_case_bcp(job_config.language)
if (lang := job_config.override_default_language) is not None:
if lang.lower() in ISO6393_TO_BCP47:
for locale in ISO6393_TO_BCP47[lang.lower()]:
Expand Down Expand Up @@ -284,7 +284,7 @@ def process_audio(self, job_config: AzureJobConfig) -> List[mpf.AudioTrack]:
)
locale = default_locale

locale = AzureConnection._convert_case_bcp(locale)
locale = AzureConnection.convert_case_bcp(locale)
if locale not in self.acs.supported_locales:
raise mpf.DetectionException(
f"Selected locale ('{locale}') is not supported by Azure "
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ def __init__(self):


@staticmethod
def _convert_case_bcp(bcp: str) -> str:
def convert_case_bcp(bcp: str) -> str:
if not bcp:
return bcp

Expand Down Expand Up @@ -118,7 +118,7 @@ def _expand_locale_set(cls, locales):
expanded = set()
for loc in locales:
expanded.add(loc)
expanded.add(cls._convert_case_bcp(loc))
expanded.add(cls.convert_case_bcp(loc))
return expanded

@staticmethod
Expand Down Expand Up @@ -219,8 +219,8 @@ def update_acs(self, server_info: AcsServerInfo):
self.transcribe_locales = self._expand_locale_set(set(raw_transcribe))
self.supported_locales = self.submit_locales

logger.info('Supported locales (Submit): %s', sorted(raw_submit))
logger.info('Supported locales (Transcribe): %s', sorted(raw_transcribe))
logger.debug('Supported locales (Submit): %s', sorted(raw_submit))
logger.debug('Supported locales (Transcribe): %s', sorted(raw_transcribe))

if (self.blob_container_url != server_info.blob_container_url
or self.blob_service_key != server_info.blob_service_key
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __init__(self) -> None:

def get_detections_from_video(self, job: mpf.VideoJob) -> Sequence[mpf.VideoTrack]:
try:
log.info(f'Received video job: {job}')
log.debug(f'Received video job: {job}')
ff_track = job.feed_forward_track
if ff_track is None:
fail_when_missing_feed_forward()
Expand Down Expand Up @@ -114,7 +114,7 @@ def get_detections_from_non_composite(
sentence_model: TextSplitterModel,
ff_track: Optional[T_FF_OBJ]) -> Sequence[T_FF_OBJ]:
try:
log.info(f'Received job: {job}')
log.debug(f'Received job: {job}')
if ff_track is None:
fail_when_missing_feed_forward()

Expand Down