Update app.py
Browse files
app.py
CHANGED
@@ -25,7 +25,7 @@ import albumentations as A # Albumentations is a computer vision tool that boost
|
|
25 |
from albumentations.pytorch.transforms import ToTensorV2
|
26 |
|
27 |
model = models.resnet50(pretrained=False)
|
28 |
-
model.fc = nn.Linear(2048,
|
29 |
model.load_state_dict(torch.load('resnet_best.pth', map_location=torch.device('cpu')), strict=True)
|
30 |
|
31 |
st.title("some big ML function")
|
@@ -37,6 +37,7 @@ if uploaded_file is not None:
|
|
37 |
img = Image.open(uploaded_file)
|
38 |
st.image(img)
|
39 |
img = np.array(img)
|
|
|
40 |
|
41 |
elif ".csv" in uploaded_file.name:
|
42 |
dataframe = pd.read_csv(uploaded_file)
|
|
|
25 |
from albumentations.pytorch.transforms import ToTensorV2
|
26 |
|
27 |
model = models.resnet50(pretrained=False)
|
28 |
+
model.fc = nn.Linear(2048, 21)
|
29 |
model.load_state_dict(torch.load('resnet_best.pth', map_location=torch.device('cpu')), strict=True)
|
30 |
|
31 |
st.title("some big ML function")
|
|
|
37 |
img = Image.open(uploaded_file)
|
38 |
st.image(img)
|
39 |
img = np.array(img)
|
40 |
+
img = cv2.cvtColor(img, cv2.COLOR_BGR2RGB)
|
41 |
|
42 |
elif ".csv" in uploaded_file.name:
|
43 |
dataframe = pd.read_csv(uploaded_file)
|