This file contains hidden or 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
import streamlit as st | |
from lib import commons | |
import torch | |
def app(): | |
header=st.container() | |
result_all = st.container() | |
with header: | |
st.subheader("Test whether an area is affected by any natural disaster") | |
image_file = st.file_uploader("Upload Images", type=["png","jpg","jpeg"]) |
This file contains hidden or 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
import streamlit as st | |
from lib import commons | |
def app(): | |
header=st.container() | |
with header: | |
st.subheader("Test whether an area is affected by any natural disaster") | |
image_file = st.file_uploader("Upload Images", type=["png","jpg","jpeg"]) | |
if image_file is not None: | |
# To See details |
This file contains hidden or 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
import streamlit as st | |
from lib import commons | |
def app(): | |
header=st.container() | |
with header: | |
st.subheader("Test whether an area is affected by any natural disaster") | |
proxy_img_file="data/joplin-tornado_00000001_post_disaster.png" | |
st.image(commons.load_image(proxy_img_file),width=250) | |
image_for_model=commons.image_loader(proxy_img_file) |
This file contains hidden or 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
import numpy as np | |
import torch | |
import torch.nn as nn | |
import torch.nn.functional as F | |
import torch.optim as optim | |
from torch.utils.data.sampler import SubsetRandomSampler | |
from torch.utils.data import DataLoader | |
from torchvision import datasets, transforms | |
import torch.nn as nn | |
import torch.nn.functional as F |
This file contains hidden or 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
import os | |
import streamlit as st | |
import numpy as np | |
from PIL import Image | |
# Custom imports | |
from multipage import MultiPage | |
from pages import disasterAnalysis | |
# Create an instance of the app |
This file contains hidden or 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
import streamlit as st | |
def app(): | |
header=st.container() | |
with header: | |
st.subheader("Test whether an area is affected by any natural disaster") |
This file contains hidden or 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
import os | |
import streamlit as st | |
import numpy as np | |
from PIL import Image | |
# Custom imports | |
from multipage import MultiPage | |
# Create an instance of the app | |
app = MultiPage() |
This file contains hidden or 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
import os | |
import streamlit as st | |
import numpy as np | |
from PIL import Image | |
# Custom imports | |
from multipage import MultiPage | |
# Create an instance of the app | |
app = MultiPage() |
This file contains hidden or 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 is the framework for generating multiple Streamlit applications | |
through an object oriented framework. | |
""" | |
# Import necessary libraries | |
import streamlit as st | |
# Define the multipage class to manage the multiple apps in our program | |
class MultiPage: |
This file contains hidden or 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
# read an image | |
from PIL import Image | |
from torch.autograd import Variable | |
loader = transforms.Compose([transforms.Resize(dim[0]), | |
transforms.ToTensor(), | |
transforms.Normalize([0.485, 0.456, 0.406], [0.229, 0.224, 0.225])]) | |
def image_loader(image_name): | |
"""load image, returns cuda tensor""" |