KevinX-Penn28 commited on
Commit
38c755c
·
verified ·
1 Parent(s): bb85acd

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +8 -7
app.py CHANGED
@@ -44,12 +44,13 @@ VineConfig = vine_config_module.VineConfig # your config class
44
  VineModel = vine_model_module.VineModel # your model class
45
  VinePipeline = vine_pipeline_module.VinePipeline
46
 
47
- current_dir = Path(__file__).parent
48
- sam_config_path = "//" + str(current_dir / "sam2_hiera_t.yaml")
49
- sam_checkpoint_path = "//" + str(current_dir / "sam2_hiera_tiny.pt")
50
- gd_config_path = "//" + str(current_dir / "GroundingDINO_SwinT_OGC.py")
51
- gd_checkpoint_path = "//" + str(current_dir / "groundingdino_swint_ogc.pth")
52
- visualization_dir = "//" + str(current_dir / "outputs")
 
53
 
54
  def process_video(video_file, categorical_keywords, unary_keywords, binary_keywords, object_pairs, output_fps):
55
  log_buffer = io.StringIO()
@@ -105,7 +106,7 @@ def process_video(video_file, categorical_keywords, unary_keywords, binary_keywo
105
  return_top_k=5,
106
  include_visualizations=True,
107
  debug_visualizations=False,
108
- device = 2
109
  )
110
 
111
  if isinstance(results, Mapping):
 
44
  VineModel = vine_model_module.VineModel # your model class
45
  VinePipeline = vine_pipeline_module.VinePipeline
46
 
47
+ current_dir= Path.cwd()
48
+
49
+ sam_config_path = str(current_dir / "sam2_hiera_t.yaml")
50
+ sam_checkpoint_path = str(current_dir / "sam2_hiera_tiny.pt")
51
+ gd_config_path = str(current_dir / "GroundingDINO_SwinT_OGC.py")
52
+ gd_checkpoint_path = str(current_dir / "groundingdino_swint_ogc.pth")
53
+ visualization_dir = str(current_dir / "outputs")
54
 
55
  def process_video(video_file, categorical_keywords, unary_keywords, binary_keywords, object_pairs, output_fps):
56
  log_buffer = io.StringIO()
 
106
  return_top_k=5,
107
  include_visualizations=True,
108
  debug_visualizations=False,
109
+ device = "cuda"
110
  )
111
 
112
  if isinstance(results, Mapping):