import os import shutil import json import numpy as np from scipy.spatial import distance_matrix from sklearn import neighbors from pygco import cut_from_graph import open3d as o3d import matplotlib.pyplot as plt import matplotlib.colors as mcolors import torch import torch.nn as nn from torch.autograd import Variable import torch.nn.functional as F import streamlit as st from streamlit import session_state as session from stpyvista import stpyvista from stqdm import stqdm from PIL import Image # Configure Streamlit page class TeethApp: """ Base class for Streamlit app """ def __init__(self): # Font with open("utils/style.css") as css: st.markdown(f"", unsafe_allow_html=True) # Logo self.image_path = "utils/teeth-295404_1280.png" self.image = Image.open(self.image_path) width, height = self.image.size scale = 12 new_width, new_height = width / scale, height / scale self.image = self.image.resize((int(new_width), int(new_height))) # Streamlit side navigation bar st.sidebar.markdown("# AI ToothSeg") st.sidebar.markdown("Automatic teeth segmentation with Deep Learning") st.sidebar.markdown(" ") st.sidebar.image(self.image, use_column_width=False) st.markdown( """