alfiannajih commited on
Commit
9413287
·
verified ·
1 Parent(s): 0405829

Upload TrashClassificationPipeline

Browse files
Files changed (2) hide show
  1. config.json +13 -2
  2. pipeline.py +1 -1
config.json CHANGED
@@ -1,10 +1,21 @@
1
  {
 
2
  "architectures": [
3
  "MobileNetV3Model"
4
  ],
5
  "auto_map": {
6
- "AutoConfig": "config.MobileNetV3Config",
7
- "AutoModelForImageClassification": "model.MobileNetV3Model"
 
 
 
 
 
 
 
 
 
 
8
  },
9
  "id2label": {
10
  "0": "cardboard",
 
1
  {
2
+ "_name_or_path": "alfiannajih/trash-classification",
3
  "architectures": [
4
  "MobileNetV3Model"
5
  ],
6
  "auto_map": {
7
+ "AutoConfig": "alfiannajih/trash-classification--config.MobileNetV3Config",
8
+ "AutoModelForImageClassification": "alfiannajih/trash-classification--model.MobileNetV3Model"
9
+ },
10
+ "custom_pipelines": {
11
+ "image-classification": {
12
+ "impl": "pipeline.TrashClassificationPipeline",
13
+ "pt": [
14
+ "AutoModelForImageClassification"
15
+ ],
16
+ "tf": [],
17
+ "type": "image"
18
+ }
19
  },
20
  "id2label": {
21
  "0": "cardboard",
pipeline.py CHANGED
@@ -34,6 +34,6 @@ class TrashClassificationPipeline(Pipeline):
34
 
35
  def postprocess(self, out):
36
  pred = F.softmax(out, dim=1).argmax(dim=1)[0]
37
- label = self.model.config.id2label[str(pred)]
38
 
39
  return label
 
34
 
35
  def postprocess(self, out):
36
  pred = F.softmax(out, dim=1).argmax(dim=1)[0]
37
+ label = self.model.config.id2label[str(int(pred))]
38
 
39
  return label