live-face-frame-review 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +7 -0
- data/README.md +9 -0
- data/lib/live_face_frame_review.rb +12 -0
- metadata +44 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 7f9dcbc1a1ae228ea1d1adb80fada0453e3e68f683c65d686d9416d73228c3fa
|
|
4
|
+
data.tar.gz: 292e52f94d0889d4411ff85f23093d72cec718bbc41fcd64490b7dd82ec9bfc6
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: a89c41e71624a5c08446ff2aa4c6d26573378511e50dd77b9579c12398e99562017bb11b0dde0cda7b5879544410a5f4f1c6dee0cc5cea8c8eade9c7c81995f6
|
|
7
|
+
data.tar.gz: bfffda6432ff9a676566a142610ca9f768c2219984c6be741977987242b4c05ef8645ff55fd3cd7a25052fa3fc6943eaa3abcdc943a66341b546456daa829f7a
|
data/README.md
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Live Face Frame Review
|
|
2
|
+
|
|
3
|
+
Compare RGB frame samples to locate moments for manual review. Compare aligned frames from a preview before reviewing movement, lighting, blinking and occlusion. Large differences may also come from camera motion or compression.
|
|
4
|
+
|
|
5
|
+
For the related workflow, see [live swap face](https://liveswapface.com/). This library is a local review helper; it does not upload data or perform conversion or enhancement.
|
|
6
|
+
|
|
7
|
+
## Usage
|
|
8
|
+
|
|
9
|
+
Require `live_face_frame_review` and call the documented module method with locally decoded data. Ruby 2.6 or later is required.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
# Compare RGB frame samples to locate moments for manual review.
|
|
4
|
+
module LiveFaceFrameReview
|
|
5
|
+
# Compare two equal-length RGB byte arrays using normalized mean absolute difference.
|
|
6
|
+
# A high result is a review cue, not proof of a defect or manipulation.
|
|
7
|
+
def self.difference(before, after)
|
|
8
|
+
raise ArgumentError, 'frames must be equally sized RGB byte arrays' unless before.is_a?(Array) && after.is_a?(Array) && !before.empty? && before.length == after.length && before.length % 3 == 0
|
|
9
|
+
raise ArgumentError, 'channels must be integers between 0 and 255' unless (before + after).all? { |v| v.is_a?(Integer) && v.between?(0, 255) }
|
|
10
|
+
before.zip(after).sum { |a, b| (a - b).abs }.to_f / (before.length * 255)
|
|
11
|
+
end
|
|
12
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: live-face-frame-review
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Content True
|
|
8
|
+
autorequire:
|
|
9
|
+
bindir: bin
|
|
10
|
+
cert_chain: []
|
|
11
|
+
date: 2026-12-04 00:00:00.000000000 Z
|
|
12
|
+
dependencies: []
|
|
13
|
+
description:
|
|
14
|
+
email:
|
|
15
|
+
executables: []
|
|
16
|
+
extensions: []
|
|
17
|
+
extra_rdoc_files: []
|
|
18
|
+
files:
|
|
19
|
+
- README.md
|
|
20
|
+
- lib/live_face_frame_review.rb
|
|
21
|
+
homepage: https://liveswapface.com/
|
|
22
|
+
licenses:
|
|
23
|
+
- MIT
|
|
24
|
+
metadata: {}
|
|
25
|
+
post_install_message:
|
|
26
|
+
rdoc_options: []
|
|
27
|
+
require_paths:
|
|
28
|
+
- lib
|
|
29
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
30
|
+
requirements:
|
|
31
|
+
- - ">="
|
|
32
|
+
- !ruby/object:Gem::Version
|
|
33
|
+
version: '2.6'
|
|
34
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
35
|
+
requirements:
|
|
36
|
+
- - ">="
|
|
37
|
+
- !ruby/object:Gem::Version
|
|
38
|
+
version: '0'
|
|
39
|
+
requirements: []
|
|
40
|
+
rubygems_version: 3.0.3.1
|
|
41
|
+
signing_key:
|
|
42
|
+
specification_version: 4
|
|
43
|
+
summary: Compare RGB frame samples to locate moments for manual review.
|
|
44
|
+
test_files: []
|