Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
nguu0123 committed Sep 16, 2024
1 parent 840ca63 commit bd18949
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 0 deletions.
Empty file.
21 changes: 21 additions & 0 deletions src/qoa4ml/probes/dataquality.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,33 @@

import numpy as np
import pandas as pd
from fastapi import UploadFile
from PIL import Image

from ..lang.datamodel_enum import DataQualityNameEnum, ImageQualityNameEnum
from ..utils.logger import qoa_logger


def input_file_type(input_file: UploadFile, allowed_data_type: list[str]):
"""
Check if the input file matches any of the allowed data types
Parameters:
-----------
input_file : UploadFile
The uploaded file object to be checked for data type.
allowed_data_type : List[str]
A list of allowed data types to compare against the content type of the input file.
Returns:
--------
bool
True if the content type of the input file is in the list of allowed data types,
otherwise False.
"""
return input_file.content_type in allowed_data_type


def image_quality(input_image: bytes | np.ndarray):
"""
Assess various quality metrics of an input image.
Expand Down

0 comments on commit bd18949

Please sign in to comment.