Giter Club home page Giter Club logo

videos-to-tfrecords's Introduction

videos-to-tfrecords

Library to convert video files to TFRecords using Apache Beam.

Note: This is not an officially supported Google product

Set up

Set up GCP credentials

gcloud auth login
gcloud auth application-default login
gcloud config set project {project-id}

If you will be running the pipeline on the Dataflow Runner, the service account key must be accessible to the Dataflow workers. So, the file should be copied from its local path to Google Cloud Storage.

gsutil cp {local-path-to-json} {cloud-storage-path-to-json}

Set up Python environment

python3 -m venv venv
source ./venv/bin/activate
pip install -r requirements.txt

Set up environment variables

PROJECT_ID={project-id}

Prepare video files (input data)

The Apache Beam pipeline will use Google Cloud Storage as the source.

Both the README and in the Bash scripts assume that you have created a GCS Bucket name gs://{project-id}. If you have not created this bucket yet, create it using the following gsutil command:

gsutil mb gs://{project-id}
gsutil -m cp -r gs://ugc-dataset/original_videos/* \
    gs://${PROJECT_ID}/videos-to-tfrecords/input/

Run Script

The Bash scripts below assume that you have created a GCS directory gs://{project-id}/videos-to-tfrecords/input/ which stores your training data.

Run locally

Running an Apache Beam pipeline locally can be helpful for testing and debugging. However, it's not recommended when working with a lot of data; use the Cloud Dataflow runner for Apache Beam instead.

bash bin/run.preprocess.sh {path-to-json}

Run on Cloud Dataflow

bash bin/run.preprocess.sh {cloud-storage-path-to-json} cloud

videos-to-tfrecords's People

Contributors

klmilam avatar

Watchers

James Cloos avatar Kostas Georgiou avatar  avatar

Forkers

sapphirine

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.