avans06 commited on
Commit
2cb2e7b
·
1 Parent(s): 99141c3

Fixed the duplicate filename checking function during inference.

Browse files

Previously, 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.

Files changed (2) hide show
  1. app.py +2 -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
- img_name = f"{img_name}_{name_counters[img_name]:02d}"
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.16.0
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