Besar commited on
Commit
75e2506
·
1 Parent(s): ac5a350
Files changed (29) hide show
  1. __pycache__/track_anything.cpython-39.pyc +0 -0
  2. app.py +5 -2
  3. appy.py +10 -1
  4. checkpoints/sam_vit_h_4b8939.pth +3 -0
  5. inpainter/__pycache__/base_inpainter.cpython-39.pyc +0 -0
  6. inpainter/util/__pycache__/__init__.cpython-39.pyc +0 -0
  7. inpainter/util/__pycache__/tensor_util.cpython-39.pyc +0 -0
  8. tools/__pycache__/__init__.cpython-39.pyc +0 -0
  9. tools/__pycache__/base_segmenter.cpython-39.pyc +0 -0
  10. tools/__pycache__/interact_tools.cpython-39.pyc +0 -0
  11. tools/__pycache__/mask_painter.cpython-39.pyc +0 -0
  12. tools/__pycache__/painter.cpython-39.pyc +0 -0
  13. tracker/__pycache__/base_tracker.cpython-39.pyc +0 -0
  14. tracker/inference/__pycache__/__init__.cpython-39.pyc +0 -0
  15. tracker/inference/__pycache__/inference_core.cpython-39.pyc +0 -0
  16. tracker/inference/__pycache__/kv_memory_store.cpython-39.pyc +0 -0
  17. tracker/inference/__pycache__/memory_manager.cpython-39.pyc +0 -0
  18. tracker/model/__pycache__/__init__.cpython-39.pyc +0 -0
  19. tracker/model/__pycache__/aggregate.cpython-39.pyc +0 -0
  20. tracker/model/__pycache__/cbam.cpython-39.pyc +0 -0
  21. tracker/model/__pycache__/group_modules.cpython-39.pyc +0 -0
  22. tracker/model/__pycache__/memory_util.cpython-39.pyc +0 -0
  23. tracker/model/__pycache__/modules.cpython-39.pyc +0 -0
  24. tracker/model/__pycache__/network.cpython-39.pyc +0 -0
  25. tracker/model/__pycache__/resnet.cpython-39.pyc +0 -0
  26. tracker/util/__pycache__/__init__.cpython-39.pyc +0 -0
  27. tracker/util/__pycache__/mask_mapper.cpython-39.pyc +0 -0
  28. tracker/util/__pycache__/range_transform.cpython-39.pyc +0 -0
  29. tracker/util/__pycache__/tensor_util.cpython-39.pyc +0 -0
__pycache__/track_anything.cpython-39.pyc ADDED
Binary file (3.31 kB). View file
 
app.py CHANGED
@@ -82,7 +82,10 @@ def download_video(video_url):
82
 
83
  def process_video(video_url):
84
 
85
- video_path = download_video(video_url)
 
 
 
86
 
87
  return get_frames_from_video(video_path)
88
 
@@ -566,7 +569,7 @@ with gr.Blocks() as iface:
566
  inputs=[video_input],outputs=[video_path], api_name="api_download_video"
567
  )
568
 
569
- process_video_button.click(
570
  fn=process_video,
571
  inputs=[video_input],outputs=[video_path], api_name="api_process_video"
572
  )
 
82
 
83
  def process_video(video_url):
84
 
85
+ tmp_dir = tempfile.gettempdir()
86
+ video_path = f"{tmp_dir}/input_video.mp4"
87
+
88
+ urllib.request.urlretrieve(video_url, video_path)
89
 
90
  return get_frames_from_video(video_path)
91
 
 
569
  inputs=[video_input],outputs=[video_path], api_name="api_download_video"
570
  )
571
 
572
+ video_input.upload(
573
  fn=process_video,
574
  inputs=[video_input],outputs=[video_path], api_name="api_process_video"
575
  )
appy.py CHANGED
@@ -1,10 +1,19 @@
1
  from gradio_client import Client
 
2
 
3
  client = Client("https://besarismaili-track-anything.hf.space/")
4
 
5
  video_url = "https://github.com/besarismaili/track-anything/raw/main/video_001.mp4"
6
 
7
- result = client.predict(video_url, api_name="/api_extract_frames")
8
  predictions = client.deserialize(result)
9
  #print(client.config)
10
  print(predictions)
 
 
 
 
 
 
 
 
 
1
  from gradio_client import Client
2
+ import gradio as gr
3
 
4
  client = Client("https://besarismaili-track-anything.hf.space/")
5
 
6
  video_url = "https://github.com/besarismaili/track-anything/raw/main/video_001.mp4"
7
 
8
+ result = client.predict(video_url, api_name="/api_process_video")
9
  predictions = client.deserialize(result)
10
  #print(client.config)
11
  print(predictions)
12
+
13
+ with gr.Blocks() as demo:
14
+
15
+ with gr.Row():
16
+ video = gr.Video(result)
17
+
18
+ if __name__ == "__main__":
19
+ demo.launch()
checkpoints/sam_vit_h_4b8939.pth ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:f1d352417f1ead3da0b54c4211ba1ea55f922440f0018c2615247ae1795ae384
3
+ size 1179648
inpainter/__pycache__/base_inpainter.cpython-39.pyc ADDED
Binary file (8.62 kB). View file
 
inpainter/util/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (148 Bytes). View file
 
inpainter/util/__pycache__/tensor_util.cpython-39.pyc ADDED
Binary file (896 Bytes). View file
 
tools/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (139 Bytes). View file
 
tools/__pycache__/base_segmenter.cpython-39.pyc ADDED
Binary file (4.08 kB). View file
 
tools/__pycache__/interact_tools.cpython-39.pyc ADDED
Binary file (2.46 kB). View file
 
tools/__pycache__/mask_painter.cpython-39.pyc ADDED
Binary file (6.49 kB). View file
 
tools/__pycache__/painter.cpython-39.pyc ADDED
Binary file (4.78 kB). View file
 
tracker/__pycache__/base_tracker.cpython-39.pyc ADDED
Binary file (4.73 kB). View file
 
tracker/inference/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (151 Bytes). View file
 
tracker/inference/__pycache__/inference_core.cpython-39.pyc ADDED
Binary file (3.22 kB). View file
 
tracker/inference/__pycache__/kv_memory_store.cpython-39.pyc ADDED
Binary file (6.26 kB). View file
 
tracker/inference/__pycache__/memory_manager.cpython-39.pyc ADDED
Binary file (6.85 kB). View file
 
tracker/model/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (147 Bytes). View file
 
tracker/model/__pycache__/aggregate.cpython-39.pyc ADDED
Binary file (574 Bytes). View file
 
tracker/model/__pycache__/cbam.cpython-39.pyc ADDED
Binary file (3.64 kB). View file
 
tracker/model/__pycache__/group_modules.cpython-39.pyc ADDED
Binary file (3.1 kB). View file
 
tracker/model/__pycache__/memory_util.cpython-39.pyc ADDED
Binary file (1.73 kB). View file
 
tracker/model/__pycache__/modules.cpython-39.pyc ADDED
Binary file (7.81 kB). View file
 
tracker/model/__pycache__/network.cpython-39.pyc ADDED
Binary file (6.03 kB). View file
 
tracker/model/__pycache__/resnet.cpython-39.pyc ADDED
Binary file (4.96 kB). View file
 
tracker/util/__pycache__/__init__.cpython-39.pyc ADDED
Binary file (146 Bytes). View file
 
tracker/util/__pycache__/mask_mapper.cpython-39.pyc ADDED
Binary file (2.47 kB). View file
 
tracker/util/__pycache__/range_transform.cpython-39.pyc ADDED
Binary file (467 Bytes). View file
 
tracker/util/__pycache__/tensor_util.cpython-39.pyc ADDED
Binary file (1.48 kB). View file