Commit
·
ff86017
1
Parent(s):
a210367
First model version
Browse files- deploy/code/inference.py +6 -0
- deploy/code/requirements.txt +3 -0
- deploy/config.json +59 -0
- deploy/model.tar.gz +3 -0
- deploy/preprocessor_config.json +18 -0
- deploy/pytorch_model.bin +3 -0
deploy/code/inference.py
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
from transformers import pipeline
|
| 3 |
+
|
| 4 |
+
def model_fn(model_dir):
|
| 5 |
+
pipe = pipeline("object-detection", model=model_dir, threshold=0.1)
|
| 6 |
+
return pipe
|
deploy/code/requirements.txt
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
|
| 2 |
+
transformers==4.19
|
| 3 |
+
timm
|
deploy/config.json
ADDED
|
@@ -0,0 +1,59 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "facebook/detr-resnet-50",
|
| 3 |
+
"activation_dropout": 0.0,
|
| 4 |
+
"activation_function": "relu",
|
| 5 |
+
"architectures": [
|
| 6 |
+
"DetrForObjectDetection"
|
| 7 |
+
],
|
| 8 |
+
"attention_dropout": 0.0,
|
| 9 |
+
"auxiliary_loss": false,
|
| 10 |
+
"backbone": "resnet50",
|
| 11 |
+
"bbox_cost": 5,
|
| 12 |
+
"bbox_loss_coefficient": 5,
|
| 13 |
+
"class_cost": 1,
|
| 14 |
+
"d_model": 256,
|
| 15 |
+
"decoder_attention_heads": 8,
|
| 16 |
+
"decoder_ffn_dim": 2048,
|
| 17 |
+
"decoder_layerdrop": 0.0,
|
| 18 |
+
"decoder_layers": 6,
|
| 19 |
+
"dice_loss_coefficient": 1,
|
| 20 |
+
"dilation": false,
|
| 21 |
+
"dropout": 0.1,
|
| 22 |
+
"encoder_attention_heads": 8,
|
| 23 |
+
"encoder_ffn_dim": 2048,
|
| 24 |
+
"encoder_layerdrop": 0.0,
|
| 25 |
+
"encoder_layers": 6,
|
| 26 |
+
"eos_coefficient": 0.1,
|
| 27 |
+
"giou_cost": 2,
|
| 28 |
+
"giou_loss_coefficient": 2,
|
| 29 |
+
"id2label": {
|
| 30 |
+
"0": "LABEL_0",
|
| 31 |
+
"1": "LABEL_1",
|
| 32 |
+
"2": "LABEL_2",
|
| 33 |
+
"3": "LABEL_3",
|
| 34 |
+
"4": "LABEL_4",
|
| 35 |
+
"5": "LABEL_5",
|
| 36 |
+
"6": "LABEL_6"
|
| 37 |
+
},
|
| 38 |
+
"init_std": 0.02,
|
| 39 |
+
"init_xavier_std": 1.0,
|
| 40 |
+
"is_encoder_decoder": true,
|
| 41 |
+
"label2id": {
|
| 42 |
+
"LABEL_0": 0,
|
| 43 |
+
"LABEL_1": 1,
|
| 44 |
+
"LABEL_2": 2,
|
| 45 |
+
"LABEL_3": 3,
|
| 46 |
+
"LABEL_4": 4,
|
| 47 |
+
"LABEL_5": 5,
|
| 48 |
+
"LABEL_6": 6
|
| 49 |
+
},
|
| 50 |
+
"mask_loss_coefficient": 1,
|
| 51 |
+
"max_position_embeddings": 1024,
|
| 52 |
+
"model_type": "detr",
|
| 53 |
+
"num_hidden_layers": 6,
|
| 54 |
+
"num_queries": 100,
|
| 55 |
+
"position_embedding_type": "sine",
|
| 56 |
+
"scale_embedding": false,
|
| 57 |
+
"torch_dtype": "float32",
|
| 58 |
+
"transformers_version": "4.20.1"
|
| 59 |
+
}
|
deploy/model.tar.gz
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:05d4469e8b448e6b826e886738f8d42a17fc4343aed1351c19c03357ac584567
|
| 3 |
+
size 154443497
|
deploy/preprocessor_config.json
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"do_normalize": true,
|
| 3 |
+
"do_resize": true,
|
| 4 |
+
"feature_extractor_type": "DetrFeatureExtractor",
|
| 5 |
+
"format": "coco_detection",
|
| 6 |
+
"image_mean": [
|
| 7 |
+
0.485,
|
| 8 |
+
0.456,
|
| 9 |
+
0.406
|
| 10 |
+
],
|
| 11 |
+
"image_std": [
|
| 12 |
+
0.229,
|
| 13 |
+
0.224,
|
| 14 |
+
0.225
|
| 15 |
+
],
|
| 16 |
+
"max_size": 1333,
|
| 17 |
+
"size": 800
|
| 18 |
+
}
|
deploy/pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4593119397bbd4fa47b3414757da41fadaf94afb11ba10e33a3a92b38c5dd6e0
|
| 3 |
+
size 166618453
|