Skip to content

Commit f5d5cc1

Browse files
committed
Use remote URLs for new models. Update formatting.
1 parent 4e9cf3a commit f5d5cc1

File tree

1 file changed

+12
-13
lines changed

1 file changed

+12
-13
lines changed

trapdata/ml/models/classification.py

Lines changed: 12 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import timm
22
import torch
3+
import torch.utils.data
34
import torchvision
45

56
from trapdata import constants, logger
@@ -105,6 +106,7 @@ def forward(self, x):
105106

106107
return x
107108

109+
108110
class Resnet50Classifier_Turing(InferenceBaseClass):
109111
# function to run the Turing models
110112
logger.info("KG: Resnet50Classifier_Turing")
@@ -144,6 +146,7 @@ def post_process_batch(self, output):
144146
logger.debug(f"Post-processing result batch: {result}")
145147
return result
146148

149+
147150
class Resnet50Classifier(InferenceBaseClass):
148151
input_size = 300
149152

@@ -299,37 +302,33 @@ class QuebecVermontMothSpeciesClassifierMixedResolution(
299302
"quebec-vermont_moth-category-map_19Jan2023.json"
300303
)
301304

302-
class TuringCostaRicaSpeciesClassifier(
303-
SpeciesClassifier, Resnet50Classifier_Turing
304-
):
305+
306+
class TuringCostaRicaSpeciesClassifier(SpeciesClassifier, Resnet50Classifier_Turing):
305307
name = "Turing Costa Rica Species Classifier"
306-
description = (
307-
"Trained on 4th June 2024 by Turing team using Resnet50 model."
308-
)
308+
description = "Trained on 4th June 2024 by Turing team using Resnet50 model."
309309
weights_path = (
310+
"https://object-arbutus.cloud.computecanada.ca/ami-models/moths/classification/"
310311
"turing-costarica_v03_resnet50_2024-06-04-16-17_state.pt"
311312
)
312313
labels_path = (
314+
"https://object-arbutus.cloud.computecanada.ca/ami-models/moths/classification/"
313315
"03_costarica_data_category_map.json"
314316
)
315317

316318

317-
class TuringUKSpeciesClassifier(
318-
SpeciesClassifier, Resnet50Classifier_Turing
319-
):
319+
class TuringUKSpeciesClassifier(SpeciesClassifier, Resnet50Classifier_Turing):
320320
name = "Turing UK Species Classifier"
321-
description = (
322-
"Trained on 13th May 2024 by Turing team using Resnet50 model."
323-
)
321+
description = "Trained on 13th May 2024 by Turing team using Resnet50 model."
324322
weights_path = (
323+
"https://object-arbutus.cloud.computecanada.ca/ami-models/moths/classification/"
325324
"turing-uk_v03_resnet50_2024-05-13-10-03_state.pt"
326325
)
327326
labels_path = (
327+
"https://object-arbutus.cloud.computecanada.ca/ami-models/moths/classification/"
328328
"03_uk_data_category_map.json"
329329
)
330330

331331

332-
333332
class UKDenmarkMothSpeciesClassifierMixedResolution(
334333
SpeciesClassifier, Resnet50ClassifierLowRes
335334
):

0 commit comments

Comments
 (0)