Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -82,8 +82,19 @@ def swap_face(source_file, target_file, doFaceEnhancer):
|
|
82 |
# Create date-based folder
|
83 |
folder_path, date_folder = dataset_handler.create_date_folder()
|
84 |
|
85 |
-
|
86 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
87 |
|
88 |
# Save input images with timestamp in folder
|
89 |
source_path = os.path.join(folder_path, f"source_{timestamp}.jpg")
|
|
|
82 |
# Create date-based folder
|
83 |
folder_path, date_folder = dataset_handler.create_date_folder()
|
84 |
|
85 |
+
# Lấy thời gian hiện tại
|
86 |
+
now = datetime.now()
|
87 |
+
|
88 |
+
# Phân tách thành từng thành phần
|
89 |
+
seconds = now.strftime("%S") # Giây
|
90 |
+
minutes = now.strftime("%M") # Phút
|
91 |
+
hours = now.strftime("%H") # Giờ
|
92 |
+
day = now.strftime("%d") # Ngày
|
93 |
+
month = now.strftime("%m") # Tháng
|
94 |
+
year = now.strftime("%Y") # Năm
|
95 |
+
|
96 |
+
# Kết hợp lại thành timestamp
|
97 |
+
timestamp = f"{seconds}{minutes}{hours}{day}{month}{year}"
|
98 |
|
99 |
# Save input images with timestamp in folder
|
100 |
source_path = os.path.join(folder_path, f"source_{timestamp}.jpg")
|