[Dev] theme=soft
Browse files- .gitignore +1 -0
- app.py +1 -4
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
__pycache__
|
app.py
CHANGED
|
@@ -29,7 +29,6 @@ m3lmodel.load_state_dict(torch.load(m3lmodelpath, map_location=torch.device('cp
|
|
| 29 |
m3lmodel.eval()
|
| 30 |
|
| 31 |
|
| 32 |
-
|
| 33 |
class MaskStudentTeacher(nn.Module):
|
| 34 |
|
| 35 |
def __init__(self, student, teacher, ema_alpha, mode = 'train'):
|
|
@@ -69,7 +68,6 @@ class MaskStudentTeacher(nn.Module):
|
|
| 69 |
teacher_params = self.teacher.get_params()
|
| 70 |
return student_params
|
| 71 |
|
| 72 |
-
|
| 73 |
def preprocess_data(rgb, depth, dataset_settings):
|
| 74 |
#RGB: np.array, RGB
|
| 75 |
#Depth: np.array, minmax normalized, *255
|
|
@@ -81,7 +79,6 @@ def preprocess_data(rgb, depth, dataset_settings):
|
|
| 81 |
depth = torch.from_numpy(np.ascontiguousarray(depth)).float()
|
| 82 |
return rgb, depth
|
| 83 |
|
| 84 |
-
|
| 85 |
def visualize(colors, pred, num_classes, dataset_settings):
|
| 86 |
pred = pred.transpose(1, 2, 0)
|
| 87 |
predvis = np.zeros((dataset_settings['orig_height'], dataset_settings['orig_width'], 3))
|
|
@@ -142,7 +139,7 @@ for img in imgs:
|
|
| 142 |
'./examples/rgb/'+img, './examples/depth/'+img, ["M3L", "Mean Teacher"]
|
| 143 |
])
|
| 144 |
|
| 145 |
-
with gr.Blocks() as demo:
|
| 146 |
with gr.Row():
|
| 147 |
gr.Markdown(
|
| 148 |
"""
|
|
|
|
| 29 |
m3lmodel.eval()
|
| 30 |
|
| 31 |
|
|
|
|
| 32 |
class MaskStudentTeacher(nn.Module):
|
| 33 |
|
| 34 |
def __init__(self, student, teacher, ema_alpha, mode = 'train'):
|
|
|
|
| 68 |
teacher_params = self.teacher.get_params()
|
| 69 |
return student_params
|
| 70 |
|
|
|
|
| 71 |
def preprocess_data(rgb, depth, dataset_settings):
|
| 72 |
#RGB: np.array, RGB
|
| 73 |
#Depth: np.array, minmax normalized, *255
|
|
|
|
| 79 |
depth = torch.from_numpy(np.ascontiguousarray(depth)).float()
|
| 80 |
return rgb, depth
|
| 81 |
|
|
|
|
| 82 |
def visualize(colors, pred, num_classes, dataset_settings):
|
| 83 |
pred = pred.transpose(1, 2, 0)
|
| 84 |
predvis = np.zeros((dataset_settings['orig_height'], dataset_settings['orig_width'], 3))
|
|
|
|
| 139 |
'./examples/rgb/'+img, './examples/depth/'+img, ["M3L", "Mean Teacher"]
|
| 140 |
])
|
| 141 |
|
| 142 |
+
with gr.Blocks(theme=gr.themes.Soft()) as demo:
|
| 143 |
with gr.Row():
|
| 144 |
gr.Markdown(
|
| 145 |
"""
|