Skip to content

Commit

Permalink
update a LOT
Browse files Browse the repository at this point in the history
update a LOT
  • Loading branch information
Trentonom0r3 committed Oct 20, 2024
1 parent 5442b79 commit 3a6a227
Show file tree
Hide file tree
Showing 24 changed files with 1,966 additions and 50 deletions.
70 changes: 70 additions & 0 deletions .github/workflows/createRelease.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,21 @@
# .github/workflows/release_and_benchmark.yaml

name: Release and Benchmark Tests

on:
push:
branches: [master]
paths:
- 'build.py'
- 'CMakeLists.txt'
- 'CMakePresets.json'
- 'cpusetup.py'
- 'gpusetup.py'
- 'README.md'
- 'LICENSE'
- 'tests/**'
- 'scripts/**'
- '.github/workflows/release_and_benchmark.yaml'
workflow_dispatch:

jobs:
Expand Down Expand Up @@ -65,3 +76,62 @@ jobs:
if: failure()
run: |
echo "Release tag already exists or another error occurred. Skipping release creation."
benchmark:
needs: release # Ensures that the 'release' job completes before 'benchmark' starts
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.12] # Test across multiple Python versions

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements-dev.txt
- name: Run Benchmark Tests
run: |
pytest tests/benchmarks/ --benchmark-only --benchmark-json=benchmark_results.json --html=benchmark_report.html
- name: Install Matplotlib
run: |
pip install matplotlib
- name: Generate Benchmark Plots and Update README
run: |
python scripts/update_readme_benchmarks.py benchmark_results.json README.md
- name: Commit and Push Updated README
uses: EndBug/add-and-commit@v9
with:
author_name: github-actions[bot]
author_email: github-actions[bot]@users.noreply.github.com
message: "Update README with latest benchmark results and plots [skip ci]"
file_pattern: README.md

- name: Upload Benchmark JSON Results
uses: actions/upload-artifact@v3
with:
name: benchmark-results-${{ matrix.python-version }}
path: benchmark_results.json

- name: Upload Benchmark HTML Report
uses: actions/upload-artifact@v3
with:
name: benchmark-report-${{ matrix.python-version }}
path: benchmark_report.html

- name: Upload Benchmark Plots
uses: actions/upload-artifact@v3
with:
name: benchmark-plots-${{ matrix.python-version }}
path: scripts/benchmarks/*.png # Ensure plots are saved here
59 changes: 54 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
[![License](https://img.shields.io/badge/license-AGPL%203.0-blue.svg)](LICENSE)
[![PyPI Version](https://img.shields.io/pypi/v/celux)](https://pypi.org/project/celux/)
[![PyPI Version CUDA](https://img.shields.io/pypi/v/celux-cuda)](https://pypi.org/project/celux-cuda/)
[![Build Status](https://img.shields.io/github/actions/workflow/status/Trentonom0r3/celux/createRelease.yaml?branch=main)](https://github.com/Trentonom0r3/celux/actions)
[![PyPI - Downloads](https://img.shields.io/pypi/dm/celux)](https://pypi.org/project/celux/)
[![Python Versions](https://img.shields.io/pypi/pyversions/celux)](https://pypi.org/project/celux/)

![License](https://img.shields.io/badge/license-AGPL%203.0-blue.svg)
![PyPI Version](https://img.shields.io/pypi/v/celux)
![PyPI Version CUDA](https://img.shields.io/pypi/v/celux-cuda)

# CeLux

**CeLux** is a high-performance Python library for video processing, leveraging the power of FFmpeg. It delivers some of the fastest decode times for full HD videos globally, enabling efficient and seamless video decoding directly into PyTorch tensors.

The name **CeLux** is derived from the Latin words `celer` (speed) and `lux` (light), reflecting its commitment to speed and efficiency.


## 🚀 Features

- **⚡ Ultra-Fast Video Decoding:** Achieve lightning-fast decode times for full HD videos using hardware acceleration.
Expand Down Expand Up @@ -202,6 +206,16 @@ We welcome contributions! Follow these steps to contribute:
## 📈 Changelog
### Version 0.3.6 (2024-10-19)
- **Pre-Release Update:**
- Fixed `VideoWriter` class.
- Both `cpu` and `cuda` arguments now work properly.
- **Encoder Functionality:**
- Enabled encoder support for both CPU and CUDA backends.
- Users can now encode videos directly from PyTorch tensors.
- Update Github Actions, add tests.
### Version 0.3.5 (2024-10-19)
- **Pre-Release Update:**
Expand Down Expand Up @@ -230,8 +244,7 @@ We welcome contributions! Follow these steps to contribute:
- **Pre-Release Update:**
- Adjusted Frame Range End in `VideoReader` to be exclusive to match `cv2` behavior.
- Removed unnecessary error throws.
- Encoder **DOES NOT** work currenty. *WiP.*
- **Encoder Functionality:** Now fully operational for both CPU and CUDA.
### Version 0.3.0 (2024-10-17)
Expand Down Expand Up @@ -290,6 +303,42 @@ This project is licensed under the **GNU Affero General Public License v3.0 (AGP
- **[Vcpkg](https://github.com/microsoft/vcpkg):** Simplifies cross-platform dependency management.
- **[@NevermindNilas](https://github.com/NevermindNilas):** For assistance with testing, API suggestions, and more.
# 📈 **Benchmarks**
<!-- BENCHMARKS_START -->
### 🖥️ **System Specifications**
| Specification | Details |
|-----------------------|-----------------------------------------|
| **Processor** | Intel64 Family 6 Model 154 Stepping 3, GenuineIntel |
| **Architecture** | AMD64 |
| **Python Version** | 3.12.7 (CPython) |
| **Python Build** | tags/v3.12.7:0b05ead Oct 1 2024 03:06:41 |
| **Operating System** | Windows 11 |
| **CPU Brand** | 12th Gen Intel(R) Core(TM) i7-12700H |
| **CPU Frequency** | 2.3000 GHz |
| **L2 Cache Size** | 11776 KB |
| **L3 Cache Size** | 24576 KB |
| **Number of Cores** | 20 |
| Benchmark | Mean Time (s) | Std Dev (s) | FPS |
|--------------------------------|---------------|------------|--------|
| Test Video Reader Cpu Benchmark | 0.81 | 0.01 | 442.44 |
| Test Video Reader Cuda Benchmark | 15.33 | 3.23 | 933.49 |
| Test Video Writer Benchmark | 1.64 | 0.06 | 219.78 |
### 📊 **Benchmark Visualizations**
![FPS Comparison](scripts/benchmarks/fps_comparison.png)
![Mean Time Comparison](scripts/benchmarks/mean_time_comparison.png)
<!-- BENCHMARKS_END -->
## ❓ FAQ
### Q: Can I use **CeLux** without CUDA or GPU acceleration?
Expand Down
Loading

0 comments on commit 3a6a227

Please sign in to comment.