1
1
{
2
- "nbformat" : 4 ,
3
- "nbformat_minor" : 0 ,
4
- "metadata" : {
5
- "accelerator" : " GPU" ,
6
- "colab" : {
7
- "name" : " pytti 5 beta.ipynb" ,
8
- "private_outputs" : true ,
9
- "provenance" : [],
10
- "collapsed_sections" : [],
11
- "toc_visible" : true
12
- },
13
- "kernelspec" : {
14
- "display_name" : " Python 3" ,
15
- "name" : " python3"
16
- },
17
- "language_info" : {
18
- "name" : " python"
19
- }
20
- },
21
2
"cells" : [
22
3
{
23
4
"cell_type" : " markdown" ,
38
19
},
39
20
{
40
21
"cell_type" : " code" ,
22
+ "execution_count" : null ,
41
23
"metadata" : {
42
- "id " : " Z0hRb20yxxsc " ,
43
- "cellView " : " form "
24
+ "cellView " : " form " ,
25
+ "id " : " Z0hRb20yxxsc "
44
26
},
27
+ "outputs" : [],
45
28
"source" : [
46
29
" # @title Licensed under the MIT License\n " ,
47
30
" # Copyleft (c) 2021 Henry Rachootin\n " ,
63
46
" # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n " ,
64
47
" # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\n " ,
65
48
" # THE SOFTWARE."
66
- ],
67
- "execution_count" : null ,
68
- "outputs" : []
49
+ ]
69
50
},
70
51
{
71
52
"cell_type" : " markdown" ,
292
273
},
293
274
{
294
275
"cell_type" : " code" ,
276
+ "execution_count" : null ,
295
277
"metadata" : {
296
278
"id" : " a9C9tARLzyzq"
297
279
},
280
+ "outputs" : [],
298
281
"source" : [
299
282
" #@title 1.1 Mount google drive (optional)\n " ,
300
283
" #@markdown Mounting your drive is optional but recommended. You can even restore from google randomly\n " ,
303
286
" drive.mount('/content/drive', force_remount = True)\n " ,
304
287
" !mkdir -p /content/drive/MyDrive/pytti_test\n " ,
305
288
" %cd /content/drive/MyDrive/pytti_test"
306
- ],
307
- "execution_count" : null ,
308
- "outputs" : []
289
+ ]
309
290
},
310
291
{
311
292
"cell_type" : " code" ,
293
+ "execution_count" : null ,
312
294
"metadata" : {
313
- "id " : " RosI5DYxtjh0 " ,
314
- "cellView " : " form "
295
+ "cellView " : " form " ,
296
+ "id " : " RosI5DYxtjh0 "
315
297
},
298
+ "outputs" : [],
316
299
"source" : [
317
300
" #@title 1.2 NVIDIA-SMI (optional)\n " ,
318
301
" #@markdown View information about your runtime GPU.\n " ,
326
309
" else:\n " ,
327
310
" !nvidia-smi\n " ,
328
311
" !nvidia-smi -i 0 -e 0"
329
- ],
330
- "execution_count" : null ,
331
- "outputs" : []
312
+ ]
332
313
},
333
314
{
334
315
"cell_type" : " code" ,
316
+ "execution_count" : null ,
335
317
"metadata" : {
336
- "id " : " CAGyDOe2o9AE " ,
337
- "cellView " : " form "
318
+ "cellView " : " form " ,
319
+ "id " : " CAGyDOe2o9AE "
338
320
},
321
+ "outputs" : [],
339
322
"source" : [
340
323
" #@title 1.3 Install everything else\n " ,
341
324
" #@markdown Run this cell on a fresh runtime to install the libraries and modules.\n " ,
362
345
" !git clone https://github.com/openai/CLIP.git &> /dev/null\n " ,
363
346
" !git clone https://github.com/CompVis/taming-transformers.git &> /dev/null\n " ,
364
347
" if not path_exists('./pytti'):\n " ,
365
- " !git clone --branch p5 https://github.com/sportsracer48 /pytti.git &> /dev/null\n " ,
348
+ " !git clone --branch p5 https://github.com/pytti-tools /pytti-core .git &> /dev/null\n " ,
366
349
" else:\n " ,
367
350
" !rm -r pytti\n " ,
368
- " !git clone --branch p5 https://github.com/sportsracer48 /pytti.git\n " ,
351
+ " !git clone --branch p5 https://github.com/pytti-tools /pytti-core .git\n " ,
369
352
" !git clone https://github.com/shariqfarooq123/AdaBins.git &> /dev/null\n " ,
370
353
" !git clone https://github.com/zacjiang/GMA.git &> /dev/null\n " ,
371
354
" !mkdir -p AdaBins/pretrained\n " ,
386
369
" elif everything_installed:\n " ,
387
370
" from pytti.Notebook import change_tqdm_color\n " ,
388
371
" change_tqdm_color()"
389
- ],
390
- "execution_count" : null ,
391
- "outputs" : []
372
+ ]
392
373
},
393
374
{
394
375
"cell_type" : " markdown" ,
402
383
},
403
384
{
404
385
"cell_type" : " code" ,
386
+ "execution_count" : null ,
405
387
"metadata" : {
406
- "id " : " TiKD7os1pyXW " ,
407
- "cellView " : " form "
388
+ "cellView " : " form " ,
389
+ "id " : " TiKD7os1pyXW "
408
390
},
391
+ "outputs" : [],
409
392
"source" : [
410
393
" #@title #2.1 Parameters:\n " ,
411
394
" #@markdown ---\n " ,
610
593
" params = Bunch(define_parameters())\n " ,
611
594
" print(\" SETTINGS:\" )\n " ,
612
595
" print(json.dumps(params))"
613
- ],
614
- "execution_count" : null ,
615
- "outputs" : []
596
+ ]
616
597
},
617
598
{
618
599
"cell_type" : " code" ,
600
+ "execution_count" : null ,
619
601
"metadata" : {
620
- "id " : " lWlZ2Gocb2fF " ,
621
- "cellView " : " form "
602
+ "cellView " : " form " ,
603
+ "id " : " lWlZ2Gocb2fF "
622
604
},
605
+ "outputs" : [],
623
606
"source" : [
624
607
" #@title 2.2 Load settings (optional)\n " ,
625
608
" #@markdown copy the `SETTINGS:` output from the **Parameters** cell (tripple click to select the whole\n " ,
664
647
" \n " ,
665
648
" if settings != '':\n " ,
666
649
" params = load_settings(settings, random_seed)"
667
- ],
668
- "execution_count" : null ,
669
- "outputs" : []
650
+ ]
670
651
},
671
652
{
672
653
"cell_type" : " code" ,
654
+ "execution_count" : null ,
673
655
"metadata" : {
674
- "id " : " hqJ6vY2z3rR8 " ,
675
- "cellView " : " form "
656
+ "cellView " : " form " ,
657
+ "id " : " hqJ6vY2z3rR8 "
676
658
},
659
+ "outputs" : [],
677
660
"source" : [
678
661
" #@title 2.3 Run it!\n " ,
679
662
" #@markdown pytti is 1000% percent better code than VQLIPSE, so have a look at the code. \n " ,
1135
1118
" raise\n " ,
1136
1119
" \n " ,
1137
1120
" #print(prof.key_averages().table(sort_by=\" cuda_time_total\" , row_limit=10))"
1138
- ],
1139
- "execution_count" : null ,
1140
- "outputs" : []
1121
+ ]
1141
1122
},
1142
1123
{
1143
1124
"cell_type" : " markdown" ,
1151
1132
},
1152
1133
{
1153
1134
"cell_type" : " code" ,
1135
+ "execution_count" : null ,
1154
1136
"metadata" : {
1155
- "id " : " RZH-r4yyShnX " ,
1156
- "cellView " : " form "
1137
+ "cellView " : " form " ,
1138
+ "id " : " RZH-r4yyShnX "
1157
1139
},
1140
+ "outputs" : [],
1158
1141
"source" : [
1159
1142
" #@title 3.1 Render video\n " ,
1160
1143
" from os.path import exists as path_exists\n " ,
1242
1225
" print(\" Encoding video...\" )\n " ,
1243
1226
" p.wait()\n " ,
1244
1227
" print(\" Video complete.\" )"
1245
- ],
1246
- "execution_count" : null ,
1247
- "outputs" : []
1228
+ ]
1248
1229
},
1249
1230
{
1250
1231
"cell_type" : " code" ,
1232
+ "execution_count" : null ,
1251
1233
"metadata" : {
1252
- "id " : " t3EgqHKrSjZx " ,
1253
- "cellView " : " form "
1234
+ "cellView " : " form " ,
1235
+ "id " : " t3EgqHKrSjZx "
1254
1236
},
1237
+ "outputs" : [],
1255
1238
"source" : [
1256
1239
" #@title 3.1 Render video (concatenate all runs)\n " ,
1257
1240
" from os.path import exists as path_exists\n " ,
1336
1319
" print(\" Encoding video...\" )\n " ,
1337
1320
" p.wait()\n " ,
1338
1321
" print(\" Video complete.\" )"
1339
- ],
1340
- "execution_count" : null ,
1341
- "outputs" : []
1322
+ ]
1342
1323
},
1343
1324
{
1344
1325
"cell_type" : " code" ,
1326
+ "execution_count" : null ,
1345
1327
"metadata" : {
1346
- "id " : " -qZ8c_-iZ0QM " ,
1347
- "cellView " : " form "
1328
+ "cellView " : " form " ,
1329
+ "id " : " -qZ8c_-iZ0QM "
1348
1330
},
1331
+ "outputs" : [],
1349
1332
"source" : [
1350
1333
" #@title 3.2 Download the last exported video\n " ,
1351
1334
" from os.path import exists as path_exists\n " ,
1390
1373
" #THIS IS NOT AN ERROR. This is the code that would\n " ,
1391
1374
" #make an error if something were wrong.\n " ,
1392
1375
" raise RuntimeError(f\" WARNING: Drive is not mounted.\\ nERROR: video videos/{filename} does not exist.\" )"
1393
- ],
1394
- "execution_count" : null ,
1395
- "outputs" : []
1376
+ ]
1396
1377
},
1397
1378
{
1398
1379
"cell_type" : " markdown" ,
1406
1387
},
1407
1388
{
1408
1389
"cell_type" : " code" ,
1390
+ "execution_count" : null ,
1409
1391
"metadata" : {
1410
- "id " : " vHHfWWqoSz35 " ,
1411
- "cellView " : " form "
1392
+ "cellView " : " form " ,
1393
+ "id " : " vHHfWWqoSz35 "
1412
1394
},
1395
+ "outputs" : [],
1413
1396
"source" : [
1414
1397
" #@title batch settings\n " ,
1415
1398
" from os.path import exists as path_exists\n " ,
1530
1513
" namespace = batch_list[0]['file_namespace']\n " ,
1531
1514
" if glob.glob(f'images_out/{namespace}/*.png'):\n " ,
1532
1515
" print(f\" WARNING: images_out/{namespace} contains images. Batch indicies may not match filenames unless restoring.\" )"
1533
- ],
1534
- "execution_count" : null ,
1535
- "outputs" : []
1516
+ ]
1517
+ }
1518
+ ],
1519
+ "metadata" : {
1520
+ "accelerator" : " GPU" ,
1521
+ "colab" : {
1522
+ "collapsed_sections" : [],
1523
+ "name" : " pytti 5 beta.ipynb" ,
1524
+ "private_outputs" : true ,
1525
+ "provenance" : [],
1526
+ "toc_visible" : true
1527
+ },
1528
+ "kernelspec" : {
1529
+ "display_name" : " Python 3" ,
1530
+ "name" : " python3"
1531
+ },
1532
+ "language_info" : {
1533
+ "name" : " python"
1536
1534
}
1537
- ]
1538
- }
1535
+ },
1536
+ "nbformat" : 4 ,
1537
+ "nbformat_minor" : 0
1538
+ }
0 commit comments