|
3 | 3 | {
|
4 | 4 | "cell_type": "code",
|
5 | 5 | "execution_count": 1,
|
6 |
| - "id": "lightweight-atlas", |
| 6 | + "id": "cellular-michael", |
7 | 7 | "metadata": {},
|
8 | 8 | "outputs": [
|
9 | 9 | {
|
|
20 | 20 | "import torch\n",
|
21 | 21 | "import time\n",
|
22 | 22 | "\n",
|
23 |
| - "from utils.image_processing import crop_face\n", |
24 |
| - "from utils.video_processing import read_video, get_final_video_frame, add_audio_from_another_video\n", |
25 |
| - "from utils.core import model_inference\n", |
| 23 | + "from utils.inference.image_processing import crop_face\n", |
| 24 | + "from utils.inference.video_processing import read_video, get_final_video_frame, add_audio_from_another_video\n", |
| 25 | + "from utils.inference.core import model_inference\n", |
26 | 26 | "\n",
|
27 | 27 | "from network.AEI_Net import AEI_Net\n",
|
28 | 28 | "from coordinate_reg.image_infer import Handler\n",
|
|
32 | 32 | },
|
33 | 33 | {
|
34 | 34 | "cell_type": "markdown",
|
35 |
| - "id": "typical-herald", |
| 35 | + "id": "equipped-exploration", |
36 | 36 | "metadata": {},
|
37 | 37 | "source": [
|
38 | 38 | "### Load Models"
|
|
41 | 41 | {
|
42 | 42 | "cell_type": "code",
|
43 | 43 | "execution_count": null,
|
44 |
| - "id": "documentary-hudson", |
| 44 | + "id": "overall-request", |
45 | 45 | "metadata": {},
|
46 |
| - "outputs": [ |
47 |
| - { |
48 |
| - "name": "stderr", |
49 |
| - "output_type": "stream", |
50 |
| - "text": [ |
51 |
| - "/home/jovyan/.local/lib/python3.8/site-packages/ipykernel/ipkernel.py:283: DeprecationWarning: `should_run_async` will not call `transform_cell` automatically in the future. Please pass the result to `transformed_cell` argument and any exception that happen during thetransform in `preprocessing_exc_tuple` in IPython 7.17 and above.\n", |
52 |
| - " and should_run_async(code)\n" |
53 |
| - ] |
54 |
| - }, |
55 |
| - { |
56 |
| - "name": "stdout", |
57 |
| - "output_type": "stream", |
58 |
| - "text": [ |
59 |
| - "input mean and std: 127.5 127.5\n", |
60 |
| - "find model: ./insightface_func/models/antelope/glintr100.onnx recognition\n", |
61 |
| - "find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection\n", |
62 |
| - "set det-size: (640, 640)\n", |
63 |
| - "loading ./coordinate_reg/model/2d106det 0\n", |
64 |
| - "input mean and std: 127.5 127.5\n", |
65 |
| - "find model: ./insightface_func/models/antelope/glintr100.onnx recognition\n", |
66 |
| - "find model: ./insightface_func/models/antelope/scrfd_10g_bnkps.onnx detection\n", |
67 |
| - "set det-size: (640, 640)\n" |
68 |
| - ] |
69 |
| - } |
70 |
| - ], |
| 46 | + "outputs": [], |
71 | 47 | "source": [
|
72 | 48 | "app = Face_detect_crop(name='antelope', root='./insightface_func/models')\n",
|
73 | 49 | "app.prepare(ctx_id= 0, det_thresh=0.6, det_size=(640,640))\n",
|
|
91 | 67 | },
|
92 | 68 | {
|
93 | 69 | "cell_type": "markdown",
|
94 |
| - "id": "functioning-impact", |
| 70 | + "id": "outdoor-consensus", |
95 | 71 | "metadata": {},
|
96 | 72 | "source": [
|
97 | 73 | "### Set here path to source image and video for faceswap"
|
|
100 | 76 | {
|
101 | 77 | "cell_type": "code",
|
102 | 78 | "execution_count": null,
|
103 |
| - "id": "other-martial", |
| 79 | + "id": "major-employment", |
104 | 80 | "metadata": {},
|
105 | 81 | "outputs": [],
|
106 | 82 | "source": [
|
|
118 | 94 | {
|
119 | 95 | "cell_type": "code",
|
120 | 96 | "execution_count": null,
|
121 |
| - "id": "multiple-redhead", |
| 97 | + "id": "adult-forth", |
122 | 98 | "metadata": {},
|
123 | 99 | "outputs": [],
|
124 | 100 | "source": [
|
|
135 | 111 | {
|
136 | 112 | "cell_type": "code",
|
137 | 113 | "execution_count": null,
|
138 |
| - "id": "mathematical-chapter", |
| 114 | + "id": "under-maryland", |
139 | 115 | "metadata": {},
|
140 | 116 | "outputs": [],
|
141 | 117 | "source": [
|
|
146 | 122 | },
|
147 | 123 | {
|
148 | 124 | "cell_type": "markdown",
|
149 |
| - "id": "independent-immune", |
| 125 | + "id": "productive-prisoner", |
150 | 126 | "metadata": {},
|
151 | 127 | "source": [
|
152 | 128 | "### Model Inference"
|
|
155 | 131 | {
|
156 | 132 | "cell_type": "code",
|
157 | 133 | "execution_count": null,
|
158 |
| - "id": "affiliated-reading", |
| 134 | + "id": "fourth-procurement", |
159 | 135 | "metadata": {},
|
160 | 136 | "outputs": [],
|
161 | 137 | "source": [
|
|
165 | 141 | {
|
166 | 142 | "cell_type": "code",
|
167 | 143 | "execution_count": null,
|
168 |
| - "id": "outstanding-multiple", |
| 144 | + "id": "acceptable-liberal", |
169 | 145 | "metadata": {},
|
170 | 146 | "outputs": [],
|
171 | 147 | "source": [
|
|
180 | 156 | {
|
181 | 157 | "cell_type": "code",
|
182 | 158 | "execution_count": null,
|
183 |
| - "id": "rising-requirement", |
| 159 | + "id": "olympic-shaft", |
184 | 160 | "metadata": {},
|
185 | 161 | "outputs": [],
|
186 | 162 | "source": [
|
|
196 | 172 | {
|
197 | 173 | "cell_type": "code",
|
198 | 174 | "execution_count": null,
|
199 |
| - "id": "wired-plane", |
| 175 | + "id": "double-oxide", |
200 | 176 | "metadata": {},
|
201 | 177 | "outputs": [],
|
202 | 178 | "source": [
|
|
206 | 182 | {
|
207 | 183 | "cell_type": "code",
|
208 | 184 | "execution_count": null,
|
209 |
| - "id": "continuous-glossary", |
| 185 | + "id": "voluntary-marketing", |
210 | 186 | "metadata": {},
|
211 | 187 | "outputs": [],
|
212 | 188 | "source": [
|
|
217 | 193 | {
|
218 | 194 | "cell_type": "code",
|
219 | 195 | "execution_count": null,
|
220 |
| - "id": "tough-reply", |
| 196 | + "id": "american-costs", |
221 | 197 | "metadata": {},
|
222 | 198 | "outputs": [],
|
223 | 199 | "source": []
|
224 | 200 | },
|
225 | 201 | {
|
226 | 202 | "cell_type": "code",
|
227 | 203 | "execution_count": null,
|
228 |
| - "id": "experimental-lexington", |
| 204 | + "id": "framed-breeding", |
229 | 205 | "metadata": {},
|
230 | 206 | "outputs": [],
|
231 | 207 | "source": []
|
232 | 208 | },
|
233 | 209 | {
|
234 | 210 | "cell_type": "code",
|
235 | 211 | "execution_count": null,
|
236 |
| - "id": "usual-bhutan", |
| 212 | + "id": "applied-laundry", |
237 | 213 | "metadata": {},
|
238 | 214 | "outputs": [],
|
239 | 215 | "source": []
|
240 | 216 | },
|
241 | 217 | {
|
242 | 218 | "cell_type": "code",
|
243 | 219 | "execution_count": null,
|
244 |
| - "id": "coastal-cleveland", |
| 220 | + "id": "detected-limitation", |
245 | 221 | "metadata": {},
|
246 | 222 | "outputs": [],
|
247 | 223 | "source": []
|
248 | 224 | },
|
249 | 225 | {
|
250 | 226 | "cell_type": "code",
|
251 | 227 | "execution_count": null,
|
252 |
| - "id": "transsexual-johnson", |
| 228 | + "id": "saved-darkness", |
253 | 229 | "metadata": {},
|
254 | 230 | "outputs": [],
|
255 | 231 | "source": []
|
256 | 232 | }
|
257 | 233 | ],
|
258 | 234 | "metadata": {
|
259 | 235 | "kernelspec": {
|
260 |
| - "display_name": "facesh", |
| 236 | + "display_name": "fs_env", |
261 | 237 | "language": "python",
|
262 |
| - "name": "facesh" |
| 238 | + "name": "fs_env" |
263 | 239 | },
|
264 | 240 | "language_info": {
|
265 | 241 | "codemirror_mode": {
|
|
0 commit comments