Upload TrashClassificationPipeline
Browse files- config.json +13 -2
- pipeline.py +1 -2
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
|
@@ -19,8 +19,7 @@ class TrashClassificationPipeline(Pipeline):
|
|
| 19 |
return {}, {}, {}
|
| 20 |
|
| 21 |
def preprocess(self, inputs):
|
| 22 |
-
|
| 23 |
-
tensor = self.transform(img)
|
| 24 |
tensor = tensor.unsqueeze(0)
|
| 25 |
|
| 26 |
return tensor
|
|
|
|
| 19 |
return {}, {}, {}
|
| 20 |
|
| 21 |
def preprocess(self, inputs):
|
| 22 |
+
tensor = self.transform(inputs)
|
|
|
|
| 23 |
tensor = tensor.unsqueeze(0)
|
| 24 |
|
| 25 |
return tensor
|