Skip to content

Commit 8ed394c

Browse files
committed
Minor updates
- Converting README.md to README.rst for display on PyPI
1 parent 6e81ada commit 8ed394c

File tree

9 files changed

+134
-123
lines changed

9 files changed

+134
-123
lines changed

MANIFEST.in

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
include *.md
1+
include *.rst
22

33
include LICENSE

README.md

-107
This file was deleted.

README.rst

+120
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,120 @@
1+
Mydia
2+
=====
3+
4+
Read videos as numpy arrays, with a gamut of additional functionalities.
5+
6+
`Read the Documentation <https://mrinaljain17.github.io/mydia/>`__
7+
8+
Getting started
9+
---------------
10+
11+
*Let's read in a video*
12+
13+
.. code:: python
14+
15+
from mydia import Videos
16+
17+
video_path = r'./static/sample_video/bigbuckbunny.mp4'
18+
reader = Videos()
19+
20+
video = reader.read(video_path) # a tensor of shape (1, 132, 720, 1080, 3)
21+
22+
The tensor represents **1 video** having **132 frames**, with each frame
23+
having a width and height of 1080 and 720 pixels respectively. ``3``
24+
denotes the *RGB channels* of the video.
25+
26+
*Extracting only 9 frames (at equal intervals) from the entire video and
27+
resizing each frame to be 720 pixels in width and 480 pixels in height.*
28+
29+
.. code:: python
30+
31+
from mydia import Videos
32+
33+
video_path = r'./static/sample_video/bigbuckbunny.mp4'
34+
reader = Videos(target_size=(720, 480),
35+
num_frames=9)
36+
37+
video = reader.read(video_path) # a tensor of shape (1, 9, 480, 720, 3)
38+
39+
reader.plot(video[0]) # Plotting the frames of the video in a grid
40+
41+
.. figure:: https://github.com/MrinalJain17/mydia/raw/master/static/images/video_frames.PNG
42+
:alt: Video frames
43+
44+
45+
Hmm.. Let's read the same video in **gray scale**
46+
47+
.. code:: python
48+
49+
from mydia import Videos
50+
51+
video_path = r'./static/sample_video/bigbuckbunny.mp4'
52+
reader = Videos(target_size=(720, 480),
53+
to_gray=True,
54+
num_frames=9)
55+
56+
video = reader.read(video_path) # a tensor of shape (1, 9, 480, 720, 1)
57+
58+
reader.plot(video[0]) # Plotting the frames of the video in a grid
59+
60+
.. figure:: https://github.com/MrinalJain17/mydia/raw/master/static/images/video_frames_gray.PNG
61+
:alt: Video frames
62+
63+
Installation
64+
------------
65+
66+
- **Install Mydia from PyPI (recommended):**
67+
68+
.. code:: bash
69+
70+
pip install mydia
71+
72+
- **Alternatively, install from Github source:**
73+
74+
First, clone the repository.
75+
76+
.. code:: bash
77+
78+
git clone https://github.com/MrinalJain17/mydia.git
79+
80+
Then, build the module
81+
82+
.. code:: bash
83+
84+
cd mydia
85+
python setup.py install
86+
87+
Requirements
88+
------------
89+
90+
``Python 3.x`` (preferably from the `Anaconda Distribution <https://www.anaconda.com/download/>`__)
91+
92+
The program uses `Scikit-video <http://www.scikit-video.org/stable/>`__, which requires ``FFmpeg`` to be installed on the system.
93+
To install ``FFmpeg`` on your machine
94+
95+
For **Linux**:
96+
97+
::
98+
99+
$ sudo apt-get update
100+
$ sudo apt-get install libav-tools
101+
102+
For **Windows or MAC/OSX**:
103+
Download the required binaries from `here <https://www.ffmpeg.org/download.html>`__. Extract the zip file and add the location of binaries to the ``PATH`` variable
104+
105+
Additional Libraries to install:
106+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
107+
108+
Several libraries like `Numpy <http://www.numpy.org/>`__, `Pillow <https://python-imaging.github.io/>`__, `Matplotlib <https://matplotlib.org/>`__ etc., required for the package come pre-installed with the Anaconda distribution of Python.
109+
110+
Install the following extra packages (if not already installed):
111+
112+
`Scikit-video <http://www.scikit-video.org/stable/>`__
113+
::
114+
115+
pip install sk-video
116+
117+
`tqdm <https://pypi.python.org/pypi/tqdm#installation>`__ - Required for displaying the progress bar.
118+
::
119+
120+
pip install tqdm

docs/config.toml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
baseURL = "https://mrinaljain17.github.io/Mydia/"
1+
baseURL = "https://mrinaljain17.github.io/mydia/"
22
languageCode = "en-us"
33
title = "Mydia"
44

docs/content/Instructions/_index.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -9,20 +9,20 @@ weight: 1
99
* **Install Mydia from PyPI (recommended):**
1010

1111
```bash
12-
pip install Mydia
12+
pip install mydia
1313
```
1414

1515
* **Alternatively, install from Github source:**
1616

1717
First, clone the repository.
1818

1919
```bash
20-
git clone https://github.com/MrinalJain17/Mydia.git
20+
git clone https://github.com/MrinalJain17/mydia.git
2121
```
2222

2323
Then, build the module
2424

2525
```bash
26-
cd Mydia
26+
cd mydia
2727
python setup.py install
2828
```

docs/content/_index.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ video = reader.read(video_path) # a tensor of shape (1, 9, 480, 720, 3)
3737
reader.plot(video[0]) # Plotting the frames of the video in a grid
3838
```
3939

40-
![Video frames](https://github.com/MrinalJain17/Mydia/raw/master/static/images/video_frames.PNG)
40+
![Video frames](https://github.com/MrinalJain17/mydia/raw/master/static/images/video_frames.PNG)
4141

4242
*Hmm.. Let's read the same video in __gray scale__.*
4343

@@ -54,4 +54,4 @@ video = reader.read(video_path) # a tensor of shape (1, 9, 480, 720, 1)
5454
reader.plot(video[0]) # Plotting the frames of the video in a grid
5555
```
5656

57-
![Video frames](https://github.com/MrinalJain17/Mydia/raw/master/static/images/video_frames_gray.PNG)
57+
![Video frames](https://github.com/MrinalJain17/mydia/raw/master/static/images/video_frames_gray.PNG)

docs/layouts/partials/logo.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<h1 style="color: white">
2-
<a href="/Mydia">
2+
<a href="/mydia">
33
<svg xmlns="http://www.w3.org/2000/svg" width="40" height="40" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-video">
44
<polygon points="23 7 16 12 23 17 23 7"></polygon>
55
<rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect>
+1-1
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
<center>
2-
<h4><a href="https://github.com/MrinalJain17/Mydia.git" target="_blank"><i class="fa fa-github"></i> View on Github</a></h4>
2+
<h4><a href="https://github.com/MrinalJain17/mydia.git" target="_blank"><i class="fa fa-github"></i> View on Github</a></h4>
33
</center>

setup.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -5,16 +5,15 @@
55
here = path.abspath(path.dirname("."))
66

77
# Get the long description from the README file
8-
with open(path.join(here, "README.md"), encoding="utf-8") as f:
8+
with open(path.join(here, "README.rst"), encoding="utf-8") as f:
99
long_description = f.read()
1010

1111
setup(
1212
name="Mydia",
13-
version="1.0.1",
13+
version="1.0.2",
1414
description="Read videos as numpy arrays",
1515
long_description=long_description,
16-
long_description_content_type="text/markdown; charset=UTF-8; variant=GFM",
17-
url="https://mrinaljain17.github.io/Mydia/",
16+
url="https://mrinaljain17.github.io/mydia/",
1817
author="Mrinal Jain",
1918
author_email="[email protected]",
2019
license="MIT",
@@ -38,8 +37,7 @@
3837
],
3938
packages=find_packages(),
4039
project_urls={
41-
"Documentation": "https://mrinaljain17.github.io/Mydia/",
42-
"Bug Reports": "https://github.com/MrinalJain17/Mydia/issues",
43-
"Source": "https://github.com/MrinalJain17/Mydia",
40+
"Documentation": "https://mrinaljain17.github.io/mydia/",
41+
"Source": "https://github.com/MrinalJain17/mydia",
4442
},
4543
)

0 commit comments

Comments
 (0)