| Crates.io | ai_kissing |
| lib.rs | ai_kissing |
| version | 67.0.17 |
| created_at | 2026-01-07 08:24:57.816806+00 |
| updated_at | 2026-01-07 08:24:57.816806+00 |
| description | High-quality integration for https://supermaker.ai/video/ai-kissing/ |
| homepage | https://supermaker.ai/video/ai-kissing/ |
| repository | https://github.com/qy-upup/ai-kissing |
| max_upload_size | |
| id | 2027783 |
| size | 12,004 |
A Rust crate providing utilities for detecting and analyzing kissing events in video streams. Designed for research and development in areas like behavioral analysis and human-computer interaction.
To use ai-kissing in your Rust project, add the following to your Cargo.toml file:
toml
[dependencies]
ai-kissing = "0.1.0" # Replace with the latest version
This crate provides functionalities to process video frames, identify potential kissing events based on proximity and facial feature analysis, and generate reports.
Example 1: Basic Kissing Event Detection rust use ai_kissing::{FrameData, KissingDetector};
fn main() { // Simulate frame data (replace with actual video frame processing) let frame1 = FrameData { person1_x: 100, person1_y: 150, person2_x: 110, person2_y: 160, // ... other relevant data like facial landmarks };
let frame2 = FrameData {
person1_x: 105,
person1_y: 155,
person2_x: 108,
person2_y: 158,
// ... other relevant data like facial landmarks
};
let mut detector = KissingDetector::new();
if detector.is_kissing(&frame1) {
println!("Potential kissing event detected in frame 1!");
}
if detector.is_kissing(&frame2) {
println!("Potential kissing event detected in frame 2!");
}
}
Example 2: Tracking Kissing Duration rust use ai_kissing::{FrameData, KissingDetector};
fn main() { let mut detector = KissingDetector::new(); let mut kissing_start_time = None;
// Simulate video frames
let frames = vec![
FrameData { person1_x: 50, person1_y: 60, person2_x: 52, person2_y: 62 },
FrameData { person1_x: 51, person1_y: 61, person2_x: 51, person2_y: 61 },
FrameData { person1_x: 52, person1_y: 62, person2_x: 50, person2_y: 60 },
FrameData { person1_x: 70, person1_y: 80, person2_x: 90, person2_y: 100 },
];
for (index, frame) in frames.iter().enumerate() {
if detector.is_kissing(frame) {
if kissing_start_time.is_none() {
kissing_start_time = Some(index);
println!("Kissing started at frame: {}", index);
}
} else {
if kissing_start_time.is_some() {
let start = kissing_start_time.unwrap();
println!("Kissing ended at frame: {}. Duration: {} frames", index, index - start);
kissing_start_time = None;
}
}
}
}
Example 3: Customizing Kissing Detection Thresholds rust use ai_kissing::{FrameData, KissingDetector, DetectorConfig};
fn main() { let config = DetectorConfig { proximity_threshold: 15, // Increased proximity threshold facial_feature_similarity_threshold: 0.8, // Changed feature similarity threshold };
let mut detector = KissingDetector::with_config(config);
// Simulate frame data
let frame = FrameData { person1_x: 20, person1_y: 30, person2_x: 34, person2_y: 40 };
if detector.is_kissing(&frame) {
println!("Kissing event detected with custom configuration!");
}
}
MIT
This crate is part of the ai-kissing ecosystem. For advanced features and enterprise-grade tools, visit: https://supermaker.ai/video/ai-kissing/