sealedrose 1.0.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 +51 -0
- data/lib/sealedrose.rb +65 -0
- metadata +61 -0
checksums.yaml
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
---
|
|
2
|
+
SHA256:
|
|
3
|
+
metadata.gz: 3096ec0fed2d72319951f331bb259cf6b57cd154f8d0cec52e1c9a73ff39905f
|
|
4
|
+
data.tar.gz: c5e8294c2ae51e05d97547b53b431abd28ab6ddcaf6789b41ff9edd4fd0c0f82
|
|
5
|
+
SHA512:
|
|
6
|
+
metadata.gz: c71d073c6fe2eb4e6a729ff4d5538c43908707132ea32cce1464d7abd1459c2cb203ef160cf7028973ce1635c6bac0d765d985f1ba12f2548ff50cf62d491e89
|
|
7
|
+
data.tar.gz: e5c11676a50a06753df14dbb9b02c10b97a5f72761ecb56475baebb2ec770bf874352e5bbd95f4cd90128dbc9f2e83a4de604a64a47ab1c3536c75f6f1185b7b
|
data/README.md
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
# sealedrose (Ruby Gem)
|
|
2
|
+
|
|
3
|
+
Official Ruby Gem for [Sealed Rose](https://sealedrose.com/verify-video) — AI Deepfake, Synthetic Media, and Frame-Level Media Forensics.
|
|
4
|
+
|
|
5
|
+
[](https://badge.fury.io/rb/sealedrose)
|
|
6
|
+
[](https://opensource.org/licenses/MIT)
|
|
7
|
+
|
|
8
|
+
Detect whether an image or video is AI-generated (Midjourney, Stable Diffusion, Flux, Sora, Runway Gen-3, Kling, Google Veo) or an impersonation deepfake.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
Add this line to your application's Gemfile:
|
|
13
|
+
|
|
14
|
+
```ruby
|
|
15
|
+
gem 'sealedrose'
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
And then execute:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
bundle install
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
Or install it directly:
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
gem install sealedrose
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Quick Start
|
|
31
|
+
|
|
32
|
+
```ruby
|
|
33
|
+
require 'sealedrose'
|
|
34
|
+
|
|
35
|
+
client = SealedRose::Client.new
|
|
36
|
+
|
|
37
|
+
# Verify media via public URL
|
|
38
|
+
result = client.verify_video(url: 'https://example.com/suspicious_video.mp4')
|
|
39
|
+
|
|
40
|
+
puts result['verdict'] # "Looks Real" or "AI Deepfake Detected"
|
|
41
|
+
puts result['deepfakeScore'] # 0.0 to 1.0
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## Free Web Triage
|
|
45
|
+
|
|
46
|
+
Verify video authenticity instantly without code:
|
|
47
|
+
👉 **[Sealed Rose Deepfake Detector](https://sealedrose.com/verify-video)**
|
|
48
|
+
|
|
49
|
+
## License
|
|
50
|
+
|
|
51
|
+
MIT License. See [LICENSE](../LICENSE) for details.
|
data/lib/sealedrose.rb
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require "net/http"
|
|
4
|
+
require "uri"
|
|
5
|
+
require "json"
|
|
6
|
+
|
|
7
|
+
module SealedRose
|
|
8
|
+
VERSION = "1.0.0"
|
|
9
|
+
|
|
10
|
+
class Client
|
|
11
|
+
attr_accessor :base_url, :api_key
|
|
12
|
+
|
|
13
|
+
def initialize(base_url: "https://sealedrose.com", api_key: nil)
|
|
14
|
+
@base_url = base_url.chomp("/")
|
|
15
|
+
@api_key = api_key || ENV["SEALEDROSE_API_KEY"]
|
|
16
|
+
end
|
|
17
|
+
|
|
18
|
+
def verify_video(url: nil, file_path: nil)
|
|
19
|
+
dispatch("/api/verify-video", "video", url, file_path)
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
def verify_image(url: nil, file_path: nil)
|
|
23
|
+
dispatch("/api/verify-image", "image", url, file_path)
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
private
|
|
27
|
+
|
|
28
|
+
def dispatch(endpoint, field_name, url, file_path)
|
|
29
|
+
uri = URI.parse("#{@base_url}#{endpoint}")
|
|
30
|
+
http = Net::HTTP.new(uri.host, uri.port)
|
|
31
|
+
http.use_ssl = (uri.scheme == "https")
|
|
32
|
+
|
|
33
|
+
if url
|
|
34
|
+
request = Net::HTTP::Post.new(uri.request_uri, "Content-Type" => "application/json")
|
|
35
|
+
request["Authorization"] = "Bearer #{@api_key}" if @api_key
|
|
36
|
+
request.body = JSON.dump({ url: url })
|
|
37
|
+
elsif file_path
|
|
38
|
+
boundary = "SealedRoseBoundary#{Time.now.to_i}"
|
|
39
|
+
request = Net::HTTP::Post.new(uri.request_uri, "Content-Type" => "multipart/form-data; boundary=#{boundary}")
|
|
40
|
+
request["Authorization"] = "Bearer #{@api_key}" if @api_key
|
|
41
|
+
|
|
42
|
+
file_content = File.binread(file_path)
|
|
43
|
+
file_name = File.basename(file_path)
|
|
44
|
+
|
|
45
|
+
post_body = []
|
|
46
|
+
post_body << "--#{boundary}\r\n"
|
|
47
|
+
post_body << "Content-Disposition: form-data; name=\"#{field_name}\"; filename=\"#{file_name}\"\r\n"
|
|
48
|
+
post_body << "Content-Type: application/octet-stream\r\n\r\n"
|
|
49
|
+
post_body << file_content
|
|
50
|
+
post_body << "\r\n--#{boundary}--\r\n"
|
|
51
|
+
|
|
52
|
+
request.body = post_body.join
|
|
53
|
+
else
|
|
54
|
+
raise ArgumentError, "Either url or file_path must be provided."
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
response = http.request(request)
|
|
58
|
+
unless response.is_a?(Net::HTTPSuccess)
|
|
59
|
+
raise "Sealed Rose API Error: #{response.code} #{response.message} - #{response.body}"
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
JSON.parse(response.body)
|
|
63
|
+
end
|
|
64
|
+
end
|
|
65
|
+
end
|
metadata
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
|
2
|
+
name: sealedrose
|
|
3
|
+
version: !ruby/object:Gem::Version
|
|
4
|
+
version: 1.0.0
|
|
5
|
+
platform: ruby
|
|
6
|
+
authors:
|
|
7
|
+
- Derek Gallardo
|
|
8
|
+
bindir: bin
|
|
9
|
+
cert_chain: []
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
11
|
+
dependencies:
|
|
12
|
+
- !ruby/object:Gem::Dependency
|
|
13
|
+
name: net-http
|
|
14
|
+
requirement: !ruby/object:Gem::Requirement
|
|
15
|
+
requirements:
|
|
16
|
+
- - ">="
|
|
17
|
+
- !ruby/object:Gem::Version
|
|
18
|
+
version: '0'
|
|
19
|
+
type: :runtime
|
|
20
|
+
prerelease: false
|
|
21
|
+
version_requirements: !ruby/object:Gem::Requirement
|
|
22
|
+
requirements:
|
|
23
|
+
- - ">="
|
|
24
|
+
- !ruby/object:Gem::Version
|
|
25
|
+
version: '0'
|
|
26
|
+
description: Sealed Rose client library for analyzing video and images for synthetic
|
|
27
|
+
media, deepfakes, face swaps, and diffusion artifacts.
|
|
28
|
+
email:
|
|
29
|
+
- derek@sealedrose.com
|
|
30
|
+
executables: []
|
|
31
|
+
extensions: []
|
|
32
|
+
extra_rdoc_files: []
|
|
33
|
+
files:
|
|
34
|
+
- README.md
|
|
35
|
+
- lib/sealedrose.rb
|
|
36
|
+
homepage: https://sealedrose.com/verify-video
|
|
37
|
+
licenses:
|
|
38
|
+
- MIT
|
|
39
|
+
metadata:
|
|
40
|
+
homepage_uri: https://sealedrose.com/verify-video
|
|
41
|
+
source_code_uri: https://github.com/derekgallardo01/sealedrose-sdk
|
|
42
|
+
bug_tracker_uri: https://sealedrose.com/contact
|
|
43
|
+
documentation_uri: https://sealedrose.com/verify-video
|
|
44
|
+
rdoc_options: []
|
|
45
|
+
require_paths:
|
|
46
|
+
- lib
|
|
47
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
|
48
|
+
requirements:
|
|
49
|
+
- - ">="
|
|
50
|
+
- !ruby/object:Gem::Version
|
|
51
|
+
version: 2.7.0
|
|
52
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
|
+
requirements:
|
|
54
|
+
- - ">="
|
|
55
|
+
- !ruby/object:Gem::Version
|
|
56
|
+
version: '0'
|
|
57
|
+
requirements: []
|
|
58
|
+
rubygems_version: 4.0.20
|
|
59
|
+
specification_version: 4
|
|
60
|
+
summary: Official Ruby SDK for Sealed Rose AI Deepfake & Synthetic Media Detection.
|
|
61
|
+
test_files: []
|