Skip to content

Commit

Permalink
Add --no-trigger to skip waiting for gesture
Browse files Browse the repository at this point in the history
  • Loading branch information
awwaiid committed Dec 30, 2024
1 parent e74b405 commit 728c763
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 5 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,7 +232,7 @@ mkdir -p evaluations/$evaluation_name
mv tmp/* evaluations/$evaluation_name
# Run an evaluation
./target/release/ghostwriter --input-png evaluations/$evaluation_name/input.png --output-file tmp/result.out --model-output-file tmp/result.json --save-bitmap tmp/result.png --no-draw --no-draw-progress --no-loop claude-assist
./target/release/ghostwriter --input-png evaluations/$evaluation_name/input.png --output-file tmp/result.out --model-output-file tmp/result.json --save-bitmap tmp/result.png --no-draw --no-draw-progress --no-loop --no-trigger claude-assist
# Layer the input and output
convert \( evaluations/$evaluation_name/input.png -colorspace RGB \) \( tmp/result.png -type truecolormatte -transparent white -fill red -colorize 100 \) -compose Over -composite tmp/merged-output.png
Expand Down
5 changes: 3 additions & 2 deletions run_eval.sh
Original file line number Diff line number Diff line change
Expand Up @@ -63,13 +63,14 @@ for scenario in "${scenarios[@]}"; do

./target/release/ghostwriter \
--input-png evaluations/$scenario/input.png \
--output-file $outdir/result.out \
--save-screenshot $outdir/input.png \
--model-output-file $outdir/result.json \
--output-file $outdir/result.out \
--save-bitmap $outdir/result.png \
--save-screenshot $outdir/input.png \
--no-draw \
--no-draw-progress \
--no-loop \
--no-trigger \
$params

# Create a merged image with the new part in red
Expand Down
8 changes: 6 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@ struct Args {
#[arg(long)]
no_loop: bool,

/// Disable waiting for trigger
#[arg(long)]
no_trigger: bool,

/// Apply segmentation
#[arg(long)]
apply_segmentation: bool,
Expand Down Expand Up @@ -255,8 +259,8 @@ fn ghostwriter(args: &Args) -> Result<()> {
);

loop {
if let Some(input_png) = &args.input_png {
println!("Using input PNG file: {}", input_png);
if args.no_trigger {
println!("Skipping waiting for trigger");
} else {
println!("Waiting for trigger (hand-touch in the upper-right corner)...");
lock!(touch).wait_for_trigger()?;
Expand Down

0 comments on commit 728c763

Please sign in to comment.