Spaces:
Sleeping
Sleeping
Commit
·
f14216f
1
Parent(s):
9d8f8c8
use regex to remove non-alphanumeric characters
Browse files
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 =
|
116 |
-
image_path =
|
117 |
-
image_path = image_path
|
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)
|