Skip to content

Commit ea7425f

Browse files
committed
Colaboratory를 통해 생성됨
1 parent 6ee9ed9 commit ea7425f

File tree

1 file changed

+395
-0
lines changed

1 file changed

+395
-0
lines changed

TRTinColab.ipynb

Lines changed: 395 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,395 @@
1+
{
2+
"nbformat": 4,
3+
"nbformat_minor": 0,
4+
"metadata": {
5+
"colab": {
6+
"name": "TRTinColab.ipynb",
7+
"private_outputs": true,
8+
"provenance": [],
9+
"collapsed_sections": [],
10+
"mount_file_id": "1rIWZVpZAm5qIWSkbZLIomGhnOyprBBC6",
11+
"authorship_tag": "ABX9TyMB6/8rKxLqzjptysbyo46n",
12+
"include_colab_link": true
13+
},
14+
"kernelspec": {
15+
"name": "python3",
16+
"display_name": "Python 3"
17+
},
18+
"language_info": {
19+
"name": "python"
20+
},
21+
"accelerator": "GPU"
22+
},
23+
"cells": [
24+
{
25+
"cell_type": "markdown",
26+
"metadata": {
27+
"id": "view-in-github",
28+
"colab_type": "text"
29+
},
30+
"source": [
31+
"<a href=\"https://colab.research.google.com/github/yester31/CPP_Codeing_Test/blob/main/TRTinColab.ipynb\" target=\"_parent\"><img src=\"https://colab.research.google.com/assets/colab-badge.svg\" alt=\"Open In Colab\"/></a>"
32+
]
33+
},
34+
{
35+
"cell_type": "markdown",
36+
"source": [
37+
"Nvidia driver check"
38+
],
39+
"metadata": {
40+
"id": "QCqwuAgil1gV"
41+
}
42+
},
43+
{
44+
"cell_type": "code",
45+
"execution_count": null,
46+
"metadata": {
47+
"id": "8m65ZVqTjw6s"
48+
},
49+
"outputs": [],
50+
"source": [
51+
"!nvidia-smi "
52+
]
53+
},
54+
{
55+
"cell_type": "markdown",
56+
"source": [
57+
"CUDA version check"
58+
],
59+
"metadata": {
60+
"id": "pyK8oNmlnmdz"
61+
}
62+
},
63+
{
64+
"cell_type": "code",
65+
"source": [
66+
"!nvcc -V"
67+
],
68+
"metadata": {
69+
"id": "n55Ctnyakgmc"
70+
},
71+
"execution_count": null,
72+
"outputs": []
73+
},
74+
{
75+
"cell_type": "markdown",
76+
"source": [
77+
"OS version check"
78+
],
79+
"metadata": {
80+
"id": "wBTmvrnDmAMZ"
81+
}
82+
},
83+
{
84+
"cell_type": "code",
85+
"source": [
86+
"!cat /etc/os-release"
87+
],
88+
"metadata": {
89+
"id": "gZ3XbfVAlt79"
90+
},
91+
"execution_count": null,
92+
"outputs": []
93+
},
94+
{
95+
"cell_type": "code",
96+
"source": [
97+
"%%bash\n",
98+
"dpkg -i nvidia-machine-learning-repo-*.deb\n",
99+
"apt-get update"
100+
],
101+
"metadata": {
102+
"id": "sSN8p-aPmDKR"
103+
},
104+
"execution_count": null,
105+
"outputs": []
106+
},
107+
{
108+
"cell_type": "code",
109+
"source": [
110+
"# check TensorRT version\n",
111+
"print(\"TensorRT version: \")\n",
112+
"!dpkg -l | grep nvinfer"
113+
],
114+
"metadata": {
115+
"id": "M3JwY_32k6eS"
116+
},
117+
"execution_count": null,
118+
"outputs": []
119+
},
120+
{
121+
"cell_type": "markdown",
122+
"source": [
123+
"**TensorRT TEST**"
124+
],
125+
"metadata": {
126+
"id": "pYQ2spVesohR"
127+
}
128+
},
129+
{
130+
"cell_type": "code",
131+
"source": [
132+
"!git clone https://github.com/yester31/Real_ESRGAN_TRT.git"
133+
],
134+
"metadata": {
135+
"id": "9YrGwK7Co7Dk"
136+
},
137+
"execution_count": null,
138+
"outputs": []
139+
},
140+
{
141+
"cell_type": "code",
142+
"source": [
143+
"!git clone https://github.com/xinntao/Real-ESRGAN.git"
144+
],
145+
"metadata": {
146+
"id": "cUU9FwS-pEBQ"
147+
},
148+
"execution_count": null,
149+
"outputs": []
150+
},
151+
{
152+
"cell_type": "code",
153+
"source": [
154+
"cd content/Real-ESRGAN/"
155+
],
156+
"metadata": {
157+
"id": "55wxpZq1pepy"
158+
},
159+
"execution_count": null,
160+
"outputs": []
161+
},
162+
{
163+
"cell_type": "code",
164+
"source": [
165+
""
166+
],
167+
"metadata": {
168+
"id": "OywvCo-nssuD"
169+
},
170+
"execution_count": null,
171+
"outputs": []
172+
},
173+
{
174+
"cell_type": "code",
175+
"source": [
176+
"!pip install basicsr\n",
177+
"!pip install facexlib\n",
178+
"!pip install gfpgan\n",
179+
"!pip install -r requirements.txt"
180+
],
181+
"metadata": {
182+
"id": "sV8vhR17qLbs"
183+
},
184+
"execution_count": null,
185+
"outputs": []
186+
},
187+
{
188+
"cell_type": "code",
189+
"source": [
190+
"!python setup.py develop"
191+
],
192+
"metadata": {
193+
"id": "0a80_sD9qM4-"
194+
},
195+
"execution_count": null,
196+
"outputs": []
197+
},
198+
{
199+
"cell_type": "markdown",
200+
"source": [
201+
""
202+
],
203+
"metadata": {
204+
"id": "XSDbPjdhshj1"
205+
}
206+
},
207+
{
208+
"cell_type": "code",
209+
"source": [
210+
"!wget https://github.com/xinntao/Real-ESRGAN/releases/download/v0.1.0/RealESRGAN_x4plus.pth"
211+
],
212+
"metadata": {
213+
"id": "Io5KBnFxqog7"
214+
},
215+
"execution_count": null,
216+
"outputs": []
217+
},
218+
{
219+
"cell_type": "code",
220+
"source": [
221+
"cp RealESRGAN_x4plus.pth experiments/pretrained_models"
222+
],
223+
"metadata": {
224+
"id": "tipypfhqq71Q"
225+
},
226+
"execution_count": null,
227+
"outputs": []
228+
},
229+
{
230+
"cell_type": "code",
231+
"source": [
232+
"cd experiments"
233+
],
234+
"metadata": {
235+
"id": "Fo68xyXZrHmd"
236+
},
237+
"execution_count": null,
238+
"outputs": []
239+
},
240+
{
241+
"cell_type": "code",
242+
"source": [
243+
"ls"
244+
],
245+
"metadata": {
246+
"id": "rJTOCjUsrKFk"
247+
},
248+
"execution_count": null,
249+
"outputs": []
250+
},
251+
{
252+
"cell_type": "code",
253+
"source": [
254+
"cd /content"
255+
],
256+
"metadata": {
257+
"id": "7hIw4v3BrNa4"
258+
},
259+
"execution_count": null,
260+
"outputs": []
261+
},
262+
{
263+
"cell_type": "code",
264+
"source": [
265+
"cp Real_ESRGAN_TRT/gen_wts.py Real-ESRGAN"
266+
],
267+
"metadata": {
268+
"id": "YVmVWPz9rhxr"
269+
},
270+
"execution_count": null,
271+
"outputs": []
272+
},
273+
{
274+
"cell_type": "code",
275+
"source": [
276+
"cd Real-ESRGAN"
277+
],
278+
"metadata": {
279+
"id": "bn2n1gjfr6ud"
280+
},
281+
"execution_count": null,
282+
"outputs": []
283+
},
284+
{
285+
"cell_type": "code",
286+
"source": [
287+
"ls"
288+
],
289+
"metadata": {
290+
"id": "jfF6zIMlr-dN"
291+
},
292+
"execution_count": null,
293+
"outputs": []
294+
},
295+
{
296+
"cell_type": "code",
297+
"source": [
298+
"!python gen_wts.py"
299+
],
300+
"metadata": {
301+
"id": "0uK_YudCsT9B"
302+
},
303+
"execution_count": null,
304+
"outputs": []
305+
},
306+
{
307+
"cell_type": "code",
308+
"source": [
309+
"ls"
310+
],
311+
"metadata": {
312+
"id": "DZAm4cx1sw0A"
313+
},
314+
"execution_count": null,
315+
"outputs": []
316+
},
317+
{
318+
"cell_type": "code",
319+
"source": [
320+
"cd ../Real_ESRGAN_TRT"
321+
],
322+
"metadata": {
323+
"id": "St4uyg5Ps09m"
324+
},
325+
"execution_count": null,
326+
"outputs": []
327+
},
328+
{
329+
"cell_type": "code",
330+
"source": [
331+
"mkdir build"
332+
],
333+
"metadata": {
334+
"id": "2nXpvlqHtBYd"
335+
},
336+
"execution_count": null,
337+
"outputs": []
338+
},
339+
{
340+
"cell_type": "code",
341+
"source": [
342+
"cd build"
343+
],
344+
"metadata": {
345+
"id": "doGJ_dwptE9X"
346+
},
347+
"execution_count": null,
348+
"outputs": []
349+
},
350+
{
351+
"cell_type": "code",
352+
"source": [
353+
"cp ../../Real-ESRGAN/real-esrgan.wts ."
354+
],
355+
"metadata": {
356+
"id": "hc4qOU4gtI3R"
357+
},
358+
"execution_count": null,
359+
"outputs": []
360+
},
361+
{
362+
"cell_type": "code",
363+
"source": [
364+
"ls"
365+
],
366+
"metadata": {
367+
"id": "w1SkuMjtte4W"
368+
},
369+
"execution_count": null,
370+
"outputs": []
371+
},
372+
{
373+
"cell_type": "code",
374+
"source": [
375+
"!cmake .."
376+
],
377+
"metadata": {
378+
"id": "DRBVvf0ytglL"
379+
},
380+
"execution_count": null,
381+
"outputs": []
382+
},
383+
{
384+
"cell_type": "code",
385+
"source": [
386+
"!make"
387+
],
388+
"metadata": {
389+
"id": "kqVdTmcGtmCA"
390+
},
391+
"execution_count": null,
392+
"outputs": []
393+
}
394+
]
395+
}

0 commit comments

Comments
 (0)