File tree 10 files changed +119
-9
lines changed
10 files changed +119
-9
lines changed Original file line number Diff line number Diff line change @@ -4,7 +4,7 @@ Reading videos into NumPy arrays was never more simple. This library provides
4
4
an entire range of additional functionalities such as custom frame selection,
5
5
frame resizing, pixel normalization, grayscale conversion and much more.
6
6
7
- [ Read the Documentation] ( https://mrinaljain17.github.io/mydia/html/index.html )
7
+ [ Read the Documentation] ( https://mrinaljain17.github.io/mydia )
8
8
9
9
## Getting started
10
10
@@ -38,13 +38,19 @@ The tensor can be interpreted as:
38
38
39
39
## Installation
40
40
41
- - ** Install Mydia from PyPI (recommended ):**
41
+ - ** Install from PyPI (Recommended ):**
42
42
43
43
``` bash
44
44
pip install mydia
45
45
```
46
46
47
- - ** Alternatively, install from Github source:**
47
+ - ** Install using conda package manager (Supported on Windows only)**
48
+
49
+ ` ` ` bash
50
+ conda install -c mrinaljain17 mydia
51
+ ` ` `
52
+
53
+ - ** Alternatively, install from source:**
48
54
49
55
First, clone the repository
50
56
Original file line number Diff line number Diff line change
1
+ # Conda Package Manager
2
+
3
+ Run the following commands from the directory ` conda_build/ ` to build conda distribution
4
+ of the package:
5
+
6
+ ``` bash
7
+ conda-build mydia --numpy 1.14.5 -c mrinaljain17
8
+ ```
9
+
10
+ Here, ` "mrinaljain17" ` is the channel from which ` ffmpeg-python ` is installed.
Original file line number Diff line number Diff line change
1
+ " %PYTHON% " setup.py install --single-version-externally-managed --record=record.txt
2
+ if errorlevel 1 exit 1
Original file line number Diff line number Diff line change
1
+ $PYTHON setup.py install --single-version-externally-managed --record=record.txt
Original file line number Diff line number Diff line change
1
+ {% set name = "ffmpeg-python" %}
2
+ {% set version = "0.1.16" %}
3
+
4
+ package :
5
+ name : " {{ name|lower }}"
6
+ version : " {{ version }}"
7
+
8
+ source :
9
+ url : https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
10
+ sha256 : 721db04120ad110619c17dd7a72db8d21a6738d721be1b3b4c72a7516e6b07f4
11
+
12
+ build :
13
+ number : 0
14
+ script : " {{ PYTHON }} -m pip install . --no-deps --ignore-installed -vvv "
15
+
16
+ requirements :
17
+ build :
18
+ - future
19
+ - pip
20
+ - setuptools
21
+ - python
22
+ - pytest-runner
23
+ run :
24
+ - future
25
+ - python
26
+
27
+ about :
28
+ home : https://github.com/kkroening/ffmpeg-python
29
+ license : Apache Software
30
+ license_family : APACHE
31
+ license_file :
32
+ summary : Python bindings for FFmpeg - with complex filtering support
33
+ doc_url :
34
+ dev_url :
Original file line number Diff line number Diff line change
1
+ " %PYTHON% " setup.py install --single-version-externally-managed --record=record.txt
2
+ if errorlevel 1 exit 1
Original file line number Diff line number Diff line change
1
+ $PYTHON setup.py install --single-version-externally-managed --record=record.txt
Original file line number Diff line number Diff line change
1
+ {% set name = "mydia" %}
2
+ {% set version = "2.1.1" %}
3
+
4
+ package :
5
+ name : " {{ name|lower }}"
6
+ version : " {{ version }}"
7
+
8
+ source :
9
+ url : https://pypi.io/packages/source/{{ name[0] }}/{{ name }}/{{ name }}-{{ version }}.tar.gz
10
+ sha256 : ef07ff6b0c17ddac6749ae6ce9e295a4799dfb14a951bc25ee56778b24684f9a
11
+
12
+ build :
13
+ number : 0
14
+ script : " {{ PYTHON }} -m pip install . --no-deps --ignore-installed -vvv "
15
+
16
+ requirements :
17
+ build :
18
+ - pip
19
+ - setuptools
20
+ - python
21
+ - ffmpeg-python
22
+ - numpy
23
+ - matplotlib
24
+ - tqdm
25
+ run :
26
+ - ffmpeg-python
27
+ - numpy
28
+ - tqdm
29
+ - matplotlib
30
+ - python
31
+
32
+ about :
33
+ home : https://github.com/MrinalJain17/mydia
34
+ license : MIT License
35
+ license_family : MIT
36
+ license_file :
37
+ summary : A simple and efficient wrapper for reading videos as NumPy tensors
38
+ doc_url : https://mrinaljain17.github.io/mydia/
39
+ dev_url :
Original file line number Diff line number Diff line change 1
1
Installation
2
2
------------
3
3
4
- - **Install Mydia from PyPI (recommended ): **
4
+ - **Install from PyPI (Recommended ): **
5
5
6
6
.. code :: bash
7
7
8
8
pip install mydia
9
9
10
- - **Alternatively, install from Github source: **
10
+ - **Install using conda package manager (Supported on Windows only) **
11
+
12
+ .. code :: bash
13
+
14
+ conda install -c mrinaljain17 mydia
15
+
16
+ - **Alternatively, install from source: **
11
17
12
18
First, clone the repository.
13
19
Original file line number Diff line number Diff line change 7
7
8
8
"""
9
9
10
- __version__ = "2.1.0 "
10
+ __version__ = "2.1.1 "
11
11
__author__ = "Mrinal Jain"
12
12
13
13
import warnings
@@ -263,11 +263,14 @@ def _probe(self, path):
263
263
264
264
return (fps , total_frames )
265
265
266
- def read (self , paths ):
266
+ def read (self , paths , verbose = 1 ):
267
267
"""Function to read videos
268
268
269
269
:param paths: A list of paths/path of the video(s) to be read.
270
270
:type paths: str or list[str]
271
+
272
+ :param verbose: If set to 0, the progress bar will be disabled.
273
+ :type verbose: int
271
274
272
275
:return:
273
276
A 5-dimensional tensor, whose shape will depend on the value of ``data_format``.
@@ -298,8 +301,14 @@ def read(self, paths):
298
301
paths = [paths ]
299
302
else :
300
303
raise ValueError ("Invalid value of 'paths'" )
301
-
302
- list_of_videos = [self ._read_video (path ) for path in tqdm (paths , unit = "videos" )]
304
+ disable = False
305
+ if verbose == 0 :
306
+ disable = True
307
+
308
+ list_of_videos = [
309
+ self ._read_video (path )
310
+ for path in tqdm (paths , unit = "videos" , disable = disable )
311
+ ]
303
312
video_tensor = np .vstack (list_of_videos )
304
313
305
314
if self .data_format == "channels_first" :
You can’t perform that action at this time.
0 commit comments