AI-Video-Boilerplate-Simple

AI-Video-Boilerplate-Simple

Simple AI Templates on Live Video

Stars: 57

Visit
 screenshot

AI-video-boilerplate-simple is a free Live AI Video boilerplate for testing out live video AI experiments. It includes a simple Flask server that serves files, supports live video from various sources, and integrates with Roboflow for AI vision. Users can use this template for projects, research, business ideas, and homework. It is lightweight and can be deployed on popular cloud platforms like Replit, Vercel, Digital Ocean, or Heroku.

README:

AI-video-boilerplate-simple

This is a completely free Live AI Video boilerplate (Simple) for you to play with.

Hosted on Heroku for a live demo here: https:///">simpleai.darefail.com</

Other Repos

AI Video Boilerplate Pro (scalable, dockerized, complete apps): https://github.com/DareFail/AI-Video-Boilerplate-Pro/

AI Video Boilerplate for Chrome Extensions: https://github.com/DareFail/AI-Video-Boilerplate-Chrome/

demo

Features

  • Backend: Simple Flask server, just serves files.

  • Live Video: From your webcam, desktop, browser tab, or a local .mp4 or .mov file

  • AI Vision: Integrated with Roboflow (sponsored project)

Getting Started

This is a template for testing out live video AI experiments. It is best used for projects, research, business ideas, and even homework.

It is an extremely lightweight flask server that can be uploaded to popular cloud platforms like Replit, Vercel, Digital Ocean, or Heroku.

Prerequisites

  1. Get a free API key from Roboflow to use their vision models.

  2. Create a .env file in the main directory


ROBOFLOW_API_KEY=YOUR_ROBOFLOW_KEY_HERE

# For the whiteboard, you need this key too
OPENAI_API_KEY=YOUR_OPENAI_API_KEY_HERE

Installation

  1. Clone the repo
git clone https://github.com/DareFail/AI-Video-Boilerplate-Simple.git

cd AI-Video-Boilerplate
  1. Install poetry
# via homebrew (mac)
brew install poetry

# PC
(Invoke-WebRequest -Uri https://install.python-poetry.org -UseBasicParsing).Content | Invoke-Expression
  1. Enter Poetry Shell (needed to install dependencies and run server)
poetry shell
  1. Install dependencies
poetry install
  1. Start the server
poetry run python main.py

Then go to localhost:8000 You can change the port it runs on in main.py

Included Templates

AI-Video-Boilerplate comes with a growing list of AI templates. They will always be linked on the homepage but you can also view their code in each top folder in the main directory like "Gaze" and "Template."

There is a static folder in the main directory but it is only used by the homepage folder. This is due to a quirk in flask.

To add your own app, the easiest way is to modify one of the existing ones.

If you want to make a brand new one to add to the repo, follow these steps: (Replace all {{APP_NAME_HERE}} with your new app name)

  1. Copy the XXXXX Template folder to the main directory and rename it
  2. In main.py, import your new folder name
"from  {{APP_NAME_HERE}}  import  {{APP_NAME_HERE}}"

app.register_blueprint({{APP_NAME_HERE}}, url_prefix='/{{UNIQUE_URL_HERE}}')
  1. In {{APP_NAME_HERE}}/__init__.py:
from flask import Blueprint

{{APP_NAME_HERE}}  = Blueprint('{{APP_NAME_HERE}}', __name__, template_folder='XXXXX', static_folder='static')

from . import  views
  1. In {{APP_NAME_HERE}}/views.py:
from flask import render_template
import  os
from . import  {{APP_NAME_HERE}}  

@{{APP_NAME_HERE}}.route('/')

def  index():
return render_template(
'{{APP_NAME_HERE}}/index.html',
ROBOFLOW_API_KEY=os.environ.get("ROBOFLOW_API_KEY")
)
  1. In {{APP_NAME_HERE}}/templates/{{APP_NAME_HERE}}/index.html:
# Swap out
# <link  rel="stylesheet"  href="{{ url_for('XXXXX.static', filename='styles.css') }}"  />
# with:
<link  rel="stylesheet"  href="{{ url_for('{{APP_NAME_HERE}}.static', filename='styles.css') }}"  />

and 
# Swap out 
#<script  src="{{ url_for('XXXXX.static', filename='script.js') }}"></script>
# with:
#<script  src="{{ url_for('{{APP_NAME_HERE}}.static', filename='script.js') }}"></script>

Easy Deployment

  • Replit: Can be used as is, just keep the .replit file
  • Digital Ocean
  • Vercel
  • Heroku: Enter the following commands and keep the Procfile
heroku buildpacks:clear                        
heroku buildpacks:add https://github.com/moneymeets/python-poetry-buildpack.git
heroku buildpacks:add heroku/python
heroku config:set PYTHON_RUNTIME_VERSION=3.10.0

Acknowledgements

  • Thanks to Roboflow for sponsoring this project. Get your free API key at: Roboflow

License

Distributed under the APACHE 2.0 License. See LICENSE for more information.

Contact (feel free to ask questions!)

Twitter: @darefailed

Youtube: How to Video coming soon

Project Link: https://github.com/DareFail/AI-Video-Boilerplate-Simple

For Tasks:

Click tags to check more tools for each tasks

For Jobs:

Alternative AI tools for AI-Video-Boilerplate-Simple

Similar Open Source Tools

For similar tasks

For similar jobs