Skip to content

Commit

Permalink
fix single file error
Browse files Browse the repository at this point in the history
  • Loading branch information
nilsmechtel committed Oct 24, 2024
1 parent 71c3d05 commit aea958f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion docs/data_providing_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ def read_image(file_path: str):

def get_random_image(image_folder: str, supported_file_types: Tuple[str]):
filenames = list_image_files(image_folder, supported_file_types)
r = np.random.randint(len(filenames) - 1)
r = np.random.randint(max(len(filenames) - 1, 1))
file_name = filenames[r]
image = read_image(os.path.join(image_folder, file_name))
return (image, file_name.split(".")[0])
Expand Down

0 comments on commit aea958f

Please sign in to comment.