lch01 commited on
Commit
4ef0a61
·
1 Parent(s): 6687f9a

fix input of inference

Browse files
Files changed (1) hide show
  1. app.py +7 -0
app.py CHANGED
@@ -71,6 +71,13 @@ def run_model(target_dir, model) -> dict:
71
  images = load_and_preprocess_images(image_names).to(device)
72
  print(f"Preprocessed images shape: {images.shape}")
73
 
 
 
 
 
 
 
 
74
  # Run inference
75
  print("Running inference...")
76
  dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] >= 8 else torch.float16
 
71
  images = load_and_preprocess_images(image_names).to(device)
72
  print(f"Preprocessed images shape: {images.shape}")
73
 
74
+ frames = []
75
+ for i in range(images.shape[0]):
76
+ frame = {
77
+ "img": images[i]
78
+ }
79
+ frames.append(frame)
80
+
81
  # Run inference
82
  print("Running inference...")
83
  dtype = torch.bfloat16 if torch.cuda.get_device_capability()[0] >= 8 else torch.float16