-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8281c1b
commit dc2c9c0
Showing
3 changed files
with
30 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import gradio as gr | ||
import numpy as np | ||
import cv2 | ||
from multifocal_stitching import candidate_stitches, stitch, merge | ||
|
||
def stitch_interface(img1, img2): | ||
#use_wins, workers, peak_cutoff_std, | ||
#peaks_dist_threshold, filter_radii, min_overlap, | ||
#early_term_thresh): | ||
res = stitch(*[cv2.cvtColor(np.array(im), cv2.COLOR_RGB2GRAY) for im in (img1, img2)]) | ||
dx, dy = res.coord | ||
return merge(img1, img2, dx, dy, resize_factor=8) | ||
|
||
demo = gr.Interface(fn=stitch_interface, inputs=[ | ||
gr.Image(type='pil'), gr.Image(type='pil') | ||
], outputs=[ | ||
gr.Gallery() | ||
], examples=[ | ||
["tests/imgs/high_freq_features_1_small.jpg", | ||
"tests/imgs/high_freq_features_2_small.jpg", ] | ||
]) | ||
|
||
|
||
|
||
|
||
|
||
|
||
demo.launch() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters