Spaces:
Running
Running
Merge branch 'master' into huggingface
Browse files- app.py +3 -3
- modules/html_constants.py +3 -0
app.py
CHANGED
@@ -42,8 +42,8 @@ class App:
|
|
42 |
with open(default_hparam_config_path, 'r') as file:
|
43 |
self.default_hparams = yaml.safe_load(file)
|
44 |
|
45 |
-
def
|
46 |
-
|
47 |
if hparams is None:
|
48 |
hparams = self.default_hparams["mask_hparams"]
|
49 |
mask_components = [
|
@@ -122,7 +122,7 @@ class App:
|
|
122 |
choices=self.sam_inf.available_models)
|
123 |
|
124 |
with gr.Accordion("Mask Parameters", open=False, visible=self.default_mode == AUTOMATIC_MODE) as acc_mask_hparams:
|
125 |
-
mask_hparams_component = self.
|
126 |
|
127 |
cb_multimask_output = gr.Checkbox(label="multimask_output", value=_mask_hparams["multimask_output"])
|
128 |
|
|
|
42 |
with open(default_hparam_config_path, 'r') as file:
|
43 |
self.default_hparams = yaml.safe_load(file)
|
44 |
|
45 |
+
def mask_generation_parameters(self,
|
46 |
+
hparams: Optional[Dict] = None):
|
47 |
if hparams is None:
|
48 |
hparams = self.default_hparams["mask_hparams"]
|
49 |
mask_components = [
|
|
|
122 |
choices=self.sam_inf.available_models)
|
123 |
|
124 |
with gr.Accordion("Mask Parameters", open=False, visible=self.default_mode == AUTOMATIC_MODE) as acc_mask_hparams:
|
125 |
+
mask_hparams_component = self.mask_generation_parameters(_mask_hparams)
|
126 |
|
127 |
cb_multimask_output = gr.Checkbox(label="multimask_output", value=_mask_hparams["multimask_output"])
|
128 |
|
modules/html_constants.py
CHANGED
@@ -10,6 +10,9 @@ HEADER = """
|
|
10 |
<a href="https://colab.research.google.com/github/jhj0517/sam2-playground/blob/master/notebooks/sam2_playground.ipynb">
|
11 |
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Colab" style="display:inline-block;">
|
12 |
</a>
|
|
|
|
|
|
|
13 |
</div>
|
14 |
|
15 |
"""
|
|
|
10 |
<a href="https://colab.research.google.com/github/jhj0517/sam2-playground/blob/master/notebooks/sam2_playground.ipynb">
|
11 |
<img src="https://colab.research.google.com/assets/colab-badge.svg" alt="Colab" style="display:inline-block;">
|
12 |
</a>
|
13 |
+
<a href="https://huggingface.co/spaces/jhj0517/sam2-playground">
|
14 |
+
<img src="https://img.shields.io/badge/Hugging%20Face-%F0%9F%A4%97%20Spaces-orange?logo=huggingface&labelColor=FFFFE0" alt="Colab" style="display:inline-block;">
|
15 |
+
</a>
|
16 |
</div>
|
17 |
|
18 |
"""
|