Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -26,6 +26,7 @@ def real_dice_coeff(y_true, y_pred):
|
|
| 26 |
dice_score = (2.0 * intersection + smooth) / (K.sum(y_true_flatten) + K.sum(y_pred_flatten) + smooth)
|
| 27 |
return dice_score
|
| 28 |
|
|
|
|
| 29 |
|
| 30 |
dice_loss = sm.losses.DiceLoss(class_weights = weights)
|
| 31 |
focal_loss = sm.losses.CategoricalFocalLoss()
|
|
|
|
| 26 |
dice_score = (2.0 * intersection + smooth) / (K.sum(y_true_flatten) + K.sum(y_pred_flatten) + smooth)
|
| 27 |
return dice_score
|
| 28 |
|
| 29 |
+
weights = [0.5,0.5] # hyper parameter
|
| 30 |
|
| 31 |
dice_loss = sm.losses.DiceLoss(class_weights = weights)
|
| 32 |
focal_loss = sm.losses.CategoricalFocalLoss()
|