diff --git a/README.md b/README.md index fdfc3ec..c564803 100644 --- a/README.md +++ b/README.md @@ -80,6 +80,19 @@ Further examples and use cases are found in the [accompanying Jupyter Notebook]( If no output folder is added, asks for confirmation and destructively crops images in-place. +#### Detecting faces from video files +You can use autocrop to detect faces in frames extracted from a video. A great way to [perform the frame extraction step is with `ffmpeg`](https://ffmpeg.org/download.html): + +```sh +mkdir frames faces + +# Extract one frame per second +ffmpeg -i input.mp4 -filter:v fps=fps=1/60 frames/ffmpeg_%0d.bmp + +# Crop faces as jpg +autocrop -i frames -o faces -e jpg +``` + ## Supported file types @@ -119,7 +132,7 @@ pip install . ~~~ ### conda -Development of a `conda-forge` package for the [Anaconda Python distribution](https://www.anaconda.com/download/) is also currently slated for development. Please leave feedback on [issue #7](https://github.com/leblancfg/autocrop/issues/7) if you are insterested in helping out. +Development of a `conda-forge` package for the [Anaconda Python distribution](https://www.anaconda.com/download/) is currently stalled due to the complexity of setting up the workflow with OpenCV. Please leave feedback on [issue #7](https://github.com/leblancfg/autocrop/issues/7) to see past attempts if you are insterested in helping out! ## Requirements Best practice for your projects is of course to [use virtual environments](http://docs.python-guide.org/en/latest/dev/virtualenvs/). At the very least, you will need to [have pip installed](https://pip.pypa.io/en/stable/installing/). diff --git a/tests/visual_tests.ipynb b/tests/visual_tests.ipynb index 4641c2e..b257711 100644 --- a/tests/visual_tests.ipynb +++ b/tests/visual_tests.ipynb @@ -2,7 +2,7 @@ "cells": [ { "cell_type": "code", - "execution_count": null, + "execution_count": 1, "metadata": { "ExecuteTime": { "end_time": "2020-03-23T19:44:29.134965Z", @@ -49,8 +49,7 @@ "metadata": {}, "output_type": "execute_result" } - }, - "outputs": [], + ], "source": [ "img_array = c.crop(loc)\n", "PIL.Image.fromarray(img_array)" @@ -58,16 +57,7 @@ }, { "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "PIL.Image.fromarray(c.crop(img_array))" - ] - }, - { - "cell_type": "code", - "execution_count": null, + "execution_count": 4, "metadata": { "ExecuteTime": { "end_time": "2020-03-23T19:44:37.012712Z", @@ -97,7 +87,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 5, "metadata": { "ExecuteTime": { "end_time": "2020-03-23T19:44:32.387838Z", @@ -122,7 +112,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 6, "metadata": { "ExecuteTime": { "end_time": "2020-03-23T19:44:32.604788Z", @@ -160,7 +150,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 7, "metadata": { "ExecuteTime": { "end_time": "2020-03-23T19:44:32.734430Z", @@ -198,7 +188,7 @@ }, { "cell_type": "code", - "execution_count": null, + "execution_count": 8, "metadata": { "ExecuteTime": { "end_time": "2020-03-23T19:44:35.895830Z", @@ -342,15 +332,6 @@ "## `_crop_postions`" ] }, - { - "cell_type": "code", - "execution_count": null, - "metadata": {}, - "outputs": [], - "source": [ - "## `_crop_postions`" - ] - }, { "cell_type": "code", "execution_count": 13, @@ -458,7 +439,7 @@ "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", - "version": "3.7.4" + "version": "3.8.0" } }, "nbformat": 4,