Fixed the duplicate filename checking function during inference.
Browse filesPreviously, serial numbers were automatically added to duplicate filenames, but they were incorrectly added after the file extension. This has now been fixed.
Upgraded Gradio version to 5.25.1.
- app.py +2 -2
- requirements.txt +1 -1
app.py
CHANGED
@@ -816,11 +816,11 @@ class Upscale:
|
|
816 |
try:
|
817 |
img_path = str(value[0])
|
818 |
img_name = os.path.basename(img_path)
|
|
|
819 |
# Increment the counter for the current name
|
820 |
name_counters[img_name] += 1
|
821 |
if name_counters[img_name] > 1:
|
822 |
-
|
823 |
-
basename, extension = os.path.splitext(img_name)
|
824 |
|
825 |
img_cv2 = cv2.imdecode(np.fromfile(img_path, np.uint8), cv2.IMREAD_UNCHANGED) # numpy.ndarray
|
826 |
|
|
|
816 |
try:
|
817 |
img_path = str(value[0])
|
818 |
img_name = os.path.basename(img_path)
|
819 |
+
basename, extension = os.path.splitext(img_name)
|
820 |
# Increment the counter for the current name
|
821 |
name_counters[img_name] += 1
|
822 |
if name_counters[img_name] > 1:
|
823 |
+
basename = f"{basename}_{name_counters[img_name]:02d}"
|
|
|
824 |
|
825 |
img_cv2 = cv2.imdecode(np.fromfile(img_path, np.uint8), cv2.IMREAD_UNCHANGED) # numpy.ndarray
|
826 |
|
requirements.txt
CHANGED
@@ -1,6 +1,6 @@
|
|
1 |
--extra-index-url https://download.pytorch.org/whl/cu124
|
2 |
|
3 |
-
gradio==5.
|
4 |
|
5 |
basicsr @ git+https://github.com/avan06/BasicSR
|
6 |
facexlib @ git+https://github.com/avan06/facexlib
|
|
|
1 |
--extra-index-url https://download.pytorch.org/whl/cu124
|
2 |
|
3 |
+
gradio==5.25.1
|
4 |
|
5 |
basicsr @ git+https://github.com/avan06/BasicSR
|
6 |
facexlib @ git+https://github.com/avan06/facexlib
|