DanielPFlorian commited on
Commit
f14216f
·
1 Parent(s): 9d8f8c8

use regex to remove non-alphanumeric characters

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -112,9 +112,9 @@ def process_image(img_path):
112
  os.makedirs("inference", exist_ok=True)
113
 
114
  # Remove non alphanumeric characters
115
- image_path = re.sub(r"\W+", "", img_path)
116
- image_path = str(datetime.now()) + ".png"
117
- image_path = image_path.replace(" ", "_")
118
 
119
  # Join to directory path
120
  inf_image = os.path.join("inference", image_path)
 
112
  os.makedirs("inference", exist_ok=True)
113
 
114
  # Remove non alphanumeric characters
115
+ image_path = str(datetime.now())
116
+ image_path = re.sub(r"\W+", "_", image_path)
117
+ image_path = image_path + ".png"
118
 
119
  # Join to directory path
120
  inf_image = os.path.join("inference", image_path)