-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfaq.html
772 lines (675 loc) · 29.5 KB
/
faq.html
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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" /><meta name="generator" content="Docutils 0.17.1: http://docutils.sourceforge.net/" />
<title>FAQ — OpenPifPaf Guide</title>
<!-- Loaded before other Sphinx assets -->
<link href="_static/styles/theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
<link href="_static/styles/pydata-sphinx-theme.css?digest=1999514e3f237ded88cf" rel="stylesheet">
<link rel="stylesheet"
href="_static/vendor/fontawesome/5.13.0/css/all.min.css">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-solid-900.woff2">
<link rel="preload" as="font" type="font/woff2" crossorigin
href="_static/vendor/fontawesome/5.13.0/webfonts/fa-brands-400.woff2">
<link rel="stylesheet" type="text/css" href="_static/pygments.css" />
<link rel="stylesheet" href="_static/styles/sphinx-book-theme.css?digest=5115cc725059bd94278eecd172e13a965bf8f5a9" type="text/css" />
<link rel="stylesheet" type="text/css" href="_static/togglebutton.css" />
<link rel="stylesheet" type="text/css" href="_static/copybutton.css" />
<link rel="stylesheet" type="text/css" href="_static/mystnb.css" />
<link rel="stylesheet" type="text/css" href="_static/sphinx-thebe.css" />
<link rel="stylesheet" type="text/css" href="_static/mystyle.css" />
<link rel="stylesheet" type="text/css" href="_static/design-style.b7bb847fb20b106c3d81b95245e65545.min.css" />
<!-- Pre-loaded scripts that we'll load fully later -->
<link rel="preload" as="script" href="_static/scripts/pydata-sphinx-theme.js?digest=1999514e3f237ded88cf">
<script data-url_root="./" id="documentation_options" src="_static/documentation_options.js"></script>
<script src="_static/jquery.js"></script>
<script src="_static/underscore.js"></script>
<script src="_static/doctools.js"></script>
<script src="_static/clipboard.min.js"></script>
<script src="_static/copybutton.js"></script>
<script src="_static/scripts/sphinx-book-theme.js?digest=9c920249402e914e316237a7dbc6769907cce411"></script>
<script>let toggleHintShow = 'Click to show';</script>
<script>let toggleHintHide = 'Click to hide';</script>
<script>let toggleOpenOnPrint = 'true';</script>
<script src="_static/togglebutton.js"></script>
<script>var togglebuttonSelector = '.toggle, .admonition.dropdown, .tag_hide_input div.cell_input, .tag_hide-input div.cell_input, .tag_hide_output div.cell_output, .tag_hide-output div.cell_output, .tag_hide_cell.cell, .tag_hide-cell.cell';</script>
<script src="_static/design-tabs.js"></script>
<script>const THEBE_JS_URL = "https://unpkg.com/thebe@0.8.2/lib/index.js"
const thebe_selector = ".thebe,.cell"
const thebe_selector_input = "pre"
const thebe_selector_output = ".output, .cell_output"
</script>
<script async="async" src="_static/sphinx-thebe.js"></script>
<link rel="shortcut icon" href="_static/favicon.png"/>
<link rel="index" title="Index" href="genindex.html" />
<link rel="search" title="Search" href="search.html" />
<link rel="next" title="Custom Dataset" href="plugins_custom.html" />
<link rel="prev" title="Plugins" href="plugins_overview.html" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<meta name="docsearch:language" content="en">
<!-- Google Analytics -->
</head>
<body data-spy="scroll" data-target="#bd-toc-nav" data-offset="60">
<!-- Checkboxes to toggle the left sidebar -->
<input type="checkbox" class="sidebar-toggle" name="__navigation" id="__navigation" aria-label="Toggle navigation sidebar">
<label class="overlay overlay-navbar" for="__navigation">
<div class="visually-hidden">Toggle navigation sidebar</div>
</label>
<!-- Checkboxes to toggle the in-page toc -->
<input type="checkbox" class="sidebar-toggle" name="__page-toc" id="__page-toc" aria-label="Toggle in-page Table of Contents">
<label class="overlay overlay-pagetoc" for="__page-toc">
<div class="visually-hidden">Toggle in-page Table of Contents</div>
</label>
<!-- Headers at the top -->
<div class="announcement header-item noprint"></div>
<div class="header header-item noprint"></div>
<div class="container-fluid" id="banner"></div>
<div class="container-xl">
<div class="row">
<!-- Sidebar -->
<div class="bd-sidebar noprint" id="site-navigation">
<div class="bd-sidebar__content">
<div class="bd-sidebar__top"><div class="navbar-brand-box">
<a class="navbar-brand text-wrap" href="index.html">
<!-- `logo` is deprecated in Sphinx 4.0, so remove this when we stop supporting 3 -->
<img src="_static/logo.png" class="logo" alt="logo">
<h1 class="site-logo" id="site-title">OpenPifPaf Guide</h1>
</a>
</div><form class="bd-search d-flex align-items-center" action="search.html" method="get">
<i class="icon fas fa-search"></i>
<input type="search" class="form-control" name="q" id="search-input" placeholder="Search the docs ..." aria-label="Search the docs ..." autocomplete="off" >
</form><nav class="bd-links" id="bd-docs-nav" aria-label="Main">
<div class="bd-toc-item active">
<ul class="nav bd-sidenav bd-sidenav__home-link">
<li class="toctree-l1">
<a class="reference internal" href="intro.html">
Introduction
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Getting Started
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="predict_cli.html">
Prediction
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="examples.html">
Examples
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Chapters
</span>
</p>
<ul class="current nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="predict_api.html">
Prediction API
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="compute.html">
Compute
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="models.html">
Models
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="datasets.html">
Datasets
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="train.html">
Training
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="cli_help.html">
Command Line
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="plugins_overview.html">
Plugins
</a>
</li>
<li class="toctree-l1 current active">
<a class="current reference internal" href="#">
FAQ
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Tutorials
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="plugins_custom.html">
Custom Dataset
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="plugins_animalpose.html">
Animal Keypoints
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="plugins_wholebody.html">
WholeBody
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="plugins_apollocar3d.html">
Car Keypoints
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="plugins_crowdpose.html">
CrowdPose
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="plugins_nuscenes.html">
NuScenes 2D detection
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="tutorial_opencv.html">
OpenCV
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="plugins_cifar10.html">
Cifar10
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="plugins_extras.html">
Extras
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Reference
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="moduledocs.html">
Modules
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="bibliography.html">
Bibliography
</a>
</li>
</ul>
<p aria-level="2" class="caption" role="heading">
<span class="caption-text">
Development
</span>
</p>
<ul class="nav bd-sidenav">
<li class="toctree-l1">
<a class="reference internal" href="dev.html">
Contribute
</a>
</li>
<li class="toctree-l1">
<a class="reference internal" href="performance.html">
Performance
</a>
</li>
<li class="toctree-l1">
<a class="reference external" href="https://github.com/openpifpaf/openpifpaf">
GitHub
</a>
</li>
</ul>
</div>
</nav></div>
<div class="bd-sidebar__bottom">
<!-- To handle the deprecated key -->
</div>
</div>
<div id="rtd-footer-container"></div>
</div>
<!-- A tiny helper pixel to detect if we've scrolled -->
<div class="sbt-scroll-pixel-helper"></div>
<!-- Main content -->
<div class="col py-0 content-container">
<div class="header-article row sticky-top noprint">
<div class="col py-1 d-flex header-article-main">
<div class="header-article__left">
<label for="__navigation"
class="headerbtn"
data-toggle="tooltip"
data-placement="right"
title="Toggle navigation"
>
<span class="headerbtn__icon-container">
<i class="fas fa-bars"></i>
</span>
</label>
</div>
<div class="header-article__right">
<div class="menu-dropdown menu-dropdown-launch-buttons">
<button class="headerbtn menu-dropdown__trigger"
aria-label="Launch interactive content">
<i class="fas fa-rocket"></i>
</button>
<div class="menu-dropdown__content">
<ul>
<li>
<a href="https://mybinder.org/v2/gh/openpifpaf/openpifpaf/stable?urlpath=tree/guide/faq.ipynb"
class="headerbtn"
data-toggle="tooltip"
data-placement="left"
title="Launch on Binder"
>
<span class="headerbtn__icon-container">
<img src="_static/images/logo_binder.svg">
</span>
<span class="headerbtn__text-container">Binder</span>
</a>
</li>
</ul>
</div>
</div>
<div class="menu-dropdown menu-dropdown-repository-buttons">
<button class="headerbtn menu-dropdown__trigger"
aria-label="Source repositories">
<i class="fab fa-github"></i>
</button>
<div class="menu-dropdown__content">
<ul>
<li>
<a href="https://github.com/openpifpaf/openpifpaf"
class="headerbtn"
data-toggle="tooltip"
data-placement="left"
title="Source repository"
>
<span class="headerbtn__icon-container">
<i class="fab fa-github"></i>
</span>
<span class="headerbtn__text-container">repository</span>
</a>
</li>
<li>
<a href="https://github.com/openpifpaf/openpifpaf/issues/new?title=Issue%20on%20page%20%2Ffaq.html&body=Your%20issue%20content%20here."
class="headerbtn"
data-toggle="tooltip"
data-placement="left"
title="Open an issue"
>
<span class="headerbtn__icon-container">
<i class="fas fa-lightbulb"></i>
</span>
<span class="headerbtn__text-container">open issue</span>
</a>
</li>
<li>
<a href="https://github.com/openpifpaf/openpifpaf/edit/stable/guide/faq.ipynb"
class="headerbtn"
data-toggle="tooltip"
data-placement="left"
title="Edit this page"
>
<span class="headerbtn__icon-container">
<i class="fas fa-pencil-alt"></i>
</span>
<span class="headerbtn__text-container">suggest edit</span>
</a>
</li>
</ul>
</div>
</div>
<div class="menu-dropdown menu-dropdown-download-buttons">
<button class="headerbtn menu-dropdown__trigger"
aria-label="Download this page">
<i class="fas fa-download"></i>
</button>
<div class="menu-dropdown__content">
<ul>
<li>
<a href="_sources/faq.ipynb"
class="headerbtn"
data-toggle="tooltip"
data-placement="left"
title="Download source file"
>
<span class="headerbtn__icon-container">
<i class="fas fa-file"></i>
</span>
<span class="headerbtn__text-container">.ipynb</span>
</a>
</li>
<li>
<button onclick="printPdf(this)"
class="headerbtn"
data-toggle="tooltip"
data-placement="left"
title="Print to PDF"
>
<span class="headerbtn__icon-container">
<i class="fas fa-file-pdf"></i>
</span>
<span class="headerbtn__text-container">.pdf</span>
</button>
</li>
</ul>
</div>
</div>
<label for="__page-toc"
class="headerbtn headerbtn-page-toc"
>
<span class="headerbtn__icon-container">
<i class="fas fa-list"></i>
</span>
</label>
</div>
</div>
<!-- Table of contents -->
<div class="col-md-3 bd-toc show noprint">
<div class="tocsection onthispage pt-5 pb-3">
<i class="fas fa-list"></i> On this page
</div>
<nav id="bd-toc-nav" aria-label="Page">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#no-plot-appears">
No plot appears
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#why-evaluate-with-641px-instead-of-640px">
Why evaluate with 641px instead of 640px?
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#installation-problem">
Installation Problem
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#matplotlib-backend">
Matplotlib Backend
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#predict-is-slow">
Predict is slow
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#python-h-or-gcc-is-missing">
Python.h or gcc is missing
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#ssl-error">
SSL error
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#video-output-error-with-openpifpaf-video-command">
Video output error with openpifpaf.video command
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#further-resources">
Further resources
</a>
</li>
</ul>
</nav>
</div>
</div>
<div class="article row">
<div class="col pl-md-3 pl-lg-5 content-container">
<!-- Table of contents that is only displayed when printing the page -->
<div id="jb-print-docs-body" class="onlyprint">
<h1>FAQ</h1>
<!-- Table of contents -->
<div id="print-main-content">
<div id="jb-print-toc">
<div>
<h2> On this page </h2>
</div>
<nav aria-label="Page">
<ul class="visible nav section-nav flex-column">
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#no-plot-appears">
No plot appears
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#why-evaluate-with-641px-instead-of-640px">
Why evaluate with 641px instead of 640px?
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#installation-problem">
Installation Problem
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#matplotlib-backend">
Matplotlib Backend
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#predict-is-slow">
Predict is slow
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#python-h-or-gcc-is-missing">
Python.h or gcc is missing
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#ssl-error">
SSL error
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#video-output-error-with-openpifpaf-video-command">
Video output error with openpifpaf.video command
</a>
</li>
<li class="toc-h2 nav-item toc-entry">
<a class="reference internal nav-link" href="#further-resources">
Further resources
</a>
</li>
</ul>
</nav>
</div>
</div>
</div>
<main id="main-content" role="main">
<div>
<section class="tex2jax_ignore mathjax_ignore" id="faq">
<h1>FAQ<a class="headerlink" href="#faq" title="Permalink to this headline">#</a></h1>
<p>Frequently Asked Questions (FAQ).</p>
<section id="no-plot-appears">
<h2>No plot appears<a class="headerlink" href="#no-plot-appears" title="Permalink to this headline">#</a></h2>
<p>On the command line, add <code class="docutils literal notranslate"><span class="pre">--show</span></code>.
In Jupyter notebooks, use:</p>
<div class="highlight-default notranslate"><div class="highlight"><pre><span></span><span class="n">openpifpaf</span><span class="o">.</span><span class="n">show</span><span class="o">.</span><span class="n">Canvas</span><span class="o">.</span><span class="n">show</span> <span class="o">=</span> <span class="kc">True</span>
<span class="n">openpifpaf</span><span class="o">.</span><span class="n">show</span><span class="o">.</span><span class="n">Canvas</span><span class="o">.</span><span class="n">image_min_dpi</span> <span class="o">=</span> <span class="mi">200</span>
</pre></div>
</div>
</section>
<section id="why-evaluate-with-641px-instead-of-640px">
<h2>Why evaluate with 641px instead of 640px?<a class="headerlink" href="#why-evaluate-with-641px-instead-of-640px" title="Permalink to this headline">#</a></h2>
<p>OpenPifPaf uses the standard convention of PyTorch models to pad convolutions.
Let’s start with an example: a single layer of a 3x3 conv with stride 2 that is padded with 1. For an output feature map of size 2x2, the input must be of size 3x3. This generalization holds: the input must be of size <code class="docutils literal notranslate"><span class="pre">(nx</span> <span class="pre">*</span> <span class="pre">stride</span> <span class="pre">+</span> <span class="pre">1,</span> <span class="pre">ny</span> <span class="pre">*</span> <span class="pre">stride</span> <span class="pre">+</span> <span class="pre">1)</span></code>.
The models that OpenPifPaf uses have an intermediate layer with stride 16. Therefore, good input image sizes are multiples of 16 plus 1.</p>
<p>It is usually not a problem if the input size is not perfect. There will just be a small margin on the right side and bottom of the image that is not “covered” by a feature map cell.</p>
<p>For more info, see the section on <a class="reference internal" href="models.html#coordinate-system"><span class="std std-ref">Coordinate System</span></a>.</p>
</section>
<section id="installation-problem">
<h2>Installation Problem<a class="headerlink" href="#installation-problem" title="Permalink to this headline">#</a></h2>
<p>This project uses continuous integration testing (CI). That means that a set of
unit and integration tests is run on multiple versions of Linux, MacOSX and
Windows for every code change. The result of these tests is here:
<a class="reference external" href="https://github.com/openpifpaf/openpifpaf/actions/workflows/tests.yml">GitHub Action Tests</a>
and click on the latest test for the main branch to see something like this:</p>
<p><img alt="github action test overview" src="_images/githubtests.png" /></p>
<p>You can click on a build job to see its terminal output. The terminal output
shows all steps from cloning the repository, installing PyTorch, installing
OpenPifPaf to running linting and the actual tests.
If you think the list of platforms and Python versions is outdated and you want
a particular combination be added to this list, please file a
<a class="reference external" href="https://github.com/openpifpaf/openpifpaf/issues">GitHub issue</a>.</p>
</section>
<section id="matplotlib-backend">
<h2>Matplotlib Backend<a class="headerlink" href="#matplotlib-backend" title="Permalink to this headline">#</a></h2>
<p>I avoid any plotting on my training servers. However, if you insist on creating plots on the server, you might run into constraints of certain matplotlib backends not being available. If you have a backend that you know is working for your setup, you can select it by prepending any command, for example: <code class="docutils literal notranslate"><span class="pre">MPLBACKEND=agg</span> <span class="pre">python3</span> <span class="pre">-m</span> <span class="pre">openpifpaf.train</span> <span class="pre">...</span></code>. This would set the backend to <code class="docutils literal notranslate"><span class="pre">agg</span></code> but you can use something else. This works for all Python scripts that use matplotlib.</p>
<p>For video on MacOSX, an interactive GUI is required that can update in real-time. I use the matplotlib backend that is called “macosx” like this: <code class="docutils literal notranslate"><span class="pre">MPLBACKEND=macosx</span> <span class="pre">python</span> <span class="pre">-m</span> <span class="pre">openpifpaf.video</span> <span class="pre">--source=0</span> <span class="pre">--checkpoint=shufflenetv2k16</span> <span class="pre">--show</span> <span class="pre">--long-edge=161</span></code>.</p>
</section>
<section id="predict-is-slow">
<h2>Predict is slow<a class="headerlink" href="#predict-is-slow" title="Permalink to this headline">#</a></h2>
<p>Check whether your installation of PyTorch can access CUDA for GPU processing.
If the output of the command below is False, then PyTorch cannot make use of your GPU and OpenPifPaf falls back to CPU processing.</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="o">%%</span><span class="k">bash</span>
python -c "import torch; print(torch.cuda.is_available())"
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<div class="output stream highlight-myst-ansi notranslate"><div class="highlight"><pre><span></span>False
</pre></div>
</div>
</div>
</div>
<p>You can also run <code class="docutils literal notranslate"><span class="pre">predict</span></code> with the <code class="docutils literal notranslate"><span class="pre">--debug</span></code> option. Compare your output with the output in <a class="reference internal" href="predict_cli.html"><span class="doc">Prediction</span></a> to understand which part of the process is slow for you. For a fair comparison, also use <code class="docutils literal notranslate"><span class="pre">--disable-cuda</span></code> because the reference in this documentation is created without CUDA.</p>
</section>
<section id="python-h-or-gcc-is-missing">
<h2>Python.h or gcc is missing<a class="headerlink" href="#python-h-or-gcc-is-missing" title="Permalink to this headline">#</a></h2>
<p>On most systems, you should be able to use a binary wheel (a pre-built binary compilation) so that you don’t need to install from source.</p>
<p>Source installation might fail with an exception complaining about a missing <code class="docutils literal notranslate"><span class="pre">Python.h</span></code> file or missing <code class="docutils literal notranslate"><span class="pre">gcc</span></code>. This means that you need the development files for Python itself and a C compiler. On Ubuntu systems, you can get this with <code class="docutils literal notranslate"><span class="pre">sudo</span> <span class="pre">apt-get</span> <span class="pre">install</span> <span class="pre">python3-dev</span></code>. For more operating systems, there is a good <a class="reference external" href="https://stackoverflow.com/questions/21530577/fatal-error-python-h-no-such-file-or-directory">StackOverflow post</a> on the topic.</p>
</section>
<section id="ssl-error">
<h2>SSL error<a class="headerlink" href="#ssl-error" title="Permalink to this headline">#</a></h2>
<p>Your Python environment might not be able to do web requests. You can download a checkpoint yourself in the browser and run all examples with <code class="docutils literal notranslate"><span class="pre">--checkpoint</span> <span class="pre"><pathtoyourcheckpoint></span></code> command line argument.</p>
</section>
<section id="video-output-error-with-openpifpaf-video-command">
<h2>Video output error with openpifpaf.video command<a class="headerlink" href="#video-output-error-with-openpifpaf-video-command" title="Permalink to this headline">#</a></h2>
<p>Sometimes your system’s ffmpeg codecs are not set up. Check that you can run
<code class="docutils literal notranslate"><span class="pre">ffmpeg</span> <span class="pre">-codecs</span></code> and that you have an <code class="docutils literal notranslate"><span class="pre">h264</span></code> encoder installed. In addition,
the below code is a minimal matplotlib example to write a video output
that should run without errors on your system:</p>
<div class="cell docutils container">
<div class="cell_input docutils container">
<div class="highlight-ipython3 notranslate"><div class="highlight"><pre><span></span><span class="kn">import</span> <span class="nn">matplotlib.animation</span>
<span class="kn">import</span> <span class="nn">matplotlib.pyplot</span> <span class="k">as</span> <span class="nn">plt</span>
<span class="n">writer</span> <span class="o">=</span> <span class="n">matplotlib</span><span class="o">.</span><span class="n">animation</span><span class="o">.</span><span class="n">writers</span><span class="p">[</span><span class="s1">'ffmpeg'</span><span class="p">](</span><span class="n">fps</span><span class="o">=</span><span class="mf">10.0</span><span class="p">)</span>
<span class="n">fig</span><span class="p">,</span> <span class="n">ax</span> <span class="o">=</span> <span class="n">plt</span><span class="o">.</span><span class="n">subplots</span><span class="p">(</span><span class="mi">1</span><span class="p">,</span> <span class="mi">1</span><span class="p">)</span>
<span class="n">writer</span><span class="o">.</span><span class="n">setup</span><span class="p">(</span><span class="n">fig</span><span class="p">,</span> <span class="s1">'test_animation_output.mp4'</span><span class="p">)</span>
<span class="n">writer</span><span class="o">.</span><span class="n">grab_frame</span><span class="p">()</span>
<span class="n">writer</span><span class="o">.</span><span class="n">finish</span><span class="p">()</span>
</pre></div>
</div>
</div>
<div class="cell_output docutils container">
<img alt="_images/faq_11_0.png" src="_images/faq_11_0.png" />
</div>
</div>
</section>
<section id="further-resources">
<h2>Further resources<a class="headerlink" href="#further-resources" title="Permalink to this headline">#</a></h2>
<p>If nothing helped, check out the system configuration that is printed in
the <a class="reference internal" href="dev.html#build-environment"><span class="std std-ref">dev/Build Environment</span></a> section. Run those
commands on your system and compare the outputs to see whether there are any
significant differences.</p>
<p>We also have many
<a class="reference external" href="https://github.com/openpifpaf/openpifpaf/issues?q=is%3Aissue+is%3Aclosed">closed issues</a>
that you can search on GitHub and that
might contain the answer you are looking for. Also feel free to open a new
issue and provide as much information as possible about your problem and
the environment you are running in.</p>
</section>
</section>
<script type="text/x-thebe-config">
{
requestKernel: true,
binderOptions: {
repo: "binder-examples/jupyter-stacks-datascience",
ref: "master",
},
codeMirrorConfig: {
theme: "abcdef",
mode: "python"
},
kernelOptions: {
kernelName: "python3",
path: "./."
},
predefinedOutput: true
}
</script>
<script>kernelName = 'python3'</script>
</div>
</main>
<footer class="footer-article noprint">
<!-- Previous / next buttons -->
<div class='prev-next-area'>
<a class='left-prev' id="prev-link" href="plugins_overview.html" title="previous page">
<i class="fas fa-angle-left"></i>
<div class="prev-next-info">
<p class="prev-next-subtitle">previous</p>
<p class="prev-next-title">Plugins</p>
</div>
</a>
<a class='right-next' id="next-link" href="plugins_custom.html" title="next page">
<div class="prev-next-info">
<p class="prev-next-subtitle">next</p>
<p class="prev-next-title">Custom Dataset</p>
</div>
<i class="fas fa-angle-right"></i>
</a>
</div>
</footer>
</div>
</div>
<div class="footer-content row">
<footer class="col footer"><p>
By <a href="https://www.svenkreiss.com">Sven Kreiss</a> and <a href="https://github.com/openpifpaf/openpifpaf/graphs/contributors">contributors</a>.<br/>
© Copyright 2020-2022.<br/>
<div class="extra_footer">
<p>Powered by <a href="https://jupyterbook.org/">Jupyter Book</a>.</p>
</div>
</p>
</footer>
</div>
</div>
</div>
</div>
<!-- Scripts loaded after <body> so the DOM is not blocked -->
<script src="_static/scripts/pydata-sphinx-theme.js?digest=1999514e3f237ded88cf"></script>
</body>
</html>