roychao19477 commited on
Commit
787e7f5
·
1 Parent(s): c756bb6

First commit

Browse files
Files changed (1) hide show
  1. app.py +20 -1
app.py CHANGED
@@ -11,7 +11,10 @@ def install_mamba():
11
  #subprocess.run(shlex.split("pip install numpy==1.26.4"))
12
 
13
  def clone_github():
14
- subprocess.run("git clone https://RoyChao19477:[email protected]/RoyChao19477/for_HF_AVSEMamba.git")
 
 
 
15
 
16
  install_mamba()
17
  clone_github()
@@ -34,6 +37,22 @@ import matplotlib.pyplot as plt
34
  from models.stfts import mag_phase_stft, mag_phase_istft
35
  from models.generator import SEMamba
36
  from models.pcs400 import cal_pcs
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
37
 
38
  ckpt = "ckpts/SEMamba_advanced.pth"
39
  cfg_f = "recipes/SEMamba_advanced.yaml"
 
11
  #subprocess.run(shlex.split("pip install numpy==1.26.4"))
12
 
13
  def clone_github():
14
+ subprocess.run([
15
+ "git", "clone",
16
+ f"https://RoyChao19477:{os.environ['GITHUB_TOKEN']}@github.com/RoyChao19477/for_HF_AVSEMamba.git"
17
+ ])
18
 
19
  install_mamba()
20
  clone_github()
 
37
  from models.stfts import mag_phase_stft, mag_phase_istft
38
  from models.generator import SEMamba
39
  from models.pcs400 import cal_pcs
40
+ from ultralytics import YOLO
41
+ import supervision as sv
42
+
43
+
44
+
45
+ def dummy_fn(video):
46
+ return video
47
+
48
+ model = YOLO("yolov8n.pt") # or a face-specific checkpoint
49
+ results = model.predict("input_frame.jpg")[0]
50
+
51
+ # Filter only face (class 0 in COCO = 'person'; need a face-detection specific model if you want more precision)
52
+ faces = [b for b in results.boxes if b.cls == 0]
53
+
54
+ gr.Interface(fn=dummy_fn, inputs=gr.Video(source="webcam"), outputs="video").launch()kkkkkj
55
+
56
 
57
  ckpt = "ckpts/SEMamba_advanced.pth"
58
  cfg_f = "recipes/SEMamba_advanced.yaml"