Coder Social home page Coder Social logo

renanmalv / cctv-encoder Goto Github PK

View Code? Open in Web Editor NEW
0.0 1.0 0.0 2.57 MB

Encoding and decoding algorithm for surveillance videos using SVD/PCA

License: GNU General Public License v3.0

Python 100.00%
background compression decoding encoding foreground optimization pca robust-pca sparse-matrix svd

cctv-encoder's Introduction

CCTV-Encoder

Encoding and decoding algorithm for raw surveillance videos using SVD/PCA

This project uses the Robust PCA algorithm. For the Robust PCA's optimization problem, we can use the Primary Component Pursuit Algorithm achieved by the The Augmented Lagrange Multiplier Method, decomposing a video in the form of a matrix into a sum of a low-rank and a sparse matrix.

For the SVD algorithm, We'll use Facebook's Fast Randomized PCA library.

Requirements

  • NumPy >= 2.0.0
  • SciPy >= 1.11.1
  • MoviePy >= 1.0.3
  • fbpca >= 1.0

Example

"""_summary_
	Demonstrating the usability of the lib
"""
from cctv_encoder import Encoder, Decoder

# Encode process

WORKDIR = "/workspaces/CCTV-Encoder/test_Files/CCTV/"

my_enc = Encoder(WORKDIR)

my_enc.set_precision(1e-2)
my_enc.set_quality(1)
my_enc.set_PCP_n_iter(7)

my_enc.encode(video_path = "CCTV_video.mp4")

# Decode process

decoder = Decoder(WORKDIR)

decoder.decode(encoded_file_path = WORKDIR + "CCTV_video.npz",
               out_file_name = "CCTV_video_foreground_decoded.mp4",
               composition = "foreground")

decoder.decode(encoded_file_path = WORKDIR + "CCTV_video.npz",
               out_file_name = "CCTV_video_background_decoded.mp4",
               composition = "background")

decoder.decode(encoded_file_path = WORKDIR + "CCTV_video.npz",
               out_file_name = "CCTV_video_decoded.mp4",
               composition = "both")

cctv-encoder's People

Contributors

renanmalv avatar

Watchers

 avatar

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.