Spaces:
Sleeping
Sleeping
added sum text
Browse files
app.py
CHANGED
|
@@ -27,6 +27,7 @@ class GradioApp:
|
|
| 27 |
model_class = CustomUnet if model_name == 'Custom' else Unet
|
| 28 |
self.models[model_name] = model_class(self.models[model_name], from_file=True, device='cpu')
|
| 29 |
self.models[model_name].eval()
|
|
|
|
| 30 |
prediction = self.models[model_name].predict(img_file, option='mask')[0] * 1
|
| 31 |
return img_file, [(prediction, 'person')]
|
| 32 |
|
|
@@ -43,10 +44,10 @@ class GradioApp:
|
|
| 43 |
outputs=gr.AnnotatedImage(label='Model predictions'),
|
| 44 |
examples=examples_list,
|
| 45 |
cache_examples=False,
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
)
|
| 51 |
demo.launch()
|
| 52 |
|
|
|
|
| 27 |
model_class = CustomUnet if model_name == 'Custom' else Unet
|
| 28 |
self.models[model_name] = model_class(self.models[model_name], from_file=True, device='cpu')
|
| 29 |
self.models[model_name].eval()
|
| 30 |
+
|
| 31 |
prediction = self.models[model_name].predict(img_file, option='mask')[0] * 1
|
| 32 |
return img_file, [(prediction, 'person')]
|
| 33 |
|
|
|
|
| 44 |
outputs=gr.AnnotatedImage(label='Model predictions'),
|
| 45 |
examples=examples_list,
|
| 46 |
cache_examples=False,
|
| 47 |
+
title='Person Segmentation',
|
| 48 |
+
description=f'This model performs segmentation on people in images. A Unet neural network architecture is used. \
|
| 49 |
+
The dataset can be found [here]() [Kaggle](https://github.com/VikramShenoy97/Human-Segmentation-Dataset) \
|
| 50 |
+
and the source code is on [GitHub](https://github.com/i4ata/UnetSegmentation).',
|
| 51 |
)
|
| 52 |
demo.launch()
|
| 53 |
|