app / app.py
kikuepi's picture
Upload 5 files
e73c0a8 verified
raw
history blame contribute delete
911 Bytes
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()