Include the pathlib WindowsPath = PosixPath
Browse files
app.py
CHANGED
|
@@ -1,8 +1,14 @@
|
|
| 1 |
-
|
| 2 |
-
import cv2
|
| 3 |
from PIL import Image
|
|
|
|
|
|
|
| 4 |
import numpy as np
|
| 5 |
import torch
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 6 |
|
| 7 |
# Load YOLOv5 model
|
| 8 |
model = torch.hub.load('./yolov5', 'custom', path='./yolo/best.pt', source='local', force_reload=True)
|
|
|
|
| 1 |
+
from pathlib import Path
|
|
|
|
| 2 |
from PIL import Image
|
| 3 |
+
|
| 4 |
+
import pathlib
|
| 5 |
import numpy as np
|
| 6 |
import torch
|
| 7 |
+
import streamlit as st
|
| 8 |
+
import cv2
|
| 9 |
+
|
| 10 |
+
#If you have linux (or deploying for linux) use:
|
| 11 |
+
pathlib.WindowsPath = pathlib.PosixPath
|
| 12 |
|
| 13 |
# Load YOLOv5 model
|
| 14 |
model = torch.hub.load('./yolov5', 'custom', path='./yolo/best.pt', source='local', force_reload=True)
|