Skip to content

Commit

Permalink
Minor updates
Browse files Browse the repository at this point in the history
- Converting README.md to README.rst for display on PyPI
  • Loading branch information
MrinalJain17 committed Apr 14, 2018
1 parent 6e81ada commit 8ed394c
Show file tree
Hide file tree
Showing 9 changed files with 134 additions and 123 deletions.
2 changes: 1 addition & 1 deletion MANIFEST.in
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
include *.md
include *.rst

include LICENSE
107 changes: 0 additions & 107 deletions README.md

This file was deleted.

120 changes: 120 additions & 0 deletions README.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,120 @@
Mydia
=====

Read videos as numpy arrays, with a gamut of additional functionalities.

`Read the Documentation <https://mrinaljain17.github.io/mydia/>`__

Getting started
---------------

*Let's read in a video*

.. code:: python
from mydia import Videos
video_path = r'./static/sample_video/bigbuckbunny.mp4'
reader = Videos()
video = reader.read(video_path) # a tensor of shape (1, 132, 720, 1080, 3)
The tensor represents **1 video** having **132 frames**, with each frame
having a width and height of 1080 and 720 pixels respectively. ``3``
denotes the *RGB channels* of the video.

*Extracting only 9 frames (at equal intervals) from the entire video and
resizing each frame to be 720 pixels in width and 480 pixels in height.*

.. code:: python
from mydia import Videos
video_path = r'./static/sample_video/bigbuckbunny.mp4'
reader = Videos(target_size=(720, 480),
num_frames=9)
video = reader.read(video_path) # a tensor of shape (1, 9, 480, 720, 3)
reader.plot(video[0]) # Plotting the frames of the video in a grid
.. figure:: https://github.com/MrinalJain17/mydia/raw/master/static/images/video_frames.PNG
:alt: Video frames


Hmm.. Let's read the same video in **gray scale**

.. code:: python
from mydia import Videos
video_path = r'./static/sample_video/bigbuckbunny.mp4'
reader = Videos(target_size=(720, 480),
to_gray=True,
num_frames=9)
video = reader.read(video_path) # a tensor of shape (1, 9, 480, 720, 1)
reader.plot(video[0]) # Plotting the frames of the video in a grid
.. figure:: https://github.com/MrinalJain17/mydia/raw/master/static/images/video_frames_gray.PNG
:alt: Video frames

Installation
------------

- **Install Mydia from PyPI (recommended):**

.. code:: bash
pip install mydia
- **Alternatively, install from Github source:**

First, clone the repository.

.. code:: bash
git clone https://github.com/MrinalJain17/mydia.git
Then, build the module

.. code:: bash
cd mydia
python setup.py install
Requirements
------------

``Python 3.x`` (preferably from the `Anaconda Distribution <https://www.anaconda.com/download/>`__)

The program uses `Scikit-video <http://www.scikit-video.org/stable/>`__, which requires ``FFmpeg`` to be installed on the system.
To install ``FFmpeg`` on your machine

For **Linux**:

::

$ sudo apt-get update
$ sudo apt-get install libav-tools

For **Windows or MAC/OSX**:
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

Additional Libraries to install:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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.

Install the following extra packages (if not already installed):

`Scikit-video <http://www.scikit-video.org/stable/>`__
::

pip install sk-video

`tqdm <https://pypi.python.org/pypi/tqdm#installation>`__ - Required for displaying the progress bar.
::

pip install tqdm
2 changes: 1 addition & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
baseURL = "https://mrinaljain17.github.io/Mydia/"
baseURL = "https://mrinaljain17.github.io/mydia/"
languageCode = "en-us"
title = "Mydia"

Expand Down
6 changes: 3 additions & 3 deletions docs/content/Instructions/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,20 +9,20 @@ weight: 1
* **Install Mydia from PyPI (recommended):**

```bash
pip install Mydia
pip install mydia
```

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

First, clone the repository.

```bash
git clone https://github.com/MrinalJain17/Mydia.git
git clone https://github.com/MrinalJain17/mydia.git
```

Then, build the module

```bash
cd Mydia
cd mydia
python setup.py install
```
4 changes: 2 additions & 2 deletions docs/content/_index.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ video = reader.read(video_path) # a tensor of shape (1, 9, 480, 720, 3)
reader.plot(video[0]) # Plotting the frames of the video in a grid
```

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

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

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

![Video frames](https://github.com/MrinalJain17/Mydia/raw/master/static/images/video_frames_gray.PNG)
![Video frames](https://github.com/MrinalJain17/mydia/raw/master/static/images/video_frames_gray.PNG)
2 changes: 1 addition & 1 deletion docs/layouts/partials/logo.html
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<h1 style="color: white">
<a href="/Mydia">
<a href="/mydia">
<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">
<polygon points="23 7 16 12 23 17 23 7"></polygon>
<rect x="1" y="5" width="15" height="14" rx="2" ry="2"></rect>
Expand Down
2 changes: 1 addition & 1 deletion docs/layouts/partials/menu-footer.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<center>
<h4><a href="https://github.com/MrinalJain17/Mydia.git" target="_blank"><i class="fa fa-github"></i> View on Github</a></h4>
<h4><a href="https://github.com/MrinalJain17/mydia.git" target="_blank"><i class="fa fa-github"></i> View on Github</a></h4>
</center>
12 changes: 5 additions & 7 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,15 @@
here = path.abspath(path.dirname("."))

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

setup(
name="Mydia",
version="1.0.1",
version="1.0.2",
description="Read videos as numpy arrays",
long_description=long_description,
long_description_content_type="text/markdown; charset=UTF-8; variant=GFM",
url="https://mrinaljain17.github.io/Mydia/",
url="https://mrinaljain17.github.io/mydia/",
author="Mrinal Jain",
author_email="mrinaljain007@gmail.com",
license="MIT",
Expand All @@ -38,8 +37,7 @@
],
packages=find_packages(),
project_urls={
"Documentation": "https://mrinaljain17.github.io/Mydia/",
"Bug Reports": "https://github.com/MrinalJain17/Mydia/issues",
"Source": "https://github.com/MrinalJain17/Mydia",
"Documentation": "https://mrinaljain17.github.io/mydia/",
"Source": "https://github.com/MrinalJain17/mydia",
},
)

0 comments on commit 8ed394c

Please sign in to comment.