Upload 3 files
Browse files- README.md +25 -0
 - config.json +167 -0
 - preprocessor_config.json +26 -0
 
    	
        README.md
    ADDED
    
    | 
         @@ -0,0 +1,25 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            ---
         
     | 
| 2 | 
         
            +
            license: apache-2.0
         
     | 
| 3 | 
         
            +
            pipeline_tag: object-detection
         
     | 
| 4 | 
         
            +
            library_name: transformers.js
         
     | 
| 5 | 
         
            +
            ---
         
     | 
| 6 | 
         
            +
             
     | 
| 7 | 
         
            +
            ## Usage (Transformers.js)
         
     | 
| 8 | 
         
            +
             
     | 
| 9 | 
         
            +
            If you haven't already, you can install the [Transformers.js](https://huggingface.co/docs/transformers.js) JavaScript library
         
     | 
| 10 | 
         
            +
            from [NPM](https://www.npmjs.com/package/@huggingface/transformers) using:
         
     | 
| 11 | 
         
            +
            ```bash
         
     | 
| 12 | 
         
            +
            npm i @huggingface/transformers
         
     | 
| 13 | 
         
            +
            ```
         
     | 
| 14 | 
         
            +
             
     | 
| 15 | 
         
            +
            **Example:** Perform object-detection with `onnx-community/rfdetr_small-ONNX`.
         
     | 
| 16 | 
         
            +
             
     | 
| 17 | 
         
            +
            ```js
         
     | 
| 18 | 
         
            +
            import { pipeline } from '@huggingface/transformers';
         
     | 
| 19 | 
         
            +
             
     | 
| 20 | 
         
            +
            const detector = await pipeline('object-detection', 'onnx-community/rfdetr_small-ONNX');
         
     | 
| 21 | 
         
            +
             
     | 
| 22 | 
         
            +
            const img = 'https://huggingface.co/datasets/Xenova/transformers.js-docs/resolve/main/cats.jpg';
         
     | 
| 23 | 
         
            +
            const output = await detector(img, { threshold: 0.75 });
         
     | 
| 24 | 
         
            +
            console.log(output);
         
     | 
| 25 | 
         
            +
            ```
         
     | 
    	
        config.json
    ADDED
    
    | 
         @@ -0,0 +1,167 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            {
         
     | 
| 2 | 
         
            +
              "model_type": "rf_detr",
         
     | 
| 3 | 
         
            +
              "id2label": {
         
     | 
| 4 | 
         
            +
                "1": "person",
         
     | 
| 5 | 
         
            +
                "2": "bicycle",
         
     | 
| 6 | 
         
            +
                "3": "car",
         
     | 
| 7 | 
         
            +
                "4": "motorcycle",
         
     | 
| 8 | 
         
            +
                "5": "airplane",
         
     | 
| 9 | 
         
            +
                "6": "bus",
         
     | 
| 10 | 
         
            +
                "7": "train",
         
     | 
| 11 | 
         
            +
                "8": "truck",
         
     | 
| 12 | 
         
            +
                "9": "boat",
         
     | 
| 13 | 
         
            +
                "10": "traffic light",
         
     | 
| 14 | 
         
            +
                "11": "fire hydrant",
         
     | 
| 15 | 
         
            +
                "13": "stop sign",
         
     | 
| 16 | 
         
            +
                "14": "parking meter",
         
     | 
| 17 | 
         
            +
                "15": "bench",
         
     | 
| 18 | 
         
            +
                "16": "bird",
         
     | 
| 19 | 
         
            +
                "17": "cat",
         
     | 
| 20 | 
         
            +
                "18": "dog",
         
     | 
| 21 | 
         
            +
                "19": "horse",
         
     | 
| 22 | 
         
            +
                "20": "sheep",
         
     | 
| 23 | 
         
            +
                "21": "cow",
         
     | 
| 24 | 
         
            +
                "22": "elephant",
         
     | 
| 25 | 
         
            +
                "23": "bear",
         
     | 
| 26 | 
         
            +
                "24": "zebra",
         
     | 
| 27 | 
         
            +
                "25": "giraffe",
         
     | 
| 28 | 
         
            +
                "27": "backpack",
         
     | 
| 29 | 
         
            +
                "28": "umbrella",
         
     | 
| 30 | 
         
            +
                "31": "handbag",
         
     | 
| 31 | 
         
            +
                "32": "tie",
         
     | 
| 32 | 
         
            +
                "33": "suitcase",
         
     | 
| 33 | 
         
            +
                "34": "frisbee",
         
     | 
| 34 | 
         
            +
                "35": "skis",
         
     | 
| 35 | 
         
            +
                "36": "snowboard",
         
     | 
| 36 | 
         
            +
                "37": "sports ball",
         
     | 
| 37 | 
         
            +
                "38": "kite",
         
     | 
| 38 | 
         
            +
                "39": "baseball bat",
         
     | 
| 39 | 
         
            +
                "40": "baseball glove",
         
     | 
| 40 | 
         
            +
                "41": "skateboard",
         
     | 
| 41 | 
         
            +
                "42": "surfboard",
         
     | 
| 42 | 
         
            +
                "43": "tennis racket",
         
     | 
| 43 | 
         
            +
                "44": "bottle",
         
     | 
| 44 | 
         
            +
                "46": "wine glass",
         
     | 
| 45 | 
         
            +
                "47": "cup",
         
     | 
| 46 | 
         
            +
                "48": "fork",
         
     | 
| 47 | 
         
            +
                "49": "knife",
         
     | 
| 48 | 
         
            +
                "50": "spoon",
         
     | 
| 49 | 
         
            +
                "51": "bowl",
         
     | 
| 50 | 
         
            +
                "52": "banana",
         
     | 
| 51 | 
         
            +
                "53": "apple",
         
     | 
| 52 | 
         
            +
                "54": "sandwich",
         
     | 
| 53 | 
         
            +
                "55": "orange",
         
     | 
| 54 | 
         
            +
                "56": "broccoli",
         
     | 
| 55 | 
         
            +
                "57": "carrot",
         
     | 
| 56 | 
         
            +
                "58": "hot dog",
         
     | 
| 57 | 
         
            +
                "59": "pizza",
         
     | 
| 58 | 
         
            +
                "60": "donut",
         
     | 
| 59 | 
         
            +
                "61": "cake",
         
     | 
| 60 | 
         
            +
                "62": "chair",
         
     | 
| 61 | 
         
            +
                "63": "couch",
         
     | 
| 62 | 
         
            +
                "64": "potted plant",
         
     | 
| 63 | 
         
            +
                "65": "bed",
         
     | 
| 64 | 
         
            +
                "67": "dining table",
         
     | 
| 65 | 
         
            +
                "70": "toilet",
         
     | 
| 66 | 
         
            +
                "72": "tv",
         
     | 
| 67 | 
         
            +
                "73": "laptop",
         
     | 
| 68 | 
         
            +
                "74": "mouse",
         
     | 
| 69 | 
         
            +
                "75": "remote",
         
     | 
| 70 | 
         
            +
                "76": "keyboard",
         
     | 
| 71 | 
         
            +
                "77": "cell phone",
         
     | 
| 72 | 
         
            +
                "78": "microwave",
         
     | 
| 73 | 
         
            +
                "79": "oven",
         
     | 
| 74 | 
         
            +
                "80": "toaster",
         
     | 
| 75 | 
         
            +
                "81": "sink",
         
     | 
| 76 | 
         
            +
                "82": "refrigerator",
         
     | 
| 77 | 
         
            +
                "84": "book",
         
     | 
| 78 | 
         
            +
                "85": "clock",
         
     | 
| 79 | 
         
            +
                "86": "vase",
         
     | 
| 80 | 
         
            +
                "87": "scissors",
         
     | 
| 81 | 
         
            +
                "88": "teddy bear",
         
     | 
| 82 | 
         
            +
                "89": "hair drier",
         
     | 
| 83 | 
         
            +
                "90": "toothbrush"
         
     | 
| 84 | 
         
            +
              },
         
     | 
| 85 | 
         
            +
              "label2id": {
         
     | 
| 86 | 
         
            +
                "person": 1,
         
     | 
| 87 | 
         
            +
                "bicycle": 2,
         
     | 
| 88 | 
         
            +
                "car": 3,
         
     | 
| 89 | 
         
            +
                "motorcycle": 4,
         
     | 
| 90 | 
         
            +
                "airplane": 5,
         
     | 
| 91 | 
         
            +
                "bus": 6,
         
     | 
| 92 | 
         
            +
                "train": 7,
         
     | 
| 93 | 
         
            +
                "truck": 8,
         
     | 
| 94 | 
         
            +
                "boat": 9,
         
     | 
| 95 | 
         
            +
                "traffic light": 10,
         
     | 
| 96 | 
         
            +
                "fire hydrant": 11,
         
     | 
| 97 | 
         
            +
                "stop sign": 13,
         
     | 
| 98 | 
         
            +
                "parking meter": 14,
         
     | 
| 99 | 
         
            +
                "bench": 15,
         
     | 
| 100 | 
         
            +
                "bird": 16,
         
     | 
| 101 | 
         
            +
                "cat": 17,
         
     | 
| 102 | 
         
            +
                "dog": 18,
         
     | 
| 103 | 
         
            +
                "horse": 19,
         
     | 
| 104 | 
         
            +
                "sheep": 20,
         
     | 
| 105 | 
         
            +
                "cow": 21,
         
     | 
| 106 | 
         
            +
                "elephant": 22,
         
     | 
| 107 | 
         
            +
                "bear": 23,
         
     | 
| 108 | 
         
            +
                "zebra": 24,
         
     | 
| 109 | 
         
            +
                "giraffe": 25,
         
     | 
| 110 | 
         
            +
                "backpack": 27,
         
     | 
| 111 | 
         
            +
                "umbrella": 28,
         
     | 
| 112 | 
         
            +
                "handbag": 31,
         
     | 
| 113 | 
         
            +
                "tie": 32,
         
     | 
| 114 | 
         
            +
                "suitcase": 33,
         
     | 
| 115 | 
         
            +
                "frisbee": 34,
         
     | 
| 116 | 
         
            +
                "skis": 35,
         
     | 
| 117 | 
         
            +
                "snowboard": 36,
         
     | 
| 118 | 
         
            +
                "sports ball": 37,
         
     | 
| 119 | 
         
            +
                "kite": 38,
         
     | 
| 120 | 
         
            +
                "baseball bat": 39,
         
     | 
| 121 | 
         
            +
                "baseball glove": 40,
         
     | 
| 122 | 
         
            +
                "skateboard": 41,
         
     | 
| 123 | 
         
            +
                "surfboard": 42,
         
     | 
| 124 | 
         
            +
                "tennis racket": 43,
         
     | 
| 125 | 
         
            +
                "bottle": 44,
         
     | 
| 126 | 
         
            +
                "wine glass": 46,
         
     | 
| 127 | 
         
            +
                "cup": 47,
         
     | 
| 128 | 
         
            +
                "fork": 48,
         
     | 
| 129 | 
         
            +
                "knife": 49,
         
     | 
| 130 | 
         
            +
                "spoon": 50,
         
     | 
| 131 | 
         
            +
                "bowl": 51,
         
     | 
| 132 | 
         
            +
                "banana": 52,
         
     | 
| 133 | 
         
            +
                "apple": 53,
         
     | 
| 134 | 
         
            +
                "sandwich": 54,
         
     | 
| 135 | 
         
            +
                "orange": 55,
         
     | 
| 136 | 
         
            +
                "broccoli": 56,
         
     | 
| 137 | 
         
            +
                "carrot": 57,
         
     | 
| 138 | 
         
            +
                "hot dog": 58,
         
     | 
| 139 | 
         
            +
                "pizza": 59,
         
     | 
| 140 | 
         
            +
                "donut": 60,
         
     | 
| 141 | 
         
            +
                "cake": 61,
         
     | 
| 142 | 
         
            +
                "chair": 62,
         
     | 
| 143 | 
         
            +
                "couch": 63,
         
     | 
| 144 | 
         
            +
                "potted plant": 64,
         
     | 
| 145 | 
         
            +
                "bed": 65,
         
     | 
| 146 | 
         
            +
                "dining table": 67,
         
     | 
| 147 | 
         
            +
                "toilet": 70,
         
     | 
| 148 | 
         
            +
                "tv": 72,
         
     | 
| 149 | 
         
            +
                "laptop": 73,
         
     | 
| 150 | 
         
            +
                "mouse": 74,
         
     | 
| 151 | 
         
            +
                "remote": 75,
         
     | 
| 152 | 
         
            +
                "keyboard": 76,
         
     | 
| 153 | 
         
            +
                "cell phone": 77,
         
     | 
| 154 | 
         
            +
                "microwave": 78,
         
     | 
| 155 | 
         
            +
                "oven": 79,
         
     | 
| 156 | 
         
            +
                "toaster": 80,
         
     | 
| 157 | 
         
            +
                "sink": 81,
         
     | 
| 158 | 
         
            +
                "refrigerator": 82,
         
     | 
| 159 | 
         
            +
                "book": 84,
         
     | 
| 160 | 
         
            +
                "clock": 85,
         
     | 
| 161 | 
         
            +
                "vase": 86,
         
     | 
| 162 | 
         
            +
                "scissors": 87,
         
     | 
| 163 | 
         
            +
                "teddy bear": 88,
         
     | 
| 164 | 
         
            +
                "hair drier": 89,
         
     | 
| 165 | 
         
            +
                "toothbrush": 90
         
     | 
| 166 | 
         
            +
              }
         
     | 
| 167 | 
         
            +
            }
         
     | 
    	
        preprocessor_config.json
    ADDED
    
    | 
         @@ -0,0 +1,26 @@ 
     | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
|
| 
         | 
| 
         | 
|
| 1 | 
         
            +
            {
         
     | 
| 2 | 
         
            +
              "do_convert_annotations": true,
         
     | 
| 3 | 
         
            +
              "do_normalize": false,
         
     | 
| 4 | 
         
            +
              "do_pad": false,
         
     | 
| 5 | 
         
            +
              "do_rescale": true,
         
     | 
| 6 | 
         
            +
              "do_resize": true,
         
     | 
| 7 | 
         
            +
              "format": "coco_detection",
         
     | 
| 8 | 
         
            +
              "image_mean": [
         
     | 
| 9 | 
         
            +
                0.485,
         
     | 
| 10 | 
         
            +
                0.456,
         
     | 
| 11 | 
         
            +
                0.406
         
     | 
| 12 | 
         
            +
              ],
         
     | 
| 13 | 
         
            +
              "image_processor_type": "RTDetrImageProcessor",
         
     | 
| 14 | 
         
            +
              "image_std": [
         
     | 
| 15 | 
         
            +
                0.229,
         
     | 
| 16 | 
         
            +
                0.224,
         
     | 
| 17 | 
         
            +
                0.225
         
     | 
| 18 | 
         
            +
              ],
         
     | 
| 19 | 
         
            +
              "pad_size": null,
         
     | 
| 20 | 
         
            +
              "resample": 2,
         
     | 
| 21 | 
         
            +
              "rescale_factor": 0.00392156862745098,
         
     | 
| 22 | 
         
            +
              "size": {
         
     | 
| 23 | 
         
            +
                "height": 560,
         
     | 
| 24 | 
         
            +
                "width": 560
         
     | 
| 25 | 
         
            +
              }
         
     | 
| 26 | 
         
            +
            }
         
     |