File size: 911 Bytes
e73c0a8 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 |
import streamlit as st
import cv2
import numpy as np
from matplotlib import pyplot as plt
from PIL import Image
from io import BytesIO
from match import Match, Great_Match
from diff import diff
def main():
st.title("画像差分検知")
TYPE = st.sidebar.selectbox("選択", ["差分抽出", "特徴量抽出"])
image_file1 = st.sidebar.file_uploader("1枚目の画像をアップロードしてください", type=["jpg", "jpeg", "png", "PNG"])
image_file2 = st.sidebar.file_uploader("2枚目の画像をアップロードしてください", type=["jpg", "jpeg", "png", "PNG"])
if image_file1 and image_file2:
if TYPE == "差分抽出":
diff(image_file1, image_file2)
elif TYPE == "特徴量抽出":
Match(image_file1, image_file2)
else:
st.info("画像をアップロードしてください")
if __name__ == "__main__":
main()
|