Hbvsa commited on
Commit
a884c06
1 Parent(s): 0ef7b62

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +18 -18
app.py CHANGED
@@ -23,24 +23,6 @@ def run_commands():
23
  # Call the function to run the commands
24
 
25
  if __name__ == "__main__":
26
- run_commands()
27
-
28
- from typing import List
29
- from Utils import get_video_properties
30
- from GroundingDINO.groundingdino.util.inference import load_model, predict
31
- import cv2
32
- import numpy as np
33
- import torch
34
- from PIL import Image
35
- import GroundingDINO.groundingdino.datasets.transforms as T
36
- from torchvision.ops import box_convert
37
- from torchvision import transforms
38
- from torch import nn
39
- from os.path import dirname, abspath
40
- import yaml
41
- import supervision as sv
42
- import gradio as gr
43
- import spaces
44
 
45
  class DinoVisionTransformerClassifier(nn.Module):
46
  def __init__(self):
@@ -167,6 +149,24 @@ if __name__ == "__main__":
167
 
168
  @spaces.GPU(duration=30)
169
  def generate_video(self, video_path) -> None:
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
170
 
171
  # Load model, set up variables and get video properties
172
  cap, fps, width, height, fourcc = get_video_properties(video_path)
 
23
  # Call the function to run the commands
24
 
25
  if __name__ == "__main__":
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
 
27
  class DinoVisionTransformerClassifier(nn.Module):
28
  def __init__(self):
 
149
 
150
  @spaces.GPU(duration=30)
151
  def generate_video(self, video_path) -> None:
152
+ run_commands()
153
+
154
+ from typing import List
155
+ from Utils import get_video_properties
156
+ from GroundingDINO.groundingdino.util.inference import load_model, predict
157
+ import cv2
158
+ import numpy as np
159
+ import torch
160
+ from PIL import Image
161
+ import GroundingDINO.groundingdino.datasets.transforms as T
162
+ from torchvision.ops import box_convert
163
+ from torchvision import transforms
164
+ from torch import nn
165
+ from os.path import dirname, abspath
166
+ import yaml
167
+ import supervision as sv
168
+ import gradio as gr
169
+ import spaces
170
 
171
  # Load model, set up variables and get video properties
172
  cap, fps, width, height, fourcc = get_video_properties(video_path)