GabrielML commited on
Commit
e8373ad
·
1 Parent(s): bda029c

Add print time

Browse files
Files changed (2) hide show
  1. requirements.txt +1 -0
  2. src/app.py +13 -0
requirements.txt CHANGED
@@ -7,3 +7,4 @@ gradio==3.44.4
7
  Markdown==3.4.4
8
  Pillow==10.0.1
9
  tqdm==4.66.1
 
 
7
  Markdown==3.4.4
8
  Pillow==10.0.1
9
  tqdm==4.66.1
10
+ pytz
src/app.py CHANGED
@@ -1,5 +1,7 @@
1
  import gradio as gr
2
  from utils import load_specific_model, inference
 
 
3
 
4
  # current_model = None # Initialize the current model as None
5
  MODEL_NAMES = ["EfficientNet-B3", "EfficientNet-B4", "vgg19", "resnet50", "dinov2_vits14"]
@@ -21,6 +23,17 @@ def predict(inp_image, inp_dropdown):
21
  if inp_dropdown not in MODEL_NAMES:
22
  raise gr.Error("Invalid model selected!")
23
 
 
 
 
 
 
 
 
 
 
 
 
24
  print(f"\nInput: {inp_dropdown}\n")
25
  current_model = load_specific_model(inp_dropdown)
26
  confidences = inference(current_model, inp_image)
 
1
  import gradio as gr
2
  from utils import load_specific_model, inference
3
+ from datetime import datetime
4
+ import pytz
5
 
6
  # current_model = None # Initialize the current model as None
7
  MODEL_NAMES = ["EfficientNet-B3", "EfficientNet-B4", "vgg19", "resnet50", "dinov2_vits14"]
 
23
  if inp_dropdown not in MODEL_NAMES:
24
  raise gr.Error("Invalid model selected!")
25
 
26
+ # Get the current time in UTC
27
+ utc_now = datetime.now(pytz.utc)
28
+
29
+ # Convert UTC time to German time zone
30
+ german_timezone = pytz.timezone('Europe/Berlin')
31
+ german_time = utc_now.astimezone(german_timezone)
32
+
33
+ # Format and print the German time and date
34
+ formatted_time = german_time.strftime('%Y-%m-%d %H:%M:%S %Z')
35
+ print('Current time and date:', formatted_time)
36
+
37
  print(f"\nInput: {inp_dropdown}\n")
38
  current_model = load_specific_model(inp_dropdown)
39
  confidences = inference(current_model, inp_image)