File size: 72,306 Bytes
f6c4e37
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": []
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU",
    "gpuClass": "standard"
  },
  "cells": [
    {
      "cell_type": "markdown",
      "source": [
        "# Simple HigherHRNet\n",
        "This is a light Google Colab notebook showing how to use the [simple-HigherHRNet](https://github.com/stefanopini/simple-HigherHRNet) repository.\n",
        "\n",
        "It includes the conversion to TensorRT and a test of the converted model.\n",
        "Please skip the section \"TensorRT\" if not interested."
      ],
      "metadata": {
        "id": "xZqqnmmNfX1d"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "## Pytorch"
      ],
      "metadata": {
        "id": "ZFihjwzqhA04"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Clone the repo and install the dependencies"
      ],
      "metadata": {
        "id": "X_ugGAxdd6Hu"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# clone the repo\n",
        "!git clone https://github.com/stefanopini/simple-HigherHRNet.git"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "FIecXpzEY7IJ",
        "outputId": "51ddb584-9a9f-4f36-ecca-9d6ff9f1bf4a"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Cloning into 'simple-HigherHRNet'...\n",
            "remote: Enumerating objects: 120, done.\u001b[K\n",
            "remote: Counting objects: 100% (120/120), done.\u001b[K\n",
            "remote: Compressing objects: 100% (87/87), done.\u001b[K\n",
            "remote: Total 120 (delta 47), reused 88 (delta 28), pack-reused 0\u001b[K\n",
            "Receiving objects: 100% (120/120), 15.57 MiB | 8.21 MiB/s, done.\n",
            "Resolving deltas: 100% (47/47), done.\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "%cd simple-HigherHRNet\n",
        "!pwd"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "JDNRl8a8dl7Z",
        "outputId": "36e6d64a-ea0b-416d-8a16-f635eb67d0f2"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "/content/simple-HigherHRNet\n",
            "/content/simple-HigherHRNet\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# install requirements\n",
        "!pip install -r requirements.txt"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "FGsHqGPNdbHt",
        "outputId": "52f6c2d1-62d5-4126-8682-9bbbc5531e36"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
            "Requirement already satisfied: ffmpeg-python>=0.2.0 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 1)) (0.2.0)\n",
            "Requirement already satisfied: matplotlib>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 2)) (3.2.2)\n",
            "Requirement already satisfied: munkres>=1.1.2 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 3)) (1.1.4)\n",
            "Requirement already satisfied: numpy>=1.16 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 4)) (1.21.6)\n",
            "Requirement already satisfied: opencv-python>=3.4 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 5)) (4.6.0.66)\n",
            "Requirement already satisfied: Pillow>=5.4 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 6)) (7.1.2)\n",
            "Requirement already satisfied: vidgear>=0.1.4 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 7)) (0.2.6)\n",
            "Requirement already satisfied: torch>=1.4.0 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 8)) (1.12.1+cu113)\n",
            "Requirement already satisfied: torchvision>=0.5.0 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 9)) (0.13.1+cu113)\n",
            "Requirement already satisfied: tqdm>=4.26 in /usr/local/lib/python3.7/dist-packages (from -r requirements.txt (line 10)) (4.64.1)\n",
            "Requirement already satisfied: future in /usr/local/lib/python3.7/dist-packages (from ffmpeg-python>=0.2.0->-r requirements.txt (line 1)) (0.16.0)\n",
            "Requirement already satisfied: python-dateutil>=2.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=3.0.2->-r requirements.txt (line 2)) (2.8.2)\n",
            "Requirement already satisfied: pyparsing!=2.0.4,!=2.1.2,!=2.1.6,>=2.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=3.0.2->-r requirements.txt (line 2)) (3.0.9)\n",
            "Requirement already satisfied: kiwisolver>=1.0.1 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=3.0.2->-r requirements.txt (line 2)) (1.4.4)\n",
            "Requirement already satisfied: cycler>=0.10 in /usr/local/lib/python3.7/dist-packages (from matplotlib>=3.0.2->-r requirements.txt (line 2)) (0.11.0)\n",
            "Requirement already satisfied: requests in /usr/local/lib/python3.7/dist-packages (from vidgear>=0.1.4->-r requirements.txt (line 7)) (2.23.0)\n",
            "Requirement already satisfied: cython in /usr/local/lib/python3.7/dist-packages (from vidgear>=0.1.4->-r requirements.txt (line 7)) (0.29.32)\n",
            "Requirement already satisfied: colorlog in /usr/local/lib/python3.7/dist-packages (from vidgear>=0.1.4->-r requirements.txt (line 7)) (6.7.0)\n",
            "Requirement already satisfied: typing-extensions in /usr/local/lib/python3.7/dist-packages (from torch>=1.4.0->-r requirements.txt (line 8)) (4.1.1)\n",
            "Requirement already satisfied: six>=1.5 in /usr/local/lib/python3.7/dist-packages (from python-dateutil>=2.1->matplotlib>=3.0.2->-r requirements.txt (line 2)) (1.15.0)\n",
            "Requirement already satisfied: idna<3,>=2.5 in /usr/local/lib/python3.7/dist-packages (from requests->vidgear>=0.1.4->-r requirements.txt (line 7)) (2.10)\n",
            "Requirement already satisfied: urllib3!=1.25.0,!=1.25.1,<1.26,>=1.21.1 in /usr/local/lib/python3.7/dist-packages (from requests->vidgear>=0.1.4->-r requirements.txt (line 7)) (1.24.3)\n",
            "Requirement already satisfied: chardet<4,>=3.0.2 in /usr/local/lib/python3.7/dist-packages (from requests->vidgear>=0.1.4->-r requirements.txt (line 7)) (3.0.4)\n",
            "Requirement already satisfied: certifi>=2017.4.17 in /usr/local/lib/python3.7/dist-packages (from requests->vidgear>=0.1.4->-r requirements.txt (line 7)) (2022.9.24)\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# install vlc to get video codecs\n",
        "!apt install vlc"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "qMynH2IPebr8",
        "outputId": "95dc4639-d770-44f6-b877-6e235cc3065b"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Reading package lists... Done\n",
            "Building dependency tree       \n",
            "Reading state information... Done\n",
            "The following package was automatically installed and is no longer required:\n",
            "  libnvidia-common-460\n",
            "Use 'apt autoremove' to remove it.\n",
            "The following additional packages will be installed:\n",
            "  fonts-freefont-ttf liba52-0.7.4 libaa1 libaribb24-0\n",
            "  libbasicusageenvironment1 libcddb2 libdca0 libdvbpsi10 libdvdnav4\n",
            "  libdvdread4 libebml4v5 libfaad2 libgroupsock8 libkate1 libldb1\n",
            "  liblirc-client0 liblivemedia62 liblua5.2-0 libmad0 libmatroska6v5\n",
            "  libmicrodns0 libmpcdec6 libmpeg2-4 libmtp-common libmtp-runtime libmtp9\n",
            "  libnfs11 libnotify4 libopenmpt-modplug1 libplacebo4 libprotobuf-lite10\n",
            "  libproxy-tools libqt5svg5 libqt5x11extras5 libresid-builder0c2a\n",
            "  libsdl-image1.2 libsdl1.2debian libsecret-1-0 libsecret-common libshout3\n",
            "  libsidplay2 libsmbclient libspeexdsp1 libtag1v5 libtag1v5-vanilla libtalloc2\n",
            "  libtdb1 libtevent0 libupnp6 libusageenvironment3 libva-wayland2 libvlc-bin\n",
            "  libvlc5 libvlccore9 libvulkan1 libwbclient0 libxcb-xv0 mesa-vulkan-drivers\n",
            "  notification-daemon python-talloc samba-libs vlc-bin vlc-data vlc-l10n\n",
            "  vlc-plugin-base vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba\n",
            "  vlc-plugin-skins2 vlc-plugin-video-output vlc-plugin-video-splitter\n",
            "  vlc-plugin-visualization\n",
            "Suggested packages:\n",
            "  libdvdcss2 lirc\n",
            "The following NEW packages will be installed:\n",
            "  fonts-freefont-ttf liba52-0.7.4 libaa1 libaribb24-0\n",
            "  libbasicusageenvironment1 libcddb2 libdca0 libdvbpsi10 libdvdnav4\n",
            "  libdvdread4 libebml4v5 libfaad2 libgroupsock8 libkate1 libldb1\n",
            "  liblirc-client0 liblivemedia62 liblua5.2-0 libmad0 libmatroska6v5\n",
            "  libmicrodns0 libmpcdec6 libmpeg2-4 libmtp-common libmtp-runtime libmtp9\n",
            "  libnfs11 libnotify4 libopenmpt-modplug1 libplacebo4 libprotobuf-lite10\n",
            "  libproxy-tools libqt5svg5 libqt5x11extras5 libresid-builder0c2a\n",
            "  libsdl-image1.2 libsdl1.2debian libsecret-1-0 libsecret-common libshout3\n",
            "  libsidplay2 libsmbclient libspeexdsp1 libtag1v5 libtag1v5-vanilla libtalloc2\n",
            "  libtdb1 libtevent0 libupnp6 libusageenvironment3 libva-wayland2 libvlc-bin\n",
            "  libvlc5 libvlccore9 libvulkan1 libwbclient0 libxcb-xv0 mesa-vulkan-drivers\n",
            "  notification-daemon python-talloc samba-libs vlc vlc-bin vlc-data vlc-l10n\n",
            "  vlc-plugin-base vlc-plugin-notify vlc-plugin-qt vlc-plugin-samba\n",
            "  vlc-plugin-skins2 vlc-plugin-video-output vlc-plugin-video-splitter\n",
            "  vlc-plugin-visualization\n",
            "0 upgraded, 73 newly installed, 0 to remove and 7 not upgraded.\n",
            "Need to get 27.3 MB of archives.\n",
            "After this operation, 124 MB of additional disk space will be used.\n",
            "Get:1 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmtp-common all 1.1.13-1 [43.6 kB]\n",
            "Get:2 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic/main amd64 libvulkan1 amd64 1.1.126.0-2~gpu18.04.1 [101 kB]\n",
            "Get:3 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmtp9 amd64 1.1.13-1 [154 kB]\n",
            "Get:4 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libqt5svg5 amd64 5.9.5-0ubuntu1.1 [129 kB]\n",
            "Get:5 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libwbclient0 amd64 2:4.7.6+dfsg~ubuntu-0ubuntu2.28 [33.6 kB]\n",
            "Get:6 http://archive.ubuntu.com/ubuntu bionic/main amd64 libtalloc2 amd64 2.1.10-2ubuntu1 [36.0 kB]\n",
            "Get:7 http://archive.ubuntu.com/ubuntu bionic/main amd64 libtdb1 amd64 1.3.15-2 [39.7 kB]\n",
            "Get:8 http://archive.ubuntu.com/ubuntu bionic/main amd64 libtevent0 amd64 0.9.34-1 [27.7 kB]\n",
            "Get:9 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libldb1 amd64 2:1.2.3-1ubuntu0.2 [114 kB]\n",
            "Get:10 http://archive.ubuntu.com/ubuntu bionic/main amd64 python-talloc amd64 2.1.10-2ubuntu1 [9,124 B]\n",
            "Get:11 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 samba-libs amd64 2:4.7.6+dfsg~ubuntu-0ubuntu2.28 [5,255 kB]\n",
            "Get:12 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsmbclient amd64 2:4.7.6+dfsg~ubuntu-0ubuntu2.28 [54.4 kB]\n",
            "Get:13 http://archive.ubuntu.com/ubuntu bionic/main amd64 fonts-freefont-ttf all 20120503-7 [4,202 kB]\n",
            "Get:14 http://archive.ubuntu.com/ubuntu bionic/universe amd64 liba52-0.7.4 amd64 0.7.4-19 [35.2 kB]\n",
            "Get:15 http://archive.ubuntu.com/ubuntu bionic/main amd64 libaa1 amd64 1.4p5-44build2 [47.2 kB]\n",
            "Get:16 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libaribb24-0 amd64 1.0.3-1 [26.7 kB]\n",
            "Get:17 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libbasicusageenvironment1 amd64 2018.02.18-1 [15.9 kB]\n",
            "Get:18 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libcddb2 amd64 1.3.2-5fakesync1 [33.9 kB]\n",
            "Get:19 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libdvbpsi10 amd64 1.3.2-1 [47.7 kB]\n",
            "Get:20 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libdvdread4 amd64 6.0.0-1 [50.6 kB]\n",
            "Get:21 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libdvdnav4 amd64 6.0.0-1 [38.0 kB]\n",
            "Get:22 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libebml4v5 amd64 1.3.5-2ubuntu0.1 [46.0 kB]\n",
            "Get:23 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libfaad2 amd64 2.8.8-1 [154 kB]\n",
            "Get:24 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libgroupsock8 amd64 2018.02.18-1 [21.2 kB]\n",
            "Get:25 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libkate1 amd64 0.4.1-7build1 [38.1 kB]\n",
            "Get:26 http://archive.ubuntu.com/ubuntu bionic/universe amd64 liblivemedia62 amd64 2018.02.18-1 [297 kB]\n",
            "Get:27 http://archive.ubuntu.com/ubuntu bionic/main amd64 liblua5.2-0 amd64 5.2.4-1.1build1 [108 kB]\n",
            "Get:28 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libmad0 amd64 0.15.1b-9ubuntu18.04.1 [64.6 kB]\n",
            "Get:29 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libmatroska6v5 amd64 1.4.8-1.1 [122 kB]\n",
            "Get:30 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libmicrodns0 amd64 0.0.8-1 [11.3 kB]\n",
            "Get:31 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libmpcdec6 amd64 2:0.1~r495-1 [32.3 kB]\n",
            "Get:32 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libmpeg2-4 amd64 0.5.1-8 [57.5 kB]\n",
            "Get:33 http://archive.ubuntu.com/ubuntu bionic/main amd64 libmtp-runtime amd64 1.1.13-1 [5,722 B]\n",
            "Get:34 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libnfs11 amd64 2.0.0-1~exp1 [75.7 kB]\n",
            "Get:35 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libnotify4 amd64 0.7.7-3ubuntu0.18.04.1 [18.7 kB]\n",
            "Get:36 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libopenmpt-modplug1 amd64 0.3.6-1 [19.2 kB]\n",
            "Get:37 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libplacebo4 amd64 0.4.0-2 [101 kB]\n",
            "Get:38 http://archive.ubuntu.com/ubuntu bionic/main amd64 libprotobuf-lite10 amd64 3.0.0-9.1ubuntu1 [97.7 kB]\n",
            "Get:39 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libproxy-tools amd64 0.4.15-1ubuntu0.2 [5,320 B]\n",
            "Get:40 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libqt5x11extras5 amd64 5.9.5-0ubuntu1 [8,596 B]\n",
            "Get:41 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libresid-builder0c2a amd64 2.1.1-15ubuntu1 [31.3 kB]\n",
            "Get:42 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libsdl1.2debian amd64 1.2.15+dfsg2-0.1ubuntu0.2 [175 kB]\n",
            "Get:43 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libsdl-image1.2 amd64 1.2.12-8ubuntu0.1 [30.3 kB]\n",
            "Get:44 http://archive.ubuntu.com/ubuntu bionic/main amd64 libsecret-common all 0.18.6-1 [4,452 B]\n",
            "Get:45 http://archive.ubuntu.com/ubuntu bionic/main amd64 libsecret-1-0 amd64 0.18.6-1 [94.6 kB]\n",
            "Get:46 http://archive.ubuntu.com/ubuntu bionic/main amd64 libshout3 amd64 2.4.1-2build1 [43.1 kB]\n",
            "Get:47 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libsidplay2 amd64 2.1.1-15ubuntu1 [87.8 kB]\n",
            "Get:48 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libspeexdsp1 amd64 1.2~rc1.2-1ubuntu2.1 [40.4 kB]\n",
            "Get:49 http://archive.ubuntu.com/ubuntu bionic/main amd64 libtag1v5-vanilla amd64 1.11.1+dfsg.1-0.2build2 [265 kB]\n",
            "Get:50 http://archive.ubuntu.com/ubuntu bionic/main amd64 libtag1v5 amd64 1.11.1+dfsg.1-0.2build2 [10.9 kB]\n",
            "Get:51 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libusageenvironment3 amd64 2018.02.18-1 [6,944 B]\n",
            "Get:52 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libva-wayland2 amd64 2.1.0-3 [8,756 B]\n",
            "Get:53 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libvlccore9 amd64 3.0.8-0ubuntu18.04.1 [434 kB]\n",
            "Get:54 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libvlc5 amd64 3.0.8-0ubuntu18.04.1 [68.0 kB]\n",
            "Get:55 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 libvlc-bin amd64 3.0.8-0ubuntu18.04.1 [17.1 kB]\n",
            "Get:56 http://archive.ubuntu.com/ubuntu bionic-updates/main amd64 libxcb-xv0 amd64 1.13-2~ubuntu18.04 [9,168 B]\n",
            "Get:57 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 mesa-vulkan-drivers amd64 20.0.8-0ubuntu1~18.04.1 [3,059 kB]\n",
            "Get:58 http://archive.ubuntu.com/ubuntu bionic/main amd64 notification-daemon amd64 3.20.0-3 [36.9 kB]\n",
            "Get:59 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-bin amd64 3.0.8-0ubuntu18.04.1 [53.3 kB]\n",
            "Get:60 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-data all 3.0.8-0ubuntu18.04.1 [339 kB]\n",
            "Get:61 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libdca0 amd64 0.0.5-10 [100.0 kB]\n",
            "Get:62 http://archive.ubuntu.com/ubuntu bionic/main amd64 liblirc-client0 amd64 0.10.0-2 [22.3 kB]\n",
            "Get:63 http://archive.ubuntu.com/ubuntu bionic/universe amd64 libupnp6 amd64 1:1.6.24-4 [122 kB]\n",
            "Get:64 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-plugin-base amd64 3.0.8-0ubuntu18.04.1 [2,900 kB]\n",
            "Get:65 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-plugin-qt amd64 3.0.8-0ubuntu18.04.1 [1,049 kB]\n",
            "Get:66 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-plugin-video-output amd64 3.0.8-0ubuntu18.04.1 [163 kB]\n",
            "Get:67 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc amd64 3.0.8-0ubuntu18.04.1 [33.7 kB]\n",
            "Get:68 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-l10n all 3.0.8-0ubuntu18.04.1 [5,739 kB]\n",
            "Get:69 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-plugin-notify amd64 3.0.8-0ubuntu18.04.1 [18.3 kB]\n",
            "Get:70 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-plugin-samba amd64 3.0.8-0ubuntu18.04.1 [18.9 kB]\n",
            "Get:71 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-plugin-skins2 amd64 3.0.8-0ubuntu18.04.1 [468 kB]\n",
            "Get:72 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-plugin-video-splitter amd64 3.0.8-0ubuntu18.04.1 [31.3 kB]\n",
            "Get:73 http://archive.ubuntu.com/ubuntu bionic-updates/universe amd64 vlc-plugin-visualization amd64 3.0.8-0ubuntu18.04.1 [39.6 kB]\n",
            "Fetched 27.3 MB in 5s (6,046 kB/s)\n",
            "W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/nvidia-machine-learning.list:1\n",
            "Extracting templates from packages: 41%W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/nvidia-machine-learning.list:1\n",
            "Extracting templates from packages: 82%W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/nvidia-machine-learning.list:1\n",
            "Extracting templates from packages: 100%\n",
            "Selecting previously unselected package libmtp-common.\n",
            "(Reading database ... 124033 files and directories currently installed.)\n",
            "Preparing to unpack .../00-libmtp-common_1.1.13-1_all.deb ...\n",
            "Unpacking libmtp-common (1.1.13-1) ...\n",
            "Selecting previously unselected package libmtp9:amd64.\n",
            "Preparing to unpack .../01-libmtp9_1.1.13-1_amd64.deb ...\n",
            "Unpacking libmtp9:amd64 (1.1.13-1) ...\n",
            "Selecting previously unselected package libqt5svg5:amd64.\n",
            "Preparing to unpack .../02-libqt5svg5_5.9.5-0ubuntu1.1_amd64.deb ...\n",
            "Unpacking libqt5svg5:amd64 (5.9.5-0ubuntu1.1) ...\n",
            "Selecting previously unselected package libwbclient0:amd64.\n",
            "Preparing to unpack .../03-libwbclient0_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.28_amd64.deb ...\n",
            "Unpacking libwbclient0:amd64 (2:4.7.6+dfsg~ubuntu-0ubuntu2.28) ...\n",
            "Selecting previously unselected package libtalloc2:amd64.\n",
            "Preparing to unpack .../04-libtalloc2_2.1.10-2ubuntu1_amd64.deb ...\n",
            "Unpacking libtalloc2:amd64 (2.1.10-2ubuntu1) ...\n",
            "Selecting previously unselected package libtdb1:amd64.\n",
            "Preparing to unpack .../05-libtdb1_1.3.15-2_amd64.deb ...\n",
            "Unpacking libtdb1:amd64 (1.3.15-2) ...\n",
            "Selecting previously unselected package libtevent0:amd64.\n",
            "Preparing to unpack .../06-libtevent0_0.9.34-1_amd64.deb ...\n",
            "Unpacking libtevent0:amd64 (0.9.34-1) ...\n",
            "Selecting previously unselected package libldb1:amd64.\n",
            "Preparing to unpack .../07-libldb1_2%3a1.2.3-1ubuntu0.2_amd64.deb ...\n",
            "Unpacking libldb1:amd64 (2:1.2.3-1ubuntu0.2) ...\n",
            "Selecting previously unselected package python-talloc.\n",
            "Preparing to unpack .../08-python-talloc_2.1.10-2ubuntu1_amd64.deb ...\n",
            "Unpacking python-talloc (2.1.10-2ubuntu1) ...\n",
            "Selecting previously unselected package samba-libs:amd64.\n",
            "Preparing to unpack .../09-samba-libs_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.28_amd64.deb ...\n",
            "Unpacking samba-libs:amd64 (2:4.7.6+dfsg~ubuntu-0ubuntu2.28) ...\n",
            "Selecting previously unselected package libsmbclient:amd64.\n",
            "Preparing to unpack .../10-libsmbclient_2%3a4.7.6+dfsg~ubuntu-0ubuntu2.28_amd64.deb ...\n",
            "Unpacking libsmbclient:amd64 (2:4.7.6+dfsg~ubuntu-0ubuntu2.28) ...\n",
            "Selecting previously unselected package fonts-freefont-ttf.\n",
            "Preparing to unpack .../11-fonts-freefont-ttf_20120503-7_all.deb ...\n",
            "Unpacking fonts-freefont-ttf (20120503-7) ...\n",
            "Selecting previously unselected package liba52-0.7.4:amd64.\n",
            "Preparing to unpack .../12-liba52-0.7.4_0.7.4-19_amd64.deb ...\n",
            "Unpacking liba52-0.7.4:amd64 (0.7.4-19) ...\n",
            "Selecting previously unselected package libaa1:amd64.\n",
            "Preparing to unpack .../13-libaa1_1.4p5-44build2_amd64.deb ...\n",
            "Unpacking libaa1:amd64 (1.4p5-44build2) ...\n",
            "Selecting previously unselected package libaribb24-0:amd64.\n",
            "Preparing to unpack .../14-libaribb24-0_1.0.3-1_amd64.deb ...\n",
            "Unpacking libaribb24-0:amd64 (1.0.3-1) ...\n",
            "Selecting previously unselected package libbasicusageenvironment1:amd64.\n",
            "Preparing to unpack .../15-libbasicusageenvironment1_2018.02.18-1_amd64.deb ...\n",
            "Unpacking libbasicusageenvironment1:amd64 (2018.02.18-1) ...\n",
            "Selecting previously unselected package libcddb2.\n",
            "Preparing to unpack .../16-libcddb2_1.3.2-5fakesync1_amd64.deb ...\n",
            "Unpacking libcddb2 (1.3.2-5fakesync1) ...\n",
            "Selecting previously unselected package libdvbpsi10:amd64.\n",
            "Preparing to unpack .../17-libdvbpsi10_1.3.2-1_amd64.deb ...\n",
            "Unpacking libdvbpsi10:amd64 (1.3.2-1) ...\n",
            "Selecting previously unselected package libdvdread4:amd64.\n",
            "Preparing to unpack .../18-libdvdread4_6.0.0-1_amd64.deb ...\n",
            "Unpacking libdvdread4:amd64 (6.0.0-1) ...\n",
            "Selecting previously unselected package libdvdnav4:amd64.\n",
            "Preparing to unpack .../19-libdvdnav4_6.0.0-1_amd64.deb ...\n",
            "Unpacking libdvdnav4:amd64 (6.0.0-1) ...\n",
            "Selecting previously unselected package libebml4v5:amd64.\n",
            "Preparing to unpack .../20-libebml4v5_1.3.5-2ubuntu0.1_amd64.deb ...\n",
            "Unpacking libebml4v5:amd64 (1.3.5-2ubuntu0.1) ...\n",
            "Selecting previously unselected package libfaad2:amd64.\n",
            "Preparing to unpack .../21-libfaad2_2.8.8-1_amd64.deb ...\n",
            "Unpacking libfaad2:amd64 (2.8.8-1) ...\n",
            "Selecting previously unselected package libgroupsock8:amd64.\n",
            "Preparing to unpack .../22-libgroupsock8_2018.02.18-1_amd64.deb ...\n",
            "Unpacking libgroupsock8:amd64 (2018.02.18-1) ...\n",
            "Selecting previously unselected package libkate1:amd64.\n",
            "Preparing to unpack .../23-libkate1_0.4.1-7build1_amd64.deb ...\n",
            "Unpacking libkate1:amd64 (0.4.1-7build1) ...\n",
            "Selecting previously unselected package liblivemedia62:amd64.\n",
            "Preparing to unpack .../24-liblivemedia62_2018.02.18-1_amd64.deb ...\n",
            "Unpacking liblivemedia62:amd64 (2018.02.18-1) ...\n",
            "Selecting previously unselected package liblua5.2-0:amd64.\n",
            "Preparing to unpack .../25-liblua5.2-0_5.2.4-1.1build1_amd64.deb ...\n",
            "Unpacking liblua5.2-0:amd64 (5.2.4-1.1build1) ...\n",
            "Selecting previously unselected package libmad0:amd64.\n",
            "Preparing to unpack .../26-libmad0_0.15.1b-9ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking libmad0:amd64 (0.15.1b-9ubuntu18.04.1) ...\n",
            "Selecting previously unselected package libmatroska6v5:amd64.\n",
            "Preparing to unpack .../27-libmatroska6v5_1.4.8-1.1_amd64.deb ...\n",
            "Unpacking libmatroska6v5:amd64 (1.4.8-1.1) ...\n",
            "Selecting previously unselected package libmicrodns0:amd64.\n",
            "Preparing to unpack .../28-libmicrodns0_0.0.8-1_amd64.deb ...\n",
            "Unpacking libmicrodns0:amd64 (0.0.8-1) ...\n",
            "Selecting previously unselected package libmpcdec6:amd64.\n",
            "Preparing to unpack .../29-libmpcdec6_2%3a0.1~r495-1_amd64.deb ...\n",
            "Unpacking libmpcdec6:amd64 (2:0.1~r495-1) ...\n",
            "Selecting previously unselected package libmpeg2-4:amd64.\n",
            "Preparing to unpack .../30-libmpeg2-4_0.5.1-8_amd64.deb ...\n",
            "Unpacking libmpeg2-4:amd64 (0.5.1-8) ...\n",
            "Selecting previously unselected package libmtp-runtime.\n",
            "Preparing to unpack .../31-libmtp-runtime_1.1.13-1_amd64.deb ...\n",
            "Unpacking libmtp-runtime (1.1.13-1) ...\n",
            "Selecting previously unselected package libnfs11:amd64.\n",
            "Preparing to unpack .../32-libnfs11_2.0.0-1~exp1_amd64.deb ...\n",
            "Unpacking libnfs11:amd64 (2.0.0-1~exp1) ...\n",
            "Selecting previously unselected package libnotify4:amd64.\n",
            "Preparing to unpack .../33-libnotify4_0.7.7-3ubuntu0.18.04.1_amd64.deb ...\n",
            "Unpacking libnotify4:amd64 (0.7.7-3ubuntu0.18.04.1) ...\n",
            "Selecting previously unselected package libopenmpt-modplug1:amd64.\n",
            "Preparing to unpack .../34-libopenmpt-modplug1_0.3.6-1_amd64.deb ...\n",
            "Unpacking libopenmpt-modplug1:amd64 (0.3.6-1) ...\n",
            "Selecting previously unselected package libvulkan1:amd64.\n",
            "Preparing to unpack .../35-libvulkan1_1.1.126.0-2~gpu18.04.1_amd64.deb ...\n",
            "Unpacking libvulkan1:amd64 (1.1.126.0-2~gpu18.04.1) ...\n",
            "Selecting previously unselected package libplacebo4:amd64.\n",
            "Preparing to unpack .../36-libplacebo4_0.4.0-2_amd64.deb ...\n",
            "Unpacking libplacebo4:amd64 (0.4.0-2) ...\n",
            "Selecting previously unselected package libprotobuf-lite10:amd64.\n",
            "Preparing to unpack .../37-libprotobuf-lite10_3.0.0-9.1ubuntu1_amd64.deb ...\n",
            "Unpacking libprotobuf-lite10:amd64 (3.0.0-9.1ubuntu1) ...\n",
            "Selecting previously unselected package libproxy-tools.\n",
            "Preparing to unpack .../38-libproxy-tools_0.4.15-1ubuntu0.2_amd64.deb ...\n",
            "Unpacking libproxy-tools (0.4.15-1ubuntu0.2) ...\n",
            "Selecting previously unselected package libqt5x11extras5:amd64.\n",
            "Preparing to unpack .../39-libqt5x11extras5_5.9.5-0ubuntu1_amd64.deb ...\n",
            "Unpacking libqt5x11extras5:amd64 (5.9.5-0ubuntu1) ...\n",
            "Selecting previously unselected package libresid-builder0c2a.\n",
            "Preparing to unpack .../40-libresid-builder0c2a_2.1.1-15ubuntu1_amd64.deb ...\n",
            "Unpacking libresid-builder0c2a (2.1.1-15ubuntu1) ...\n",
            "Selecting previously unselected package libsdl1.2debian:amd64.\n",
            "Preparing to unpack .../41-libsdl1.2debian_1.2.15+dfsg2-0.1ubuntu0.2_amd64.deb ...\n",
            "Unpacking libsdl1.2debian:amd64 (1.2.15+dfsg2-0.1ubuntu0.2) ...\n",
            "Selecting previously unselected package libsdl-image1.2:amd64.\n",
            "Preparing to unpack .../42-libsdl-image1.2_1.2.12-8ubuntu0.1_amd64.deb ...\n",
            "Unpacking libsdl-image1.2:amd64 (1.2.12-8ubuntu0.1) ...\n",
            "Selecting previously unselected package libsecret-common.\n",
            "Preparing to unpack .../43-libsecret-common_0.18.6-1_all.deb ...\n",
            "Unpacking libsecret-common (0.18.6-1) ...\n",
            "Selecting previously unselected package libsecret-1-0:amd64.\n",
            "Preparing to unpack .../44-libsecret-1-0_0.18.6-1_amd64.deb ...\n",
            "Unpacking libsecret-1-0:amd64 (0.18.6-1) ...\n",
            "Selecting previously unselected package libshout3:amd64.\n",
            "Preparing to unpack .../45-libshout3_2.4.1-2build1_amd64.deb ...\n",
            "Unpacking libshout3:amd64 (2.4.1-2build1) ...\n",
            "Selecting previously unselected package libsidplay2.\n",
            "Preparing to unpack .../46-libsidplay2_2.1.1-15ubuntu1_amd64.deb ...\n",
            "Unpacking libsidplay2 (2.1.1-15ubuntu1) ...\n",
            "Selecting previously unselected package libspeexdsp1:amd64.\n",
            "Preparing to unpack .../47-libspeexdsp1_1.2~rc1.2-1ubuntu2.1_amd64.deb ...\n",
            "Unpacking libspeexdsp1:amd64 (1.2~rc1.2-1ubuntu2.1) ...\n",
            "Selecting previously unselected package libtag1v5-vanilla:amd64.\n",
            "Preparing to unpack .../48-libtag1v5-vanilla_1.11.1+dfsg.1-0.2build2_amd64.deb ...\n",
            "Unpacking libtag1v5-vanilla:amd64 (1.11.1+dfsg.1-0.2build2) ...\n",
            "Selecting previously unselected package libtag1v5:amd64.\n",
            "Preparing to unpack .../49-libtag1v5_1.11.1+dfsg.1-0.2build2_amd64.deb ...\n",
            "Unpacking libtag1v5:amd64 (1.11.1+dfsg.1-0.2build2) ...\n",
            "Selecting previously unselected package libusageenvironment3:amd64.\n",
            "Preparing to unpack .../50-libusageenvironment3_2018.02.18-1_amd64.deb ...\n",
            "Unpacking libusageenvironment3:amd64 (2018.02.18-1) ...\n",
            "Selecting previously unselected package libva-wayland2:amd64.\n",
            "Preparing to unpack .../51-libva-wayland2_2.1.0-3_amd64.deb ...\n",
            "Unpacking libva-wayland2:amd64 (2.1.0-3) ...\n",
            "Selecting previously unselected package libvlccore9:amd64.\n",
            "Preparing to unpack .../52-libvlccore9_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking libvlccore9:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package libvlc5:amd64.\n",
            "Preparing to unpack .../53-libvlc5_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking libvlc5:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package libvlc-bin:amd64.\n",
            "Preparing to unpack .../54-libvlc-bin_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking libvlc-bin:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package libxcb-xv0:amd64.\n",
            "Preparing to unpack .../55-libxcb-xv0_1.13-2~ubuntu18.04_amd64.deb ...\n",
            "Unpacking libxcb-xv0:amd64 (1.13-2~ubuntu18.04) ...\n",
            "Selecting previously unselected package mesa-vulkan-drivers:amd64.\n",
            "Preparing to unpack .../56-mesa-vulkan-drivers_20.0.8-0ubuntu1~18.04.1_amd64.deb ...\n",
            "Unpacking mesa-vulkan-drivers:amd64 (20.0.8-0ubuntu1~18.04.1) ...\n",
            "Selecting previously unselected package notification-daemon.\n",
            "Preparing to unpack .../57-notification-daemon_3.20.0-3_amd64.deb ...\n",
            "Unpacking notification-daemon (3.20.0-3) ...\n",
            "Selecting previously unselected package vlc-bin.\n",
            "Preparing to unpack .../58-vlc-bin_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-bin (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-data.\n",
            "Preparing to unpack .../59-vlc-data_3.0.8-0ubuntu18.04.1_all.deb ...\n",
            "Unpacking vlc-data (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package libdca0:amd64.\n",
            "Preparing to unpack .../60-libdca0_0.0.5-10_amd64.deb ...\n",
            "Unpacking libdca0:amd64 (0.0.5-10) ...\n",
            "Selecting previously unselected package liblirc-client0:amd64.\n",
            "Preparing to unpack .../61-liblirc-client0_0.10.0-2_amd64.deb ...\n",
            "Unpacking liblirc-client0:amd64 (0.10.0-2) ...\n",
            "Selecting previously unselected package libupnp6:amd64.\n",
            "Preparing to unpack .../62-libupnp6_1%3a1.6.24-4_amd64.deb ...\n",
            "Unpacking libupnp6:amd64 (1:1.6.24-4) ...\n",
            "Selecting previously unselected package vlc-plugin-base:amd64.\n",
            "Preparing to unpack .../63-vlc-plugin-base_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-plugin-base:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-plugin-qt:amd64.\n",
            "Preparing to unpack .../64-vlc-plugin-qt_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-plugin-qt:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-plugin-video-output:amd64.\n",
            "Preparing to unpack .../65-vlc-plugin-video-output_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-plugin-video-output:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc.\n",
            "Preparing to unpack .../66-vlc_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-l10n.\n",
            "Preparing to unpack .../67-vlc-l10n_3.0.8-0ubuntu18.04.1_all.deb ...\n",
            "Unpacking vlc-l10n (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-plugin-notify:amd64.\n",
            "Preparing to unpack .../68-vlc-plugin-notify_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-plugin-notify:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-plugin-samba:amd64.\n",
            "Preparing to unpack .../69-vlc-plugin-samba_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-plugin-samba:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-plugin-skins2:amd64.\n",
            "Preparing to unpack .../70-vlc-plugin-skins2_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-plugin-skins2:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-plugin-video-splitter:amd64.\n",
            "Preparing to unpack .../71-vlc-plugin-video-splitter_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-plugin-video-splitter:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Selecting previously unselected package vlc-plugin-visualization:amd64.\n",
            "Preparing to unpack .../72-vlc-plugin-visualization_3.0.8-0ubuntu18.04.1_amd64.deb ...\n",
            "Unpacking vlc-plugin-visualization:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libvulkan1:amd64 (1.1.126.0-2~gpu18.04.1) ...\n",
            "Setting up libnotify4:amd64 (0.7.7-3ubuntu0.18.04.1) ...\n",
            "Setting up libmpeg2-4:amd64 (0.5.1-8) ...\n",
            "Setting up libtdb1:amd64 (1.3.15-2) ...\n",
            "Setting up libsecret-common (0.18.6-1) ...\n",
            "Setting up libwbclient0:amd64 (2:4.7.6+dfsg~ubuntu-0ubuntu2.28) ...\n",
            "Setting up mesa-vulkan-drivers:amd64 (20.0.8-0ubuntu1~18.04.1) ...\n",
            "Setting up libusageenvironment3:amd64 (2018.02.18-1) ...\n",
            "Setting up libplacebo4:amd64 (0.4.0-2) ...\n",
            "Setting up libqt5x11extras5:amd64 (5.9.5-0ubuntu1) ...\n",
            "Setting up vlc-data (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libdvbpsi10:amd64 (1.3.2-1) ...\n",
            "Setting up libmpcdec6:amd64 (2:0.1~r495-1) ...\n",
            "Setting up libaribb24-0:amd64 (1.0.3-1) ...\n",
            "Setting up libbasicusageenvironment1:amd64 (2018.02.18-1) ...\n",
            "Setting up libproxy-tools (0.4.15-1ubuntu0.2) ...\n",
            "Setting up libmicrodns0:amd64 (0.0.8-1) ...\n",
            "Setting up libebml4v5:amd64 (1.3.5-2ubuntu0.1) ...\n",
            "Setting up libva-wayland2:amd64 (2.1.0-3) ...\n",
            "Setting up libfaad2:amd64 (2.8.8-1) ...\n",
            "Setting up libkate1:amd64 (0.4.1-7build1) ...\n",
            "Setting up liblirc-client0:amd64 (0.10.0-2) ...\n",
            "Setting up libsdl1.2debian:amd64 (1.2.15+dfsg2-0.1ubuntu0.2) ...\n",
            "Setting up vlc-l10n (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libnfs11:amd64 (2.0.0-1~exp1) ...\n",
            "Setting up libmtp-common (1.1.13-1) ...\n",
            "Setting up liba52-0.7.4:amd64 (0.7.4-19) ...\n",
            "Setting up libaa1:amd64 (1.4p5-44build2) ...\n",
            "Setting up libupnp6:amd64 (1:1.6.24-4) ...\n",
            "Setting up libvlccore9:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libxcb-xv0:amd64 (1.13-2~ubuntu18.04) ...\n",
            "Setting up libqt5svg5:amd64 (5.9.5-0ubuntu1.1) ...\n",
            "Setting up vlc-plugin-video-splitter:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libcddb2 (1.3.2-5fakesync1) ...\n",
            "Setting up libmtp9:amd64 (1.1.13-1) ...\n",
            "Setting up libgroupsock8:amd64 (2018.02.18-1) ...\n",
            "Setting up vlc-plugin-visualization:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libtalloc2:amd64 (2.1.10-2ubuntu1) ...\n",
            "Setting up liblua5.2-0:amd64 (5.2.4-1.1build1) ...\n",
            "Setting up libsdl-image1.2:amd64 (1.2.12-8ubuntu0.1) ...\n",
            "Setting up libmad0:amd64 (0.15.1b-9ubuntu18.04.1) ...\n",
            "Setting up vlc-plugin-notify:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libresid-builder0c2a (2.1.1-15ubuntu1) ...\n",
            "Setting up libsidplay2 (2.1.1-15ubuntu1) ...\n",
            "Setting up libdca0:amd64 (0.0.5-10) ...\n",
            "Setting up liblivemedia62:amd64 (2018.02.18-1) ...\n",
            "Setting up fonts-freefont-ttf (20120503-7) ...\n",
            "Setting up libprotobuf-lite10:amd64 (3.0.0-9.1ubuntu1) ...\n",
            "Setting up libshout3:amd64 (2.4.1-2build1) ...\n",
            "Setting up libsecret-1-0:amd64 (0.18.6-1) ...\n",
            "Setting up libopenmpt-modplug1:amd64 (0.3.6-1) ...\n",
            "Setting up libspeexdsp1:amd64 (1.2~rc1.2-1ubuntu2.1) ...\n",
            "Setting up libtag1v5-vanilla:amd64 (1.11.1+dfsg.1-0.2build2) ...\n",
            "Setting up notification-daemon (3.20.0-3) ...\n",
            "Setting up libdvdread4:amd64 (6.0.0-1) ...\n",
            "Setting up python-talloc (2.1.10-2ubuntu1) ...\n",
            "Setting up libmatroska6v5:amd64 (1.4.8-1.1) ...\n",
            "Setting up libvlc5:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libtag1v5:amd64 (1.11.1+dfsg.1-0.2build2) ...\n",
            "Setting up libdvdnav4:amd64 (6.0.0-1) ...\n",
            "Setting up vlc-plugin-qt:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libmtp-runtime (1.1.13-1) ...\n",
            "Setting up libtevent0:amd64 (0.9.34-1) ...\n",
            "Setting up vlc-plugin-video-output:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libvlc-bin:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up vlc-plugin-skins2:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up vlc-plugin-base:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up vlc-bin (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up libldb1:amd64 (2:1.2.3-1ubuntu0.2) ...\n",
            "Setting up vlc (3.0.8-0ubuntu18.04.1) ...\n",
            "Setting up samba-libs:amd64 (2:4.7.6+dfsg~ubuntu-0ubuntu2.28) ...\n",
            "Setting up libsmbclient:amd64 (2:4.7.6+dfsg~ubuntu-0ubuntu2.28) ...\n",
            "Setting up vlc-plugin-samba:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "Processing triggers for udev (237-3ubuntu10.56) ...\n",
            "Processing triggers for man-db (2.8.3-2ubuntu0.1) ...\n",
            "Processing triggers for hicolor-icon-theme (0.17-2) ...\n",
            "Processing triggers for fontconfig (2.12.6-0ubuntu2) ...\n",
            "Processing triggers for mime-support (3.60ubuntu1) ...\n",
            "Processing triggers for libc-bin (2.27-3ubuntu1.6) ...\n",
            "Processing triggers for libvlc-bin:amd64 (3.0.8-0ubuntu18.04.1) ...\n",
            "W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/nvidia-machine-learning.list:1\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Download weights and video"
      ],
      "metadata": {
        "id": "HqHg_VATg6CO"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "# download weights (pose_higher_hrnet_w32_512.pth)\n",
        "!gdown 1V9Iz0ZYy9m8VeaspfKECDW0NKlGsYmO1\n",
        "!mkdir weights\n",
        "!mv /content/simple-HigherHRNet/pose_higher_hrnet_w32_512.pth /content/simple-HigherHRNet/weights/pose_higher_hrnet_w32_512.pth"
      ],
      "metadata": {
        "id": "3LURZ12cfCcU",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "59659ccf-d001-41d5-b0a3-c6f463ba775a"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Downloading...\n",
            "From: https://drive.google.com/uc?id=1V9Iz0ZYy9m8VeaspfKECDW0NKlGsYmO1\n",
            "To: /content/simple-HigherHRNet/pose_higher_hrnet_w32_512.pth\n",
            "100% 115M/115M [00:00<00:00, 220MB/s]\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# download a publicly available video (or just get your own)\n",
        "!wget https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WeAreGoingOnBullrun.mp4"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "OLIrIc14eUPM",
        "outputId": "7d707a13-66e0-4219-afa2-a2a27b29995d"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "--2022-11-21 23:37:17--  https://commondatastorage.googleapis.com/gtv-videos-bucket/sample/WeAreGoingOnBullrun.mp4\n",
            "Resolving commondatastorage.googleapis.com (commondatastorage.googleapis.com)... 142.251.10.128, 2404:6800:4003:c0f::80\n",
            "Connecting to commondatastorage.googleapis.com (commondatastorage.googleapis.com)|142.251.10.128|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 13183260 (13M) [video/mp4]\n",
            "Saving to: β€˜WeAreGoingOnBullrun.mp4’\n",
            "\n",
            "WeAreGoingOnBullrun 100%[===================>]  12.57M  --.-KB/s    in 0.07s   \n",
            "\n",
            "2022-11-21 23:37:18 (190 MB/s) - β€˜WeAreGoingOnBullrun.mp4’ saved [13183260/13183260]\n",
            "\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Test the live script\n",
        "This step can be skipped if interested in the TensorRT conversion."
      ],
      "metadata": {
        "id": "ZWUN1C5RgGYS"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "!python ./scripts/live-demo.py --filename WeAreGoingOnBullrun.mp4 --save_video"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "VEPfVe2bg1dS",
        "outputId": "f287bde9-4463-4a54-8896-8e48b8904dbd"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "\u001b[32m23:43:27\u001b[0m :: \u001b[1;35m   Helper    \u001b[0m :: \u001b[1;36m  INFO  \u001b[0m :: \u001b[1;37mRunning VidGear Version: 0.2.6\u001b[0m\n",
            "device: 'cuda' - 1 GPU(s) will be used\n",
            "/content/simple-HigherHRNet/misc/HeatmapParser.py:168: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').\n",
            "  y = (ind // w).long()\n",
            "framerate: 8.096502 fps / detected people: 0 /content/simple-HigherHRNet/misc/HeatmapParser.py:236: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').\n",
            "  index = index // dim\n",
            "framerate: 9.491158 fps / detected people: 0 \n",
            "Time elapsed ==  209.30760788917542\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Now check out the video output.avi\n"
      ],
      "metadata": {
        "id": "RsTTv7A5gGvF"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "## TensorRT\n",
        "This section install TensorRT 8.5, converts the model to TensorRT (.engine) and tests the converted model.\n",
        "\n",
        "Tested with TensorRT 8.5.1-1+cuda11.8 and python package tensorrt 8.5.1.7 ."
      ],
      "metadata": {
        "id": "YHj3FQEyf1yD"
      }
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Install TensorRT\n",
        "A GPU is needed for this step. Please change the runtime type to \"GPU\".\n"
      ],
      "metadata": {
        "id": "VsFWYxaNc-gl"
      }
    },
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "LsAlxRGVXhrt",
        "outputId": "834363d2-8d74-450a-b6d3-110e8fdeb404"
      },
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Mon Nov 21 23:47:24 2022       \n",
            "+-----------------------------------------------------------------------------+\n",
            "| NVIDIA-SMI 460.32.03    Driver Version: 460.32.03    CUDA Version: 11.2     |\n",
            "|-------------------------------+----------------------+----------------------+\n",
            "| GPU  Name        Persistence-M| Bus-Id        Disp.A | Volatile Uncorr. ECC |\n",
            "| Fan  Temp  Perf  Pwr:Usage/Cap|         Memory-Usage | GPU-Util  Compute M. |\n",
            "|                               |                      |               MIG M. |\n",
            "|===============================+======================+======================|\n",
            "|   0  Tesla T4            Off  | 00000000:00:04.0 Off |                    0 |\n",
            "| N/A   67C    P8    11W /  70W |      0MiB / 15109MiB |      0%      Default |\n",
            "|                               |                      |                  N/A |\n",
            "+-------------------------------+----------------------+----------------------+\n",
            "                                                                               \n",
            "+-----------------------------------------------------------------------------+\n",
            "| Processes:                                                                  |\n",
            "|  GPU   GI   CI        PID   Type   Process name                  GPU Memory |\n",
            "|        ID   ID                                                   Usage      |\n",
            "|=============================================================================|\n",
            "|  No running processes found                                                 |\n",
            "+-----------------------------------------------------------------------------+\n"
          ]
        }
      ],
      "source": [
        "# check a GPU runtime is selected\n",
        "!nvidia-smi"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "%%bash\n",
        "wget https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb\n",
        "\n",
        "dpkg -i nvidia-machine-learning-repo-*.deb\n",
        "apt-get update\n",
        "\n",
        "sudo apt-get install libnvinfer8 python3-libnvinfer"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "9vZ35qN5XkHE",
        "outputId": "8d8e9af3-39e8-4edf-8a67-bbc1173156e2"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "(Reading database ... 123994 files and directories currently installed.)\n",
            "Preparing to unpack nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb ...\n",
            "Unpacking nvidia-machine-learning-repo-ubuntu1804 (1.0.0-1) over (1.0.0-1) ...\n",
            "Setting up nvidia-machine-learning-repo-ubuntu1804 (1.0.0-1) ...\n",
            "Hit:1 https://cloud.r-project.org/bin/linux/ubuntu bionic-cran40/ InRelease\n",
            "Hit:2 http://security.ubuntu.com/ubuntu bionic-security InRelease\n",
            "Hit:3 http://ppa.launchpad.net/c2d4u.team/c2d4u4.0+/ubuntu bionic InRelease\n",
            "Ign:4 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64  InRelease\n",
            "Hit:5 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  InRelease\n",
            "Hit:6 https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64  Release\n",
            "Hit:7 http://archive.ubuntu.com/ubuntu bionic InRelease\n",
            "Hit:8 http://ppa.launchpad.net/cran/libgit2/ubuntu bionic InRelease\n",
            "Hit:9 http://archive.ubuntu.com/ubuntu bionic-updates InRelease\n",
            "Hit:10 http://archive.ubuntu.com/ubuntu bionic-backports InRelease\n",
            "Hit:11 http://ppa.launchpad.net/deadsnakes/ppa/ubuntu bionic InRelease\n",
            "Hit:13 http://ppa.launchpad.net/graphics-drivers/ppa/ubuntu bionic InRelease\n",
            "Reading package lists...\n",
            "Reading package lists...\n",
            "Building dependency tree...\n",
            "Reading state information...\n",
            "The following package was automatically installed and is no longer required:\n",
            "  libnvidia-common-460\n",
            "Use 'sudo apt autoremove' to remove it.\n",
            "The following additional packages will be installed:\n",
            "  libnvinfer-plugin8 libnvonnxparsers8 libnvparsers8\n",
            "The following NEW packages will be installed:\n",
            "  libnvinfer-plugin8 libnvinfer8 libnvonnxparsers8 libnvparsers8\n",
            "  python3-libnvinfer\n",
            "0 upgraded, 5 newly installed, 0 to remove and 7 not upgraded.\n",
            "Need to get 290 MB of archives.\n",
            "After this operation, 915 MB of additional disk space will be used.\n",
            "Get:1 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  libnvinfer8 8.5.1-1+cuda11.8 [274 MB]\n",
            "Get:2 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  libnvinfer-plugin8 8.5.1-1+cuda11.8 [13.3 MB]\n",
            "Get:3 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  libnvonnxparsers8 8.5.1-1+cuda11.8 [714 kB]\n",
            "Get:4 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  libnvparsers8 8.5.1-1+cuda11.8 [804 kB]\n",
            "Get:5 https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64  python3-libnvinfer 8.5.1-1+cuda11.8 [610 kB]\n",
            "Fetched 290 MB in 5s (62.7 MB/s)\n",
            "Selecting previously unselected package libnvinfer8.\r\n",
            "(Reading database ... \r(Reading database ... 5%\r(Reading database ... 10%\r(Reading database ... 15%\r(Reading database ... 20%\r(Reading database ... 25%\r(Reading database ... 30%\r(Reading database ... 35%\r(Reading database ... 40%\r(Reading database ... 45%\r(Reading database ... 50%\r(Reading database ... 55%\r(Reading database ... 60%\r(Reading database ... 65%\r(Reading database ... 70%\r(Reading database ... 75%\r(Reading database ... 80%\r(Reading database ... 85%\r(Reading database ... 90%\r(Reading database ... 95%\r(Reading database ... 100%\r(Reading database ... 123994 files and directories currently installed.)\r\n",
            "Preparing to unpack .../libnvinfer8_8.5.1-1+cuda11.8_amd64.deb ...\r\n",
            "Unpacking libnvinfer8 (8.5.1-1+cuda11.8) ...\r\n",
            "Selecting previously unselected package libnvinfer-plugin8.\r\n",
            "Preparing to unpack .../libnvinfer-plugin8_8.5.1-1+cuda11.8_amd64.deb ...\r\n",
            "Unpacking libnvinfer-plugin8 (8.5.1-1+cuda11.8) ...\r\n",
            "Selecting previously unselected package libnvonnxparsers8.\r\n",
            "Preparing to unpack .../libnvonnxparsers8_8.5.1-1+cuda11.8_amd64.deb ...\r\n",
            "Unpacking libnvonnxparsers8 (8.5.1-1+cuda11.8) ...\r\n",
            "Selecting previously unselected package libnvparsers8.\r\n",
            "Preparing to unpack .../libnvparsers8_8.5.1-1+cuda11.8_amd64.deb ...\r\n",
            "Unpacking libnvparsers8 (8.5.1-1+cuda11.8) ...\r\n",
            "Selecting previously unselected package python3-libnvinfer.\r\n",
            "Preparing to unpack .../python3-libnvinfer_8.5.1-1+cuda11.8_amd64.deb ...\r\n",
            "Unpacking python3-libnvinfer (8.5.1-1+cuda11.8) ...\r\n",
            "Setting up libnvinfer8 (8.5.1-1+cuda11.8) ...\r\n",
            "Setting up libnvinfer-plugin8 (8.5.1-1+cuda11.8) ...\r\n",
            "Setting up libnvparsers8 (8.5.1-1+cuda11.8) ...\r\n",
            "Setting up libnvonnxparsers8 (8.5.1-1+cuda11.8) ...\r\n",
            "Setting up python3-libnvinfer (8.5.1-1+cuda11.8) ...\r\n",
            "Processing triggers for libc-bin (2.27-3ubuntu1.6) ...\r\n"
          ]
        },
        {
          "output_type": "stream",
          "name": "stderr",
          "text": [
            "--2022-11-21 23:10:05--  https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu1804/x86_64/nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb\n",
            "Resolving developer.download.nvidia.com (developer.download.nvidia.com)... 152.199.39.144\n",
            "Connecting to developer.download.nvidia.com (developer.download.nvidia.com)|152.199.39.144|:443... connected.\n",
            "HTTP request sent, awaiting response... 200 OK\n",
            "Length: 2926 (2.9K) [application/x-deb]\n",
            "Saving to: β€˜nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb.1’\n",
            "\n",
            "     0K ..                                                    100%  180M=0s\n",
            "\n",
            "2022-11-21 23:10:05 (180 MB/s) - β€˜nvidia-machine-learning-repo-ubuntu1804_1.0.0-1_amd64.deb.1’ saved [2926/2926]\n",
            "\n",
            "W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/nvidia-machine-learning.list:1\n",
            "W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/nvidia-machine-learning.list:1\n",
            "debconf: unable to initialize frontend: Dialog\n",
            "debconf: (No usable dialog-like program is installed, so the dialog based frontend cannot be used. at /usr/share/perl5/Debconf/FrontEnd/Dialog.pm line 76, <> line 5.)\n",
            "debconf: falling back to frontend: Readline\n",
            "debconf: unable to initialize frontend: Readline\n",
            "debconf: (This frontend requires a controlling tty.)\n",
            "debconf: falling back to frontend: Teletype\n",
            "dpkg-preconfigure: unable to re-open stdin: \n",
            "W: Target Packages (Packages) is configured multiple times in /etc/apt/sources.list:51 and /etc/apt/sources.list.d/nvidia-machine-learning.list:1\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "# check TensorRT version\n",
        "print(\"TensorRT version: \")\n",
        "!dpkg -l | grep nvinfer"
      ],
      "metadata": {
        "id": "GlGh_J2WYH8u",
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "outputId": "eb7d90c9-2bed-4a9d-88f7-fdaaf360fa82"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "TensorRT version: \n",
            "ii  libnvinfer-plugin8                      8.5.1-1+cuda11.8                    amd64        TensorRT plugin libraries\n",
            "ii  libnvinfer8                             8.5.1-1+cuda11.8                    amd64        TensorRT runtime libraries\n",
            "ii  python3-libnvinfer                      8.5.1-1+cuda11.8                    amd64        Python 3 bindings for TensorRT\n"
          ]
        }
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "!pip install tensorrt onnx"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "NUR0P_HklFbz",
        "outputId": "e6542f82-66e4-4043-8b3c-3837ae031505"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "Looking in indexes: https://pypi.org/simple, https://us-python.pkg.dev/colab-wheels/public/simple/\n",
            "Requirement already satisfied: tensorrt in /usr/local/lib/python3.7/dist-packages (8.5.1.7)\n",
            "Collecting onnx\n",
            "  Downloading onnx-1.12.0-cp37-cp37m-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (13.1 MB)\n",
            "\u001b[K     |β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆ| 13.1 MB 24.5 MB/s \n",
            "\u001b[?25hRequirement already satisfied: nvidia-cudnn-cu11 in /usr/local/lib/python3.7/dist-packages (from tensorrt) (8.6.0.163)\n",
            "Requirement already satisfied: nvidia-cublas-cu11 in /usr/local/lib/python3.7/dist-packages (from tensorrt) (11.11.3.6)\n",
            "Requirement already satisfied: nvidia-cuda-runtime-cu11 in /usr/local/lib/python3.7/dist-packages (from tensorrt) (11.8.89)\n",
            "Requirement already satisfied: numpy>=1.16.6 in /usr/local/lib/python3.7/dist-packages (from onnx) (1.21.6)\n",
            "Requirement already satisfied: typing-extensions>=3.6.2.1 in /usr/local/lib/python3.7/dist-packages (from onnx) (4.1.1)\n",
            "Requirement already satisfied: protobuf<=3.20.1,>=3.12.2 in /usr/local/lib/python3.7/dist-packages (from onnx) (3.19.6)\n",
            "Installing collected packages: onnx\n",
            "Successfully installed onnx-1.12.0\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Export the model with tensorrt"
      ],
      "metadata": {
        "id": "I2u6Xn72eEBE"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "!python scripts/export-tensorrt-model.py --device 0 --half"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "S57JsLacdnoF",
        "outputId": "429a5090-4b27-439f-cdb2-d3fe952b9d71"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "\u001b[34m\u001b[1mexport-tensorrt-model: \u001b[0mweights=./weights/pose_higher_hrnet_w32_512.pth, hrnet_c=32, hrnet_j=17, imgsz=[512, 960], batch_size=1, device=0, half=True, int8=False, dynamic=False, simplify=False, opset=12, verbose=False, workspace=1, include=['engine']\n",
            "YOLOv5 πŸš€ 2022-11-21 Python-3.7.15 torch-1.12.1+cu113 CUDA:0 (Tesla T4, 15110MiB)\n",
            "\n",
            "\n",
            "\u001b[34m\u001b[1mONNX:\u001b[0m starting export with onnx 1.12.0...\n",
            "\u001b[34m\u001b[1mONNX:\u001b[0m export success βœ… 52.5s, saved as weights/pose_higher_hrnet_w32_512.onnx (109.3 MB)\n",
            "\n",
            "\u001b[34m\u001b[1mTensorRT:\u001b[0m starting export with TensorRT 8.5.1.7...\n",
            "[11/21/2022-23:54:02] [TRT] [I] [MemUsageChange] Init CUDA: CPU +0, GPU +0, now: CPU 0, GPU 1572 (MiB)\n",
            "[11/21/2022-23:54:05] [TRT] [I] [MemUsageChange] Init builder kernel library: CPU +0, GPU +74, now: CPU 0, GPU 1646 (MiB)\n",
            "[11/21/2022-23:54:05] [TRT] [W] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage. See `CUDA_MODULE_LOADING` in https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars\n",
            "scripts/export-tensorrt-model.py:132: DeprecationWarning: Use set_memory_pool_limit instead.\n",
            "  config.max_workspace_size = workspace * 1 << 30\n",
            "[11/21/2022-23:54:05] [TRT] [I] ----------------------------------------------------------------\n",
            "[11/21/2022-23:54:05] [TRT] [I] Input filename:   weights/pose_higher_hrnet_w32_512.onnx\n",
            "[11/21/2022-23:54:05] [TRT] [I] ONNX IR version:  0.0.7\n",
            "[11/21/2022-23:54:05] [TRT] [I] Opset version:    12\n",
            "[11/21/2022-23:54:05] [TRT] [I] Producer name:    pytorch\n",
            "[11/21/2022-23:54:05] [TRT] [I] Producer version: 1.12.1\n",
            "[11/21/2022-23:54:05] [TRT] [I] Domain:           \n",
            "[11/21/2022-23:54:05] [TRT] [I] Model version:    0\n",
            "[11/21/2022-23:54:05] [TRT] [I] Doc string:       \n",
            "[11/21/2022-23:54:05] [TRT] [I] ----------------------------------------------------------------\n",
            "[11/21/2022-23:54:06] [TRT] [W] onnx2trt_utils.cpp:377: Your ONNX model has been generated with INT64 weights, while TensorRT does not natively support INT64. Attempting to cast down to INT32.\n",
            "\u001b[34m\u001b[1mTensorRT:\u001b[0m input \"images\" with shape(1, 3, 512, 960) DataType.FLOAT\n",
            "\u001b[34m\u001b[1mTensorRT:\u001b[0m output \"output0\" with shape(1, 34, 128, 240) DataType.FLOAT\n",
            "\u001b[34m\u001b[1mTensorRT:\u001b[0m output \"output1\" with shape(1, 17, 256, 480) DataType.FLOAT\n",
            "\u001b[34m\u001b[1mTensorRT:\u001b[0m building FP16 engine as weights/pose_higher_hrnet_w32_512.engine\n",
            "scripts/export-tensorrt-model.py:159: DeprecationWarning: Use build_serialized_network instead.\n",
            "  with builder.build_engine(network, config) as engine, open(f, 'wb') as t:\n",
            "[11/21/2022-23:54:10] [TRT] [I] [MemUsageChange] Init cuBLAS/cuBLASLt: CPU +0, GPU +8, now: CPU 0, GPU 1654 (MiB)\n",
            "[11/21/2022-23:54:10] [TRT] [I] [MemUsageChange] Init cuDNN: CPU +0, GPU +8, now: CPU 0, GPU 1662 (MiB)\n",
            "[11/21/2022-23:54:10] [TRT] [W] TensorRT was linked against cuDNN 8.6.0 but loaded cuDNN 8.3.2\n",
            "[11/21/2022-23:54:10] [TRT] [I] Local timing cache in use. Profiling results in this builder pass will not be stored.\n",
            "[11/21/2022-23:54:19] [TRT] [I] Some tactics do not have sufficient workspace memory to run. Increasing workspace size will enable more tactics, please check verbose output for requested sizes.\n",
            "[11/22/2022-00:00:29] [TRT] [I] Total Activation Memory: 1602586624\n",
            "[11/22/2022-00:00:29] [TRT] [I] Detected 1 inputs and 2 output network tensors.\n",
            "[11/22/2022-00:00:30] [TRT] [I] Total Host Persistent Memory: 930704\n",
            "[11/22/2022-00:00:30] [TRT] [I] Total Device Persistent Memory: 3670528\n",
            "[11/22/2022-00:00:30] [TRT] [I] Total Scratch Memory: 0\n",
            "[11/22/2022-00:00:30] [TRT] [I] [MemUsageStats] Peak memory usage of TRT CPU/GPU memory allocators: CPU 55 MiB, GPU 574 MiB\n",
            "[11/22/2022-00:00:30] [TRT] [I] [BlockAssignment] Started assigning block shifts. This will take 341 steps to complete.\n",
            "[11/22/2022-00:00:30] [TRT] [I] [BlockAssignment] Algorithm ShiftNTopDown took 16.2806ms to assign 14 blocks to 341 nodes requiring 51609600 bytes.\n",
            "[11/22/2022-00:00:30] [TRT] [I] Total Activation Memory: 51609600\n",
            "[11/22/2022-00:00:30] [TRT] [W] TensorRT encountered issues when converting weights between types and that could affect accuracy.\n",
            "[11/22/2022-00:00:30] [TRT] [W] If this is not the desired behavior, please modify the weights or retrain with regularization to adjust the magnitude of the weights.\n",
            "[11/22/2022-00:00:30] [TRT] [W] Check verbose logs for the list of affected weights.\n",
            "[11/22/2022-00:00:30] [TRT] [W] - 317 weights are affected by this issue: Detected subnormal FP16 values.\n",
            "[11/22/2022-00:00:30] [TRT] [W] - 88 weights are affected by this issue: Detected values less than smallest positive FP16 subnormal value and converted them to the FP16 minimum subnormalized value.\n",
            "[11/22/2022-00:00:30] [TRT] [I] [MemUsageChange] TensorRT-managed allocation in building engine: CPU +55, GPU +58, now: CPU 55, GPU 58 (MiB)\n",
            "\u001b[34m\u001b[1mTensorRT:\u001b[0m export success βœ… 440.8s, saved as weights/pose_higher_hrnet_w32_512.engine (56.9 MB)\n",
            "\n",
            "Export complete (446.1s)\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "### Test the tensorrt model"
      ],
      "metadata": {
        "id": "npgGj4cGemZd"
      }
    },
    {
      "cell_type": "code",
      "source": [
        "!python scripts/live-demo.py --enable_tensorrt --filename=WeAreGoingOnBullrun.mp4 --hrnet_weights='weights/pose_higher_hrnet_w32_512.engine' --save_video"
      ],
      "metadata": {
        "colab": {
          "base_uri": "https://localhost:8080/"
        },
        "id": "LnIpbqV0fVps",
        "outputId": "fce1e062-c975-421a-be89-51c533f2f879"
      },
      "execution_count": null,
      "outputs": [
        {
          "output_type": "stream",
          "name": "stdout",
          "text": [
            "\u001b[32m00:02:18\u001b[0m :: \u001b[1;35m   Helper    \u001b[0m :: \u001b[1;36m  INFO  \u001b[0m :: \u001b[1;37mRunning VidGear Version: 0.2.6\u001b[0m\n",
            "[11/22/2022-00:02:20] [TRT] [I] Loaded engine size: 56 MiB\n",
            "[11/22/2022-00:02:21] [TRT] [I] [MemUsageChange] TensorRT-managed allocation in engine deserialization: CPU +0, GPU +58, now: CPU 0, GPU 58 (MiB)\n",
            "[11/22/2022-00:02:21] [TRT] [I] [MemUsageChange] TensorRT-managed allocation in IExecutionContext creation: CPU +1, GPU +52, now: CPU 1, GPU 110 (MiB)\n",
            "[11/22/2022-00:02:21] [TRT] [W] CUDA lazy loading is not enabled. Enabling it can significantly reduce device memory usage. See `CUDA_MODULE_LOADING` in https://docs.nvidia.com/cuda/cuda-c-programming-guide/index.html#env-vars\n",
            "/content/simple-HigherHRNet/misc/HeatmapParser.py:168: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').\n",
            "  y = (ind // w).long()\n",
            "framerate: 22.181639 fps / detected people: 0 /content/simple-HigherHRNet/misc/HeatmapParser.py:236: UserWarning: __floordiv__ is deprecated, and its behavior will change in a future version of pytorch. It currently rounds toward 0 (like the 'trunc' function NOT 'floor'). This results in incorrect rounding for negative values. To keep the current behavior, use torch.div(a, b, rounding_mode='trunc'), or for actual floor division, use torch.div(a, b, rounding_mode='floor').\n",
            "  index = index // dim\n",
            "framerate: 23.412900 fps / detected people: 0 \n",
            "Time elapsed ==  134.7310082912445\n"
          ]
        }
      ]
    },
    {
      "cell_type": "markdown",
      "source": [
        "Now check out the video output.avi\n"
      ],
      "metadata": {
        "id": "WbQk0PeNnM5-"
      }
    }
  ]
}