@@ -113,7 +113,7 @@ def predict(*img_paths, Classifier: typing.Type[MothClassifier]):
113
113
from functools import partial
114
114
115
115
116
- def make_interface (Classifier : MothClassifier , example_images_subdir = "" ):
116
+ def make_interface (Classifier : MothClassifier , example_images_subdirs : list [ str ] = [] ):
117
117
return gr .Interface (
118
118
title = Classifier .name ,
119
119
description = Classifier .description ,
@@ -124,19 +124,19 @@ def make_interface(Classifier: MothClassifier, example_images_subdir=""):
124
124
gr .Gallery (label = "Classified Crops" ),
125
125
],
126
126
examples = [
127
- img .filepath for img in get_test_images (subdir = example_images_subdir )
127
+ img .filepath for img in get_test_images (subdirs = example_images_subdirs )
128
128
],
129
129
)
130
130
131
131
132
132
app = gr .TabbedInterface (
133
133
[
134
- make_interface (MothClassifierPanama , "panama" ), # type: ignore
135
- make_interface (MothClassifierPanama2024 , "panama" ), # type: ignore
136
- make_interface (MothClassifierUKDenmark , "denmark" ), # type: ignore
137
- make_interface (MothClassifierQuebecVermont , "vermont" ), # type: ignore
138
- make_interface (MothClassifierTuringCostaRica , "costarica" ), # type: ignore
139
- make_interface (MothClassifierGlobal , "vermont" ), # type: ignore
134
+ make_interface (MothClassifierPanama , [ "panama" ]),
135
+ make_interface (MothClassifierPanama2024 , [ "panama" ]),
136
+ make_interface (MothClassifierUKDenmark , [ "denmark" ]),
137
+ make_interface (MothClassifierQuebecVermont , [ "vermont" ]),
138
+ make_interface (MothClassifierTuringCostaRica , [ "costarica" ]),
139
+ make_interface (MothClassifierGlobal , [ "vermont" , "panama" , "denmark" , "costarica" ]),
140
140
],
141
141
[
142
142
"Panama 2023" ,
0 commit comments