Spaces:
Runtime error
Runtime error
jhj0517
commited on
Commit
·
a81c70a
1
Parent(s):
e42652b
Update to use constant
Browse files- modules/utils.py +3 -2
modules/utils.py
CHANGED
@@ -3,6 +3,8 @@ from PIL import Image
|
|
3 |
from typing import Optional, Union
|
4 |
import numpy as np
|
5 |
|
|
|
|
|
6 |
|
7 |
def open_folder(folder_path: str):
|
8 |
if os.path.exists(folder_path):
|
@@ -12,8 +14,7 @@ def open_folder(folder_path: str):
|
|
12 |
|
13 |
|
14 |
def is_image_file(filename):
|
15 |
-
|
16 |
-
return os.path.splitext(filename.lower())[1] in image_extensions
|
17 |
|
18 |
|
19 |
def get_image_files(image_dir: str):
|
|
|
3 |
from typing import Optional, Union
|
4 |
import numpy as np
|
5 |
|
6 |
+
from modules.constants import IMAGE_FILE_EXT
|
7 |
+
|
8 |
|
9 |
def open_folder(folder_path: str):
|
10 |
if os.path.exists(folder_path):
|
|
|
14 |
|
15 |
|
16 |
def is_image_file(filename):
|
17 |
+
return os.path.splitext(filename.lower())[1] in IMAGE_FILE_EXT
|
|
|
18 |
|
19 |
|
20 |
def get_image_files(image_dir: str):
|