Spaces:
Runtime error
Runtime error
add more detail to debug message
Browse files
app.py
CHANGED
@@ -34,18 +34,20 @@ class calculateDuration:
|
|
34 |
def __enter__(self):
|
35 |
self.start_time = time.time()
|
36 |
self.start_time_formatted = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(self.start_time))
|
37 |
-
print(f"Start time: {self.start_time_formatted}")
|
38 |
return self
|
39 |
|
40 |
def __exit__(self, exc_type, exc_value, traceback):
|
41 |
self.end_time = time.time()
|
42 |
self.elapsed_time = self.end_time - self.start_time
|
43 |
self.end_time_formatted = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(self.end_time))
|
44 |
-
|
45 |
if self.activity_name:
|
46 |
print(f"Elapsed time for {self.activity_name}: {self.elapsed_time:.6f} seconds")
|
47 |
else:
|
48 |
print(f"Elapsed time: {self.elapsed_time:.6f} seconds")
|
|
|
|
|
49 |
|
50 |
|
51 |
def remove_background(image: Image.Image, threshold: int = 50) -> Image.Image:
|
|
|
34 |
def __enter__(self):
|
35 |
self.start_time = time.time()
|
36 |
self.start_time_formatted = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(self.start_time))
|
37 |
+
print(f"Activity: {self.activity_name}, Start time: {self.start_time_formatted}")
|
38 |
return self
|
39 |
|
40 |
def __exit__(self, exc_type, exc_value, traceback):
|
41 |
self.end_time = time.time()
|
42 |
self.elapsed_time = self.end_time - self.start_time
|
43 |
self.end_time_formatted = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime(self.end_time))
|
44 |
+
|
45 |
if self.activity_name:
|
46 |
print(f"Elapsed time for {self.activity_name}: {self.elapsed_time:.6f} seconds")
|
47 |
else:
|
48 |
print(f"Elapsed time: {self.elapsed_time:.6f} seconds")
|
49 |
+
|
50 |
+
print(f"Activity: {self.activity_name}, End time: {self.start_time_formatted}")
|
51 |
|
52 |
|
53 |
def remove_background(image: Image.Image, threshold: int = 50) -> Image.Image:
|