kornia / tutorials

Repository containing the Kornia related tutorials
https://kornia.github.io/tutorials/
Apache License 2.0
45 stars 32 forks source link

Tutorial request for image stitching, and error for kornia.feature #98

Open fatbringer opened 1 month ago

fatbringer commented 1 month ago

Hello! I found this link on your webpage https://kornia.readthedocs.io/en/latest/applications/image_stitching.html and i was very excited to try the image stitching, however i am unable to find an example tutorial for the image stitching

Here is a short code i wrote wanting to try your demo

import kornia as K
import kornia.feature as KF
from kornia.contrib import ImageStitcher
import torch
import cv2

device = K.utils.get_cuda_or_mps_device_if_available()

imgs = r"photos"

matcher = KF.LoFTR(pretrained='outdoor')
IS = ImageStitcher(matcher, estimator='ransac').cuda()
# NOTE: it would require a large CPU memory if many images.
with torch.no_grad():
    out = IS(*imgs)

cv2.imshow('output window', out) 

it also gave me an error

    import kornia.feature as KF
ModuleNotFoundError: No module named 'kornia.feature'; 'kornia' is not a package

Questions 1) may i know which tutorial is the one for image stitching? (the warp image one is not what i need) 2) How to fix the import kornia.feature error?

谢谢您的协助

edgarriba commented 1 month ago

@fatbringer are you using the latest version of kornia ? check also https://kornia.github.io/tutorials/nbs/image_stitching.html

(the warp image one is not what i need)

what do you need ?

fatbringer commented 1 month ago

@edgarriba yeah I'm using the latest version I have just run pip install. On python 3.12

I'm looking for the one for image stitching. In fact, I want to stitch multiple images https://kornia.readthedocs.io/en/latest/applications/image_stitching.html

This was the link I found but it is not a complete tutorials

edgarriba commented 1 month ago

i believe @shijianjian implemented this tutorial

fatbringer commented 1 month ago

@shijianjian Hello! I notice that you have a fork of the kornia repo on your profile. May i know which one is the corrrect tutorial for image stitching?

shijianjian commented 1 month ago

I think it is the environment issue. At least the "import kornia.feature" should be okay.