feat: add fullscreen bilingual photobooth interface
This commit is contained in:
@@ -44,6 +44,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
let mut detector = palm::Detector::new()?;
|
||||
let ui = AppWindow::new()?;
|
||||
ui.window().set_fullscreen(true);
|
||||
|
||||
ui.window()
|
||||
.on_close_requested(|| slint::CloseRequestResponse::KeepWindowShown);
|
||||
@@ -56,6 +57,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
let tracker = Arc::new(Mutex::new(palm::Tracker::default()));
|
||||
let detection_tracker = Arc::clone(&tracker);
|
||||
let ui_tracker = Arc::clone(&tracker);
|
||||
// A rendezvous channel drops samples while inference is busy, avoiding a backlog.
|
||||
let (detection_tx, detection_rx) = mpsc::sync_channel::<Mat>(0);
|
||||
let detection_worker = thread::spawn(move || {
|
||||
@@ -108,6 +110,7 @@ fn main() -> Result<(), Box<dyn Error>> {
|
||||
|
||||
if let (Some(app), Some(buffer)) = (ui_handle.upgrade(), buffer) {
|
||||
app.set_video_frame(slint::Image::from_rgb8(buffer));
|
||||
app.set_hand_detected(ui_tracker.lock().unwrap().has_palm(Instant::now()));
|
||||
}
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user