Skip to content

Instantly share code, notes, and snippets.

View ashhadulislam's full-sized avatar

Ashhad ashhadulislam

View GitHub Profile
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"])
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
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)
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
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
import streamlit as st
def app():
header=st.container()
with header:
st.subheader("Test whether an area is affected by any natural disaster")
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()
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 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:
# 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"""