drsaikirant88
commited on
Commit
•
2676ede
1
Parent(s):
2ad5e01
Update app.py
Browse files
app.py
CHANGED
@@ -20,6 +20,7 @@
|
|
20 |
|
21 |
# Libraries
|
22 |
import torch
|
|
|
23 |
from utils import *
|
24 |
import gradio as gr
|
25 |
from numpy import array
|
@@ -37,9 +38,7 @@ nms_thresh = 0.30
|
|
37 |
run_cuda = False
|
38 |
|
39 |
# CFG Files
|
40 |
-
cfg = 'cfg/yolov3-openimages.cfg'
|
41 |
clsnames= 'cfg/openimages.names'
|
42 |
-
weights = 'cfg/yolov3-openimages.weights'
|
43 |
|
44 |
# Load classes
|
45 |
classes = load_classes(clsnames)
|
@@ -47,10 +46,8 @@ num_classes = len(classes)
|
|
47 |
|
48 |
# Set up the neural network
|
49 |
print('Load Network')
|
50 |
-
|
51 |
-
|
52 |
-
print('Load Weights')
|
53 |
-
model.load_weights(weights)
|
54 |
|
55 |
print('Successfully loaded Network')
|
56 |
|
|
|
20 |
|
21 |
# Libraries
|
22 |
import torch
|
23 |
+
import pickle
|
24 |
from utils import *
|
25 |
import gradio as gr
|
26 |
from numpy import array
|
|
|
38 |
run_cuda = False
|
39 |
|
40 |
# CFG Files
|
|
|
41 |
clsnames= 'cfg/openimages.names'
|
|
|
42 |
|
43 |
# Load classes
|
44 |
classes = load_classes(clsnames)
|
|
|
46 |
|
47 |
# Set up the neural network
|
48 |
print('Load Network')
|
49 |
+
with open('models/darknet.pkl', 'rb') as f:
|
50 |
+
model = pickle.load(f)
|
|
|
|
|
51 |
|
52 |
print('Successfully loaded Network')
|
53 |
|