import numpy as np import os from typing import Tuple SAMPLE_IMAGE_S3_PATH = os.getenv("SAMPLE_IMAGE_S3_PATH", ".") def get_random_sample_image() -> Tuple[str, str]: rnd_img_sub_path: str = np.random.choice( np.loadtxt("sample_list.txt", dtype=object) ) rnd_img = os.path.join(SAMPLE_IMAGE_S3_PATH, rnd_img_sub_path) label = rnd_img.split("/")[-2].replace("_", " ").title() return rnd_img, label