Paras Shah
commited on
Commit
·
af253de
1
Parent(s):
0466118
Remove cache optimization (doesn't work for now)
Browse files
app.py
CHANGED
|
@@ -15,16 +15,11 @@ gc.enable()
|
|
| 15 |
|
| 16 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 17 |
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
classifier.load_state_dict(checkpoint['model_state_dict'])
|
| 24 |
-
classifier.eval()
|
| 25 |
-
return classifier
|
| 26 |
-
|
| 27 |
-
classifier = load_model()
|
| 28 |
|
| 29 |
side_bg = "static/sidebar.png"
|
| 30 |
side_bg_ext = "png"
|
|
|
|
| 15 |
|
| 16 |
device = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 17 |
|
| 18 |
+
with st.spinner("Loading PointNet++ model..."):
|
| 19 |
+
checkpoint = torch.load('checkpoints/best_model.pth', map_location=torch.device(device))
|
| 20 |
+
classifier = pn2.get_model(num_class=4, normal_channel=False)
|
| 21 |
+
classifier.load_state_dict(checkpoint['model_state_dict'])
|
| 22 |
+
classifier.eval()
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 23 |
|
| 24 |
side_bg = "static/sidebar.png"
|
| 25 |
side_bg_ext = "png"
|