summaryrefslogtreecommitdiff
path: root/python-voxel51-eta.spec
blob: 0a04934dba8d066aeda0ef233d1ba9ec4294ba01 (plain)
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
%global _empty_manifest_terminate_build 0
Name:		python-voxel51-eta
Version:	0.9.0
Release:	1
Summary:	Extensible Toolkit for Analytics
License:	Apache
URL:		https://github.com/voxel51/eta
Source0:	https://mirrors.nju.edu.cn/pypi/web/packages/88/98/a6785b618d4a2e2c058bdb76a691a3de9578b902397c4792756eea900ee7/voxel51-eta-0.9.0.tar.gz
BuildArch:	noarch

Requires:	python3-argcomplete
Requires:	python3-dill
Requires:	python3-future
Requires:	python3-glob2
Requires:	python3-jsonlines
Requires:	python3-numpy
Requires:	python3-packaging
Requires:	python3-Pillow
Requires:	python3-py7zr
Requires:	python3-dateutil
Requires:	python3-pytz
Requires:	python3-rarfile
Requires:	python3-requests
Requires:	python3-retrying
Requires:	python3-six
Requires:	python3-scikit-image
Requires:	python3-sortedcontainers
Requires:	python3-tabulate
Requires:	python3-tzlocal
Requires:	python3-urllib3
Requires:	python3-opencv-python-headless
Requires:	python3-importlib-metadata
Requires:	python3-blockdiag
Requires:	python3-Sphinx
Requires:	python3-sphinxcontrib-napoleon
Requires:	python3-azure-identity
Requires:	python3-azure-storage-blob
Requires:	python3-boto3
Requires:	python3-google-api-python-client
Requires:	python3-google-cloud-storage
Requires:	python3-httplib2
Requires:	python3-pysftp

%description
<div align="center">

<h1>
    ETA: Extensible Toolkit for Analytics
</h1>

**An open and extensible computer vision, machine learning and video analytics
infrastructure.**

[![PyPI python](https://img.shields.io/pypi/pyversions/voxel51-eta)](https://pypi.org/project/voxel51-eta)
[![PyPI version](https://badge.fury.io/py/voxel51-eta.svg)](https://pypi.org/project/voxel51-eta)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Twitter](https://img.shields.io/twitter/follow/Voxel51?style=social)](https://twitter.com/voxel51)

<img src="https://user-images.githubusercontent.com/25985824/78944107-2d766c80-7a8b-11ea-8863-fcb4897eecb5.png" alt="eta-infrastructure.png" width="75%"/>

</div>

## Requirements

ETA is very portable:

-   Installable on Mac or Linux
-   Supports Python 3.6 or later
-   Supports TensorFlow 1.X and 2.X
-   Supports OpenCV 2.4+ and OpenCV 3.0+
-   Supports CPU-only and GPU-enabled installations
-   Supports CUDA 8, 9 and 10 for GPU installations

## Installation

You can install the latest release of ETA via `pip`:

```shell
pip install voxel51-eta
```

This will perform a [lite installation of ETA](#lite-installation). If you use
an ETA feature that requires additional dependencies (e.g., `ffmpeg` or
`tensorflow`), you will be prompted to install the relevant packages.

## Docker Installation

If you prefer to operate via Docker, see the
[Docker Build Guide](https://github.com/voxel51/eta/blob/develop/docs/docker_build_guide.md)
for simple instructions for building a Docker image with an ETA environment
installed.

## Installation from source

#### Step 0: Setup your Python environment

It is assumed that you already have
[Python installed](https://www.python.org/downloads) on your machine.

> **IMPORTANT:** ETA assumes that the version of Python that you intend to use
> is accessible via `python` and `pip` on your path. In particular, for Python
> 3 users, this means that you may need to alias `python3` and `pip3` to
> `python` and `pip`, respectively.

We strongly recommend that you install ETA
[in a virtual environment](https://github.com/voxel51/eta/blob/develop/docs/virtualenv_guide.md)
to maintain a clean workspace.

#### Step 1: Clone the repository

```shell
git clone https://github.com/voxel51/eta
cd eta
```

#### Step 2: Run the install script

```shell
bash install.bash
```

Note that the install script supports flags that control things like (on macOS)
whether `port` or `brew` is used to install packages. Run
`bash install.bash -h` for more information.

For Linux installs, the script inspects your system to see if CUDA is installed
via the `lspci` command. If CUDA is available, TensorFlow is installed with GPU
support.

The table below lists the version of TensorFlow that will be installed by the
installer, as recommended by the
[tested build configurations](https://www.tensorflow.org/install/source#tested_build_configurations):

| CUDA Version Found | TensorFlow Version Installed |
| ------------------ | ---------------------------- |
| CUDA 8             | `tensorflow-gpu~=1.4`        |
| CUDA 9             | `tensorflow-gpu~=1.12`       |
| CUDA 10            | `tensorflow-gpu~=1.15`       |
| Other CUDA         | `tensorflow-gpu~=1.15`       |
| No CUDA            | `tensorflow~=1.15`           |

> Note that ETA also supports TensorFlow 2.X. The only problems you may face
> when using ETA with TensorFlow 2 are when trying to run inference with
> [ETA models](https://github.com/voxel51/eta/blob/develop/eta/models/manifest.json)
> that only support TensorFlow 1. A notable case here are TF-slim models. In
> such cases, you should see an informative error message alerting you of the
> requirement mismatch.

### Lite installation

Some ETA users are only interested in using the core ETA library defined in the
`eta.core` package. In such cases, you can perform a lite installation using
the `-l` flag of the install script:

```shell
bash install.bash -l
```

Lite installation omits submodules and other large dependencies that are not
required in order for the core library to function. If you use an ETA feature
that requires additional dependencies (e.g., `ffmpeg` or `tensorflow`), you
will be prompted to install the relevant packages.

### Developer installation

If you are interested in contributing to ETA or generating its documentation
from source, you should perform a developer installation using the `-d` flag of
the install script:

```shell
bash install.bash -d
```

## Setting up your execution environment

When the root `eta` package is imported, it tries to read the `eta/config.json`
file to configure various package-level constants. Many advanced ETA features
such as pipeline building, model management, etc. require a properly configured
environment to function.

To setup your environment, create a copy the example configuration file:

```shell
cp config-example.json eta/config.json
```

If desired, you can edit your config file to customize the various paths,
change default constants, add environment variables, customize your default
`PYTHONPATH`, and so on. You can also add additional paths to the
`module_dirs`, `pipeline_dirs`, and `models_dirs` sections to expose custom
modules, pipelines, and models to your system.

Note that, when the config file is loaded, any `{{eta}}` patterns in directory
paths are replaced with the absolute path to the `eta/` directory on your
machine.

The default config includes the `modules/`, `pipelines/`, and `models/`
directories on your module, pipeline, and models search paths, respectively.
These directories contain the necessary information to run the standard
analytics exposed by the ETA library. In addition, the relative paths
`./modules/`, `./pipelines/`, and `./models/` are added to their respective
paths to support the typical directory structure that we adopt for our custom
projects.

### CLI

Installing ETA automatically installs `eta`, a command-line interface (CLI) for
interacting with the ETA Library. This utility provides access to many useful
features of ETA, including building and running pipelines, downloading models,
and interacting with remote storage.

To explore the CLI, type `eta --help`, and see the
[CLI Guide](https://github.com/voxel51/eta/blob/develop/docs/cli_guide.md) for
complete information.

## Quickstart

Get your feet wet with ETA by running some of examples in the
[examples folder](https://github.com/voxel51/eta/tree/develop/eta/examples).

Also, see the [docs folder](https://github.com/voxel51/eta/tree/develop/docs)
for more documentation about the various components of the ETA library.

## Organization

The ETA package is organized as described below. For more information about the
design and function of the various ETA components, read the documentation in
the [docs folder](https://github.com/voxel51/eta/tree/develop/docs).

| Directory         | Description                                                                                                                                                                                                                                                                                  |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `eta/classifiers` | wrappers for performing inference with common classifiers                                                                                                                                                                                                                                    |
| `eta/core`        | the core ETA library, which includes utilities for working with images, videos, embeddings, and much more                                                                                                                                                                                    |
| `eta/detectors`   | wrappers for performing inference with common detectors                                                                                                                                                                                                                                      |
| `eta/docs`        | documentation about the ETA library                                                                                                                                                                                                                                                          |
| `eta/examples`    | examples of using the ETA library                                                                                                                                                                                                                                                            |
| `eta/models`      | library of ML models. The `manifest.json` file in this folder enumerates the models, which are downloaded to this folder as needed. See the [Models developer's guide](https://github.com/voxel51/eta/blob/develop/docs/models_dev_guide.md) for more information about ETA's model registry |
| `eta/modules`     | library of video processing/analytics modules. See the [Module developer's guide](https://github.com/voxel51/eta/blob/develop/docs/modules_dev_guide.md) for more information about ETA modules                                                                                              |
| `eta/pipelines`   | library of video processing/analytics pipelines. See the [Pipeline developer's guide](https://github.com/voxel51/eta/blob/develop/docs/pipelines_dev_guide.md) for more information about ETA pipelines                                                                                      |
| `eta/resources`   | resources such as media, templates, etc                                                                                                                                                                                                                                                      |
| `eta/segmenters`  | wrappers for performing inference with common semantic segmenters                                                                                                                                                                                                                            |
| `eta/tensorflow`  | third-party TensorFlow repositories that ETA builds upon                                                                                                                                                                                                                                     |

## Generating Documentation

This project uses
[Sphinx-Napoleon](https://pypi.python.org/pypi/sphinxcontrib-napoleon) to
generate its documentation from source.

To generate the documentation, you must install the developer dependencies by
running the `install.bash` script with the `-d` flag.

Then you can generate the docs by running:

```shell
bash sphinx/generate_docs.bash
```

To view the documentation, open the `sphinx/build/html/index.html` file in your
browser.

## Uninstallation

```shell
pip uninstall voxel51-eta
```

## Acknowledgements

This project was gratefully supported by the
[NIST Public Safety Innovation Accelerator Program](https://www.nist.gov/news-events/news/2017/06/nist-awards-385-million-accelerate-public-safety-communications).

## Citation

If you use ETA in your research, feel free to cite the project (but only if you
love it 😊):

```bibtex
@article{moore2017eta,
  title={ETA: Extensible Toolkit for Analytics},
  author={Moore, B. E. and Corso, J. J.},
  journal={GitHub. Note: https://github.com/voxel51/eta},
  year={2017}
}
```


%package -n python3-voxel51-eta
Summary:	Extensible Toolkit for Analytics
Provides:	python-voxel51-eta
BuildRequires:	python3-devel
BuildRequires:	python3-setuptools
BuildRequires:	python3-pip
%description -n python3-voxel51-eta
<div align="center">

<h1>
    ETA: Extensible Toolkit for Analytics
</h1>

**An open and extensible computer vision, machine learning and video analytics
infrastructure.**

[![PyPI python](https://img.shields.io/pypi/pyversions/voxel51-eta)](https://pypi.org/project/voxel51-eta)
[![PyPI version](https://badge.fury.io/py/voxel51-eta.svg)](https://pypi.org/project/voxel51-eta)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Twitter](https://img.shields.io/twitter/follow/Voxel51?style=social)](https://twitter.com/voxel51)

<img src="https://user-images.githubusercontent.com/25985824/78944107-2d766c80-7a8b-11ea-8863-fcb4897eecb5.png" alt="eta-infrastructure.png" width="75%"/>

</div>

## Requirements

ETA is very portable:

-   Installable on Mac or Linux
-   Supports Python 3.6 or later
-   Supports TensorFlow 1.X and 2.X
-   Supports OpenCV 2.4+ and OpenCV 3.0+
-   Supports CPU-only and GPU-enabled installations
-   Supports CUDA 8, 9 and 10 for GPU installations

## Installation

You can install the latest release of ETA via `pip`:

```shell
pip install voxel51-eta
```

This will perform a [lite installation of ETA](#lite-installation). If you use
an ETA feature that requires additional dependencies (e.g., `ffmpeg` or
`tensorflow`), you will be prompted to install the relevant packages.

## Docker Installation

If you prefer to operate via Docker, see the
[Docker Build Guide](https://github.com/voxel51/eta/blob/develop/docs/docker_build_guide.md)
for simple instructions for building a Docker image with an ETA environment
installed.

## Installation from source

#### Step 0: Setup your Python environment

It is assumed that you already have
[Python installed](https://www.python.org/downloads) on your machine.

> **IMPORTANT:** ETA assumes that the version of Python that you intend to use
> is accessible via `python` and `pip` on your path. In particular, for Python
> 3 users, this means that you may need to alias `python3` and `pip3` to
> `python` and `pip`, respectively.

We strongly recommend that you install ETA
[in a virtual environment](https://github.com/voxel51/eta/blob/develop/docs/virtualenv_guide.md)
to maintain a clean workspace.

#### Step 1: Clone the repository

```shell
git clone https://github.com/voxel51/eta
cd eta
```

#### Step 2: Run the install script

```shell
bash install.bash
```

Note that the install script supports flags that control things like (on macOS)
whether `port` or `brew` is used to install packages. Run
`bash install.bash -h` for more information.

For Linux installs, the script inspects your system to see if CUDA is installed
via the `lspci` command. If CUDA is available, TensorFlow is installed with GPU
support.

The table below lists the version of TensorFlow that will be installed by the
installer, as recommended by the
[tested build configurations](https://www.tensorflow.org/install/source#tested_build_configurations):

| CUDA Version Found | TensorFlow Version Installed |
| ------------------ | ---------------------------- |
| CUDA 8             | `tensorflow-gpu~=1.4`        |
| CUDA 9             | `tensorflow-gpu~=1.12`       |
| CUDA 10            | `tensorflow-gpu~=1.15`       |
| Other CUDA         | `tensorflow-gpu~=1.15`       |
| No CUDA            | `tensorflow~=1.15`           |

> Note that ETA also supports TensorFlow 2.X. The only problems you may face
> when using ETA with TensorFlow 2 are when trying to run inference with
> [ETA models](https://github.com/voxel51/eta/blob/develop/eta/models/manifest.json)
> that only support TensorFlow 1. A notable case here are TF-slim models. In
> such cases, you should see an informative error message alerting you of the
> requirement mismatch.

### Lite installation

Some ETA users are only interested in using the core ETA library defined in the
`eta.core` package. In such cases, you can perform a lite installation using
the `-l` flag of the install script:

```shell
bash install.bash -l
```

Lite installation omits submodules and other large dependencies that are not
required in order for the core library to function. If you use an ETA feature
that requires additional dependencies (e.g., `ffmpeg` or `tensorflow`), you
will be prompted to install the relevant packages.

### Developer installation

If you are interested in contributing to ETA or generating its documentation
from source, you should perform a developer installation using the `-d` flag of
the install script:

```shell
bash install.bash -d
```

## Setting up your execution environment

When the root `eta` package is imported, it tries to read the `eta/config.json`
file to configure various package-level constants. Many advanced ETA features
such as pipeline building, model management, etc. require a properly configured
environment to function.

To setup your environment, create a copy the example configuration file:

```shell
cp config-example.json eta/config.json
```

If desired, you can edit your config file to customize the various paths,
change default constants, add environment variables, customize your default
`PYTHONPATH`, and so on. You can also add additional paths to the
`module_dirs`, `pipeline_dirs`, and `models_dirs` sections to expose custom
modules, pipelines, and models to your system.

Note that, when the config file is loaded, any `{{eta}}` patterns in directory
paths are replaced with the absolute path to the `eta/` directory on your
machine.

The default config includes the `modules/`, `pipelines/`, and `models/`
directories on your module, pipeline, and models search paths, respectively.
These directories contain the necessary information to run the standard
analytics exposed by the ETA library. In addition, the relative paths
`./modules/`, `./pipelines/`, and `./models/` are added to their respective
paths to support the typical directory structure that we adopt for our custom
projects.

### CLI

Installing ETA automatically installs `eta`, a command-line interface (CLI) for
interacting with the ETA Library. This utility provides access to many useful
features of ETA, including building and running pipelines, downloading models,
and interacting with remote storage.

To explore the CLI, type `eta --help`, and see the
[CLI Guide](https://github.com/voxel51/eta/blob/develop/docs/cli_guide.md) for
complete information.

## Quickstart

Get your feet wet with ETA by running some of examples in the
[examples folder](https://github.com/voxel51/eta/tree/develop/eta/examples).

Also, see the [docs folder](https://github.com/voxel51/eta/tree/develop/docs)
for more documentation about the various components of the ETA library.

## Organization

The ETA package is organized as described below. For more information about the
design and function of the various ETA components, read the documentation in
the [docs folder](https://github.com/voxel51/eta/tree/develop/docs).

| Directory         | Description                                                                                                                                                                                                                                                                                  |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `eta/classifiers` | wrappers for performing inference with common classifiers                                                                                                                                                                                                                                    |
| `eta/core`        | the core ETA library, which includes utilities for working with images, videos, embeddings, and much more                                                                                                                                                                                    |
| `eta/detectors`   | wrappers for performing inference with common detectors                                                                                                                                                                                                                                      |
| `eta/docs`        | documentation about the ETA library                                                                                                                                                                                                                                                          |
| `eta/examples`    | examples of using the ETA library                                                                                                                                                                                                                                                            |
| `eta/models`      | library of ML models. The `manifest.json` file in this folder enumerates the models, which are downloaded to this folder as needed. See the [Models developer's guide](https://github.com/voxel51/eta/blob/develop/docs/models_dev_guide.md) for more information about ETA's model registry |
| `eta/modules`     | library of video processing/analytics modules. See the [Module developer's guide](https://github.com/voxel51/eta/blob/develop/docs/modules_dev_guide.md) for more information about ETA modules                                                                                              |
| `eta/pipelines`   | library of video processing/analytics pipelines. See the [Pipeline developer's guide](https://github.com/voxel51/eta/blob/develop/docs/pipelines_dev_guide.md) for more information about ETA pipelines                                                                                      |
| `eta/resources`   | resources such as media, templates, etc                                                                                                                                                                                                                                                      |
| `eta/segmenters`  | wrappers for performing inference with common semantic segmenters                                                                                                                                                                                                                            |
| `eta/tensorflow`  | third-party TensorFlow repositories that ETA builds upon                                                                                                                                                                                                                                     |

## Generating Documentation

This project uses
[Sphinx-Napoleon](https://pypi.python.org/pypi/sphinxcontrib-napoleon) to
generate its documentation from source.

To generate the documentation, you must install the developer dependencies by
running the `install.bash` script with the `-d` flag.

Then you can generate the docs by running:

```shell
bash sphinx/generate_docs.bash
```

To view the documentation, open the `sphinx/build/html/index.html` file in your
browser.

## Uninstallation

```shell
pip uninstall voxel51-eta
```

## Acknowledgements

This project was gratefully supported by the
[NIST Public Safety Innovation Accelerator Program](https://www.nist.gov/news-events/news/2017/06/nist-awards-385-million-accelerate-public-safety-communications).

## Citation

If you use ETA in your research, feel free to cite the project (but only if you
love it 😊):

```bibtex
@article{moore2017eta,
  title={ETA: Extensible Toolkit for Analytics},
  author={Moore, B. E. and Corso, J. J.},
  journal={GitHub. Note: https://github.com/voxel51/eta},
  year={2017}
}
```


%package help
Summary:	Development documents and examples for voxel51-eta
Provides:	python3-voxel51-eta-doc
%description help
<div align="center">

<h1>
    ETA: Extensible Toolkit for Analytics
</h1>

**An open and extensible computer vision, machine learning and video analytics
infrastructure.**

[![PyPI python](https://img.shields.io/pypi/pyversions/voxel51-eta)](https://pypi.org/project/voxel51-eta)
[![PyPI version](https://badge.fury.io/py/voxel51-eta.svg)](https://pypi.org/project/voxel51-eta)
[![pre-commit](https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white)](https://github.com/pre-commit/pre-commit)
[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](LICENSE)
[![Twitter](https://img.shields.io/twitter/follow/Voxel51?style=social)](https://twitter.com/voxel51)

<img src="https://user-images.githubusercontent.com/25985824/78944107-2d766c80-7a8b-11ea-8863-fcb4897eecb5.png" alt="eta-infrastructure.png" width="75%"/>

</div>

## Requirements

ETA is very portable:

-   Installable on Mac or Linux
-   Supports Python 3.6 or later
-   Supports TensorFlow 1.X and 2.X
-   Supports OpenCV 2.4+ and OpenCV 3.0+
-   Supports CPU-only and GPU-enabled installations
-   Supports CUDA 8, 9 and 10 for GPU installations

## Installation

You can install the latest release of ETA via `pip`:

```shell
pip install voxel51-eta
```

This will perform a [lite installation of ETA](#lite-installation). If you use
an ETA feature that requires additional dependencies (e.g., `ffmpeg` or
`tensorflow`), you will be prompted to install the relevant packages.

## Docker Installation

If you prefer to operate via Docker, see the
[Docker Build Guide](https://github.com/voxel51/eta/blob/develop/docs/docker_build_guide.md)
for simple instructions for building a Docker image with an ETA environment
installed.

## Installation from source

#### Step 0: Setup your Python environment

It is assumed that you already have
[Python installed](https://www.python.org/downloads) on your machine.

> **IMPORTANT:** ETA assumes that the version of Python that you intend to use
> is accessible via `python` and `pip` on your path. In particular, for Python
> 3 users, this means that you may need to alias `python3` and `pip3` to
> `python` and `pip`, respectively.

We strongly recommend that you install ETA
[in a virtual environment](https://github.com/voxel51/eta/blob/develop/docs/virtualenv_guide.md)
to maintain a clean workspace.

#### Step 1: Clone the repository

```shell
git clone https://github.com/voxel51/eta
cd eta
```

#### Step 2: Run the install script

```shell
bash install.bash
```

Note that the install script supports flags that control things like (on macOS)
whether `port` or `brew` is used to install packages. Run
`bash install.bash -h` for more information.

For Linux installs, the script inspects your system to see if CUDA is installed
via the `lspci` command. If CUDA is available, TensorFlow is installed with GPU
support.

The table below lists the version of TensorFlow that will be installed by the
installer, as recommended by the
[tested build configurations](https://www.tensorflow.org/install/source#tested_build_configurations):

| CUDA Version Found | TensorFlow Version Installed |
| ------------------ | ---------------------------- |
| CUDA 8             | `tensorflow-gpu~=1.4`        |
| CUDA 9             | `tensorflow-gpu~=1.12`       |
| CUDA 10            | `tensorflow-gpu~=1.15`       |
| Other CUDA         | `tensorflow-gpu~=1.15`       |
| No CUDA            | `tensorflow~=1.15`           |

> Note that ETA also supports TensorFlow 2.X. The only problems you may face
> when using ETA with TensorFlow 2 are when trying to run inference with
> [ETA models](https://github.com/voxel51/eta/blob/develop/eta/models/manifest.json)
> that only support TensorFlow 1. A notable case here are TF-slim models. In
> such cases, you should see an informative error message alerting you of the
> requirement mismatch.

### Lite installation

Some ETA users are only interested in using the core ETA library defined in the
`eta.core` package. In such cases, you can perform a lite installation using
the `-l` flag of the install script:

```shell
bash install.bash -l
```

Lite installation omits submodules and other large dependencies that are not
required in order for the core library to function. If you use an ETA feature
that requires additional dependencies (e.g., `ffmpeg` or `tensorflow`), you
will be prompted to install the relevant packages.

### Developer installation

If you are interested in contributing to ETA or generating its documentation
from source, you should perform a developer installation using the `-d` flag of
the install script:

```shell
bash install.bash -d
```

## Setting up your execution environment

When the root `eta` package is imported, it tries to read the `eta/config.json`
file to configure various package-level constants. Many advanced ETA features
such as pipeline building, model management, etc. require a properly configured
environment to function.

To setup your environment, create a copy the example configuration file:

```shell
cp config-example.json eta/config.json
```

If desired, you can edit your config file to customize the various paths,
change default constants, add environment variables, customize your default
`PYTHONPATH`, and so on. You can also add additional paths to the
`module_dirs`, `pipeline_dirs`, and `models_dirs` sections to expose custom
modules, pipelines, and models to your system.

Note that, when the config file is loaded, any `{{eta}}` patterns in directory
paths are replaced with the absolute path to the `eta/` directory on your
machine.

The default config includes the `modules/`, `pipelines/`, and `models/`
directories on your module, pipeline, and models search paths, respectively.
These directories contain the necessary information to run the standard
analytics exposed by the ETA library. In addition, the relative paths
`./modules/`, `./pipelines/`, and `./models/` are added to their respective
paths to support the typical directory structure that we adopt for our custom
projects.

### CLI

Installing ETA automatically installs `eta`, a command-line interface (CLI) for
interacting with the ETA Library. This utility provides access to many useful
features of ETA, including building and running pipelines, downloading models,
and interacting with remote storage.

To explore the CLI, type `eta --help`, and see the
[CLI Guide](https://github.com/voxel51/eta/blob/develop/docs/cli_guide.md) for
complete information.

## Quickstart

Get your feet wet with ETA by running some of examples in the
[examples folder](https://github.com/voxel51/eta/tree/develop/eta/examples).

Also, see the [docs folder](https://github.com/voxel51/eta/tree/develop/docs)
for more documentation about the various components of the ETA library.

## Organization

The ETA package is organized as described below. For more information about the
design and function of the various ETA components, read the documentation in
the [docs folder](https://github.com/voxel51/eta/tree/develop/docs).

| Directory         | Description                                                                                                                                                                                                                                                                                  |
| ----------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `eta/classifiers` | wrappers for performing inference with common classifiers                                                                                                                                                                                                                                    |
| `eta/core`        | the core ETA library, which includes utilities for working with images, videos, embeddings, and much more                                                                                                                                                                                    |
| `eta/detectors`   | wrappers for performing inference with common detectors                                                                                                                                                                                                                                      |
| `eta/docs`        | documentation about the ETA library                                                                                                                                                                                                                                                          |
| `eta/examples`    | examples of using the ETA library                                                                                                                                                                                                                                                            |
| `eta/models`      | library of ML models. The `manifest.json` file in this folder enumerates the models, which are downloaded to this folder as needed. See the [Models developer's guide](https://github.com/voxel51/eta/blob/develop/docs/models_dev_guide.md) for more information about ETA's model registry |
| `eta/modules`     | library of video processing/analytics modules. See the [Module developer's guide](https://github.com/voxel51/eta/blob/develop/docs/modules_dev_guide.md) for more information about ETA modules                                                                                              |
| `eta/pipelines`   | library of video processing/analytics pipelines. See the [Pipeline developer's guide](https://github.com/voxel51/eta/blob/develop/docs/pipelines_dev_guide.md) for more information about ETA pipelines                                                                                      |
| `eta/resources`   | resources such as media, templates, etc                                                                                                                                                                                                                                                      |
| `eta/segmenters`  | wrappers for performing inference with common semantic segmenters                                                                                                                                                                                                                            |
| `eta/tensorflow`  | third-party TensorFlow repositories that ETA builds upon                                                                                                                                                                                                                                     |

## Generating Documentation

This project uses
[Sphinx-Napoleon](https://pypi.python.org/pypi/sphinxcontrib-napoleon) to
generate its documentation from source.

To generate the documentation, you must install the developer dependencies by
running the `install.bash` script with the `-d` flag.

Then you can generate the docs by running:

```shell
bash sphinx/generate_docs.bash
```

To view the documentation, open the `sphinx/build/html/index.html` file in your
browser.

## Uninstallation

```shell
pip uninstall voxel51-eta
```

## Acknowledgements

This project was gratefully supported by the
[NIST Public Safety Innovation Accelerator Program](https://www.nist.gov/news-events/news/2017/06/nist-awards-385-million-accelerate-public-safety-communications).

## Citation

If you use ETA in your research, feel free to cite the project (but only if you
love it 😊):

```bibtex
@article{moore2017eta,
  title={ETA: Extensible Toolkit for Analytics},
  author={Moore, B. E. and Corso, J. J.},
  journal={GitHub. Note: https://github.com/voxel51/eta},
  year={2017}
}
```


%prep
%autosetup -n voxel51-eta-0.9.0

%build
%py3_build

%install
%py3_install
install -d -m755 %{buildroot}/%{_pkgdocdir}
if [ -d doc ]; then cp -arf doc %{buildroot}/%{_pkgdocdir}; fi
if [ -d docs ]; then cp -arf docs %{buildroot}/%{_pkgdocdir}; fi
if [ -d example ]; then cp -arf example %{buildroot}/%{_pkgdocdir}; fi
if [ -d examples ]; then cp -arf examples %{buildroot}/%{_pkgdocdir}; fi
pushd %{buildroot}
if [ -d usr/lib ]; then
	find usr/lib -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/lib64 ]; then
	find usr/lib64 -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/bin ]; then
	find usr/bin -type f -printf "/%h/%f\n" >> filelist.lst
fi
if [ -d usr/sbin ]; then
	find usr/sbin -type f -printf "/%h/%f\n" >> filelist.lst
fi
touch doclist.lst
if [ -d usr/share/man ]; then
	find usr/share/man -type f -printf "/%h/%f.gz\n" >> doclist.lst
fi
popd
mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst .

%files -n python3-voxel51-eta -f filelist.lst
%dir %{python3_sitelib}/*

%files help -f doclist.lst
%{_docdir}/*

%changelog
* Tue Apr 25 2023 Python_Bot <Python_Bot@openeuler.org> - 0.9.0-1
- Package Spec generated