Rasta02 commited on
Commit
52125d1
·
verified ·
1 Parent(s): 51d5e7a

Upload google_colabs/Video_Subtitle_Remover_Gradio.ipynb with huggingface_hub

Browse files
google_colabs/Video_Subtitle_Remover_Gradio.ipynb CHANGED
@@ -36,7 +36,8 @@
36
  "metadata": {},
37
  "outputs": [],
38
  "source": [
39
- "!nvidia-smi"
 
40
  ]
41
  },
42
  {
@@ -52,8 +53,39 @@
52
  "metadata": {},
53
  "outputs": [],
54
  "source": [
55
- "!git clone https://huggingface.co/Rasta02/dataku\n",
56
- "%cd dataku"
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
57
  ]
58
  },
59
  {
@@ -69,19 +101,21 @@
69
  "metadata": {},
70
  "outputs": [],
71
  "source": [
72
- "# Core dependencies\n",
73
- "!pip install -q filesplit==3.0.2 albumentations scikit-image imgaug pyclipper lmdb\n",
74
- "!pip install -q PyYAML omegaconf tqdm easydict scikit-learn pandas webdataset\n",
75
- "!pip install -q protobuf av einops paddleocr paddle2onnx onnxruntime-gpu\n",
76
- "!pip install -q paddlepaddle-gpu==2.6.2\n",
77
  "\n",
78
- "# Gradio for web interface\n",
79
- "!pip install -q gradio\n",
 
80
  "\n",
81
- "# Advanced models (optional - uncomment if using SD or DiffuEraser)\n",
82
- "!pip install -q diffusers transformers accelerate\n",
83
  "\n",
84
- "print(\"\u2713 All dependencies installed!\")"
 
 
 
85
  ]
86
  },
87
  {
@@ -101,18 +135,12 @@
101
  "metadata": {},
102
  "outputs": [],
103
  "source": [
104
- "# Launch Gradio interface\n",
105
  "import sys\n",
106
- "import os\n",
107
- "\n",
108
- "# Add paths\n",
109
- "sys.path.insert(0, '/content/dataku')\n",
110
- "sys.path.insert(0, '/content/dataku/backend')\n",
111
- "\n",
112
- "# Change to google_colabs directory to import gradio_app\n",
113
- "os.chdir('/content/dataku/google_colabs')\n",
114
  "\n",
115
- "from gradio_app import create_interface\n",
 
116
  "\n",
117
  "demo = create_interface()\n",
118
  "demo.launch(share=True, debug=True)"
 
36
  "metadata": {},
37
  "outputs": [],
38
  "source": [
39
+ "!git clone https://github.com/YaoFANGUK/video-subtitle-remover.git\n",
40
+ "%cd video-subtitle-remover"
41
  ]
42
  },
43
  {
 
53
  "metadata": {},
54
  "outputs": [],
55
  "source": [
56
+ "# Core dependencies\n",
57
+ "!pip install -q filesplit==3.0.2 albumentations scikit-image imgaug pyclipper lmdb\n",
58
+ "!pip install -q PyYAML omegaconf tqdm easydict scikit-learn pandas webdataset\n",
59
+ "!pip install -q protobuf av einops paddleocr paddle2onnx onnxruntime-gpu\n",
60
+ "!pip install -q paddlepaddle-gpu==2.6.2\n",
61
+ "\n",
62
+ "# Gradio for web interface\n",
63
+ "!pip install -q gradio\n",
64
+ "\n",
65
+ "# Advanced models (optional - uncomment if using SD or DiffuEraser)\n",
66
+ "!pip install -q diffusers transformers accelerate\n",
67
+ "\n",
68
+ "print(\"\u2713 All dependencies installed!\")"
69
+ ]
70
+ },
71
+ {
72
+ "cell_type": "markdown",
73
+ "metadata": {},
74
+ "source": [
75
+ "## Step 3.5: Download Custom Gradio App\n",
76
+ "\n",
77
+ "Download the enhanced gradio_app.py with subtitle extraction feature."
78
+ ]
79
+ },
80
+ {
81
+ "cell_type": "code",
82
+ "execution_count": null,
83
+ "metadata": {},
84
+ "outputs": [],
85
+ "source": [
86
+ "# Download custom gradio_app.py from Gist\n",
87
+ "!wget -q https://gist.githubusercontent.com/walidurrosyad/9c838a9f1a40c4f0b77cf885a59aff31/raw/gradio_app.py -O google_colabs/gradio_app.py\n",
88
+ "print(\"\u2713 Custom Gradio app downloaded!\")"
89
  ]
90
  },
91
  {
 
101
  "metadata": {},
102
  "outputs": [],
103
  "source": [
104
+ "# Launch Gradio interface\n",
105
+ "import sys\n",
106
+ "import os\n",
 
 
107
  "\n",
108
+ "# Add paths\n",
109
+ "sys.path.insert(0, '/content/video-subtitle-remover')\n",
110
+ "sys.path.insert(0, '/content/video-subtitle-remover/backend')\n",
111
  "\n",
112
+ "# Change to google_colabs directory to import gradio_app\n",
113
+ "os.chdir('/content/video-subtitle-remover/google_colabs')\n",
114
  "\n",
115
+ "from gradio_app import create_interface\n",
116
+ "\n",
117
+ "demo = create_interface()\n",
118
+ "demo.launch(share=True, debug=True)"
119
  ]
120
  },
121
  {
 
135
  "metadata": {},
136
  "outputs": [],
137
  "source": [
 
138
  "import sys\n",
139
+ "sys.path.insert(0, '/content/video-subtitle-remover')\n",
140
+ "sys.path.insert(0, '/content/video-subtitle-remover/backend')\n",
 
 
 
 
 
 
141
  "\n",
142
+ "# Import and run\n",
143
+ "from google_colabs.gradio_app import create_interface\n",
144
  "\n",
145
  "demo = create_interface()\n",
146
  "demo.launch(share=True, debug=True)"