Spaces:
Runtime error
Runtime error
OmerFarooq
commited on
Commit
•
b23a511
1
Parent(s):
bafae09
Update app.py
Browse files
app.py
CHANGED
@@ -46,6 +46,14 @@ def create_model_mod(classes, activation):
|
|
46 |
|
47 |
return model, inputs, x, outputs
|
48 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
49 |
|
50 |
#create heatmaps of the given images
|
51 |
#returns the heatmaps and the raw score of predicted class of each image
|
|
|
46 |
|
47 |
return model, inputs, x, outputs
|
48 |
|
49 |
+
|
50 |
+
#function that creates a gradcam model and returns it
|
51 |
+
def create_grad_model(weights, classes, activation):
|
52 |
+
model_mod, input, x, output = create_model_mod(classes, activation)
|
53 |
+
#lodaing weights of already trained model
|
54 |
+
model_mod.load_weights(weights)
|
55 |
+
grad_model = Model(input, [x, output])
|
56 |
+
return grad_model
|
57 |
|
58 |
#create heatmaps of the given images
|
59 |
#returns the heatmaps and the raw score of predicted class of each image
|