{
  "id": "task_libraries:object-detection/python",
  "path": "/exapedia/python-object-detection-libraries",
  "template": {
    "id": "task_libraries",
    "version": 4
  },
  "title": "Python object detection libraries",
  "answer": [
    {
      "t": "text",
      "text": "Python object detection libraries find objects in images and video and return each one with a label, a confidence score, and a bounding box. A detector runs a trained neural network on each image and filters overlapping boxes before returning results. These libraries let cameras, robots, and AI agents locate what appears in a scene."
    }
  ],
  "breadcrumb": [
    {
      "label": "Tools"
    },
    {
      "label": "Python object detection libraries"
    }
  ],
  "sections": [
    {
      "id": "libraries_popularity",
      "anchor": "popularity",
      "heading": "Popularity",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "Monthly downloads",
            "Stars",
            "Last release",
            "License"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#transformers",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F141"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F145"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#opencv-python-headless",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F156"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F160"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#torchvision",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F173"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F177"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ultralytics",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F188"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F192"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#modelscope",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F203"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F207"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#mediapipe",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F220"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#paddlex",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F233"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F237"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#keras-hub",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F246"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F250"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            ]
          ],
          "variant": "pop",
          "caption": [
            {
              "t": "text",
              "text": "Downloads: "
            },
            {
              "t": "text",
              "text": "PyPI"
            },
            {
              "t": "text",
              "text": ", last thirty days. Stars and releases: GitHub. Amber: no release in over a year."
            }
          ]
        }
      ],
      "note": [
        {
          "t": "link",
          "href": "#transformers",
          "label": [
            {
              "t": "text",
              "text": "Transformers"
            }
          ]
        },
        {
          "t": "text",
          "text": " has the most monthly downloads in this comparison, at "
        },
        {
          "t": "fact",
          "fact": "F142"
        },
        {
          "t": "text",
          "text": ", a count that covers every model task in the library."
        }
      ]
    },
    {
      "id": "libraries_capabilities",
      "anchor": "capabilities",
      "heading": "Capabilities",
      "blocks": [
        {
          "b": "table",
          "columns": [
            "Library",
            "PyTorch required for detector",
            "Downloads pretrained weights"
          ],
          "rows": [
            [
              [
                {
                  "t": "link",
                  "href": "#transformers",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F141"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F149"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F150"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#opencv-python-headless",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F156"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F166"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F167"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#torchvision",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F173"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F181"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F182"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#ultralytics",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F188"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F196"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F197"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#modelscope",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F203"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F213"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F214"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#mediapipe",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F216"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F226"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F227"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#paddlex",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F233"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F243"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F244"
                }
              ]
            ],
            [
              [
                {
                  "t": "link",
                  "href": "#keras-hub",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F246"
                    }
                  ]
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F256"
                }
              ],
              [
                {
                  "t": "fact",
                  "fact": "F257"
                }
              ]
            ]
          ],
          "variant": "cap"
        }
      ]
    },
    {
      "id": "libraries_entries",
      "anchor": "libraries",
      "heading": "Libraries",
      "blocks": [
        {
          "b": "entry",
          "anchor": "transformers",
          "name": [
            {
              "t": "fact",
              "fact": "F141"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/huggingface/transformers"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/transformers"
            },
            {
              "label": "Docs",
              "href": "https://huggingface.co/docs/transformers/main/en/tasks/object_detection"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F12"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F142"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F148"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F144"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F143"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://huggingface.co/docs/transformers/main/en/tasks/object_detection",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F141"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F13"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F14"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F15"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F16"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F17"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F18"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F19"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F20"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F154"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F155"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/obss/sahi",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F154"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def perform_inference(self, image: list | np.ndarray):\n    \"\"\"Prediction is performed using self.model and the prediction result is set to self._original_predictions.\n\n    Args:\n        image: np.ndarray\n            A numpy array that contains the image to be predicted. 3 channel image should be in RGB order.\n    \"\"\"\n    import torch\n\n    # Confirm model is loaded\n    if self.model is None or self.processor is None:\n        raise RuntimeError(\"Model is not loaded, load it by calling .load_model()\")\n\n    with torch.no_grad():\n        inputs = self.processor(images=image, return_tensors=\"pt\")\n        inputs[\"pixel_values\"] = inputs.pixel_values.to(self.device)\n        if hasattr(inputs, \"pixel_mask\"):\n            inputs[\"pixel_mask\"] = inputs.pixel_mask.to(self.device)\n        outputs = self.model(**inputs)\n\n    if isinstance(image, list):\n        self._image_shapes = [img.shape for img in image]\n    else:\n        self._image_shapes = [image.shape]\n    self._original_predictions = outputs",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/obss/sahi/blob/8af413e53115525e4af1cfbc1873019ccb548434/sahi/models/huggingface.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F153"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20transformers%20for%20image%20object%20detection%20with%20bounding%20boxes%20and%20annotation%20conversion&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F141"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from PIL import Image\nfrom transformers import pipeline\ndetector = pipeline(\"object-detection\", model=\"facebook/detr-resnet-50\", device=-1)\nprint(detector(Image.new(\"RGB\", (640, 480))))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://huggingface.co/docs/transformers/main/en/tasks/object_detection",
                  "label": [
                    {
                      "t": "text",
                      "text": "object_detection.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F146"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "opencv-python-headless",
          "name": [
            {
              "t": "fact",
              "fact": "F156"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/opencv/opencv-python"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/opencv-python-headless"
            },
            {
              "label": "Docs",
              "href": "https://docs.opencv.org/5.1.0/d3/df1/classcv_1_1dnn_1_1DetectionModel.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F163"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F157"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F165"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F159"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F158"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.opencv.org/5.1.0/d3/df1/classcv_1_1dnn_1_1DetectionModel.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F156"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F171"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F172"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/opencv/opencv",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F171"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def processingThreadBody():\n    global processedFramesQueue, predictionsQueue, args, process, asyncN\n\n    futureOutputs = []\n    while process:\n        # Get a next frame\n        frame = None\n        try:\n            frame = framesQueue.get_nowait()\n\n            if asyncN:\n                if len(futureOutputs) == asyncN:\n                    frame = None  # Skip the frame\n            else:\n                framesQueue.queue.clear()  # Skip the rest of frames\n        except queue.Empty:\n            pass\n\n\n        if not frame is None:\n            frameHeight = frame.shape[0]\n            frameWidth = frame.shape[1]\n\n            # Create a 4D blob from a frame.\n            inpWidth = args.width if args.width else frameWidth\n            inpHeight = args.height if args.height else frameHeight\n            blob = cv.dnn.blobFromImage(frame, scalefactor=args.scale, mean=args.mean, size=(inpWidth, inpHeight), swapRB=args.rgb, ddepth=cv.CV_32F)\n            processedFramesQueue.put(frame)\n\n            # Run a model\n            net.setInput(blob)\n\n            if asyncN:\n                futureOutputs.append(net.forwardAsync())\n            else:\n                outs = net.forward(outNames)\n                net.printPerfProfile()\n                predictionsQueue.put(copy.deepcopy(outs))\n\n        while futureOutputs and futureOutputs[0].wait_for(0):\n            out = futureOutputs[0].get()\n            predictionsQueue.put(copy.deepcopy([out]))\n\n            del futureOutputs[0]",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/opencv/opencv/blob/e4f78fbcf1a773fbed69e14500e8b734963eb585/samples/dnn/object_detection.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F170"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=opencv-python-headless%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F156"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import json, sys, cv2\ndetector = cv2.dnn.DetectionModel(sys.argv[1])\ndetector.setInputParams(**json.loads(sys.argv[2]))\nprint(detector.detect(cv2.imread(sys.argv[3]), confThreshold=0.5, nmsThreshold=0.4))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.opencv.org/5.1.0/d3/df1/classcv_1_1dnn_1_1DetectionModel.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "dnn.hpp"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F161"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "torchvision",
          "name": [
            {
              "t": "fact",
              "fact": "F173"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/pytorch/vision"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/torchvision"
            },
            {
              "label": "Docs",
              "href": "https://docs.pytorch.org/vision/stable/models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F37"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F174"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F180"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F176"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F175"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.pytorch.org/vision/stable/models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F173"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F38"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F39"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F40"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F41"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F42"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F43"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F44"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F45"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F186"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F187"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/cvat-ai/cvat",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F186"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def detect(\n    self, context: cvataa.DetectionFunctionContext, image: PIL.Image.Image\n) -> list[models.LabeledShapeRequest]:\n    conf_threshold = context.conf_threshold or 0\n    results = self._model([self._transforms(image)])\n\n    return [\n        cvataa.rectangle(label.item(), [x.item() for x in box])\n        for result in results\n        for box, label, score in zip(result[\"boxes\"], result[\"labels\"], result[\"scores\"])\n        if score >= conf_threshold\n    ]",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/cvat-ai/cvat/blob/125313b9e252478a5e4d179c37bdcd2a1bb69760/cvat-sdk/cvat_sdk/auto_annotation/functions/torchvision_detection.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F185"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20torchvision%20for%20image%20object%20detection%20with%20bounding%20boxes%20and%20annotation%20conversion&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F173"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "from PIL import Image\nfrom torchvision.models.detection import fasterrcnn_resnet50_fpn, FasterRCNN_ResNet50_FPN_Weights\nweights = FasterRCNN_ResNet50_FPN_Weights.DEFAULT\nmodel = fasterrcnn_resnet50_fpn(weights=weights).eval()\nprint(model([weights.transforms()(Image.new(\"RGB\", (640, 480)))]))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.pytorch.org/vision/stable/models/generated/torchvision.models.detection.fasterrcnn_resnet50_fpn.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "models.html"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F178"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "ultralytics",
          "name": [
            {
              "t": "fact",
              "fact": "F188"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/ultralytics/ultralytics"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/ultralytics"
            },
            {
              "label": "Docs",
              "href": "https://docs.ultralytics.com/modes/predict/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F63"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F189"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F195"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F191"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F190"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://docs.ultralytics.com/modes/predict/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F188"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F64"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F65"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F66"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F67"
                }
              ]
            }
          ],
          "cons": [
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F68"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F69"
                }
              ]
            },
            {
              "lead": [
                {
                  "t": "fact",
                  "fact": "F70"
                }
              ],
              "body": [
                {
                  "t": "fact",
                  "fact": "F71"
                }
              ]
            }
          ],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F201"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F202"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/obss/sahi",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F201"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def load_model(self):\n    \"\"\"Detection model is initialized and set to self.model.\n\n    Supports both PyTorch (.pt) and ONNX (.onnx) models.\n    \"\"\"\n\n    from ultralytics import YOLO\n\n    if self.model_path and \".onnx\" in self.model_path:\n        check_requirements([\"onnx\", \"onnxruntime\"])\n\n    try:\n        model = YOLO(self.model_path)\n        # Only call .to(device) for PyTorch models, not ONNX\n        if self.model_path and not self.model_path.endswith(\".onnx\"):\n            model.to(self.device)\n        self.set_model(model)\n        if self.fuse and hasattr(model, \"fuse\"):\n            model.fuse()\n\n    except Exception as e:\n        raise TypeError(\"model_path is not a valid Ultralytics model path: \", e)",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/obss/sahi/blob/8af413e53115525e4af1cfbc1873019ccb548434/sahi/models/ultralytics.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F200"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=Projects%20using%20ultralytics%20for%20image%20object%20detection%20with%20bounding%20boxes%20and%20annotation%20conversion&filters=%7B%22type%22%3A%20%22auto%22%2C%20%22numResults%22%3A%2010%2C%20%22includeDomains%22%3A%20%5B%22github.com%22%5D%7D",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F188"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import numpy as np\nfrom ultralytics import YOLO\nmodel = YOLO(\"yolo26n.pt\")\nprint(model.predict(np.zeros((640, 640, 3), dtype=np.uint8), device=\"cpu\"))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://docs.ultralytics.com/modes/predict/",
                  "label": [
                    {
                      "t": "text",
                      "text": "predict.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F193"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "modelscope",
          "name": [
            {
              "t": "fact",
              "fact": "F203"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/modelscope/modelscope"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/modelscope"
            },
            {
              "label": "Docs",
              "href": "https://github.com/modelscope/modelscope/blob/v1.40.3/modelscope/pipelines/cv/tinynas_detection_pipeline.py"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F210"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F204"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F212"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F206"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F205"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://github.com/modelscope/modelscope/blob/v1.40.3/modelscope/pipelines/cv/tinynas_detection_pipeline.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F203"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import sys, numpy as np\nfrom modelscope.pipelines import pipeline\nfrom modelscope.utils.constant import Tasks\ndetector = pipeline(Tasks.image_object_detection, model=sys.argv[1], device=\"cpu\")\nprint(detector(np.zeros((640, 640, 3), dtype=np.uint8)))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://github.com/modelscope/modelscope/blob/v1.40.3/modelscope/pipelines/cv/tinynas_detection_pipeline.py",
                  "label": [
                    {
                      "t": "text",
                      "text": "tinynas_detection_pipeline.py"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=modelscope%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F203"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F208"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "mediapipe",
          "name": [
            {
              "t": "fact",
              "fact": "F216"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/google-ai-edge/mediapipe"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/mediapipe"
            },
            {
              "label": "Docs",
              "href": "https://ai.google.dev/edge/mediapipe/solutions/vision/object_detector/python"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F223"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F217"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F225"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F219"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F218"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://ai.google.dev/edge/mediapipe/solutions/vision/object_detector/python",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F216"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "fact",
                  "fact": "F231"
                }
              ],
              "stars": [
                {
                  "t": "fact",
                  "fact": "F232"
                }
              ],
              "usedBy": [
                {
                  "t": "link",
                  "href": "https://github.com/google-ai-edge/mediapipe-samples",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F231"
                    }
                  ]
                },
                {
                  "t": "text",
                  "text": " "
                }
              ],
              "language": "python",
              "code": "def run(model: str, max_results: int, score_threshold: float, \n        camera_id: int, width: int, height: int) -> None:\n  \"\"\"Continuously run inference on images acquired from the camera.\n\n  Args:\n    model: Name of the TFLite object detection model.\n    max_results: Max number of detection results.\n    score_threshold: The score threshold of detection results.\n    camera_id: The camera id to be passed to OpenCV.\n    width: The width of the frame captured from the camera.\n    height: The height of the frame captured from the camera.\n  \"\"\"\n\n  # Start capturing video input from the camera\n  cap = cv2.VideoCapture(camera_id)\n  cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)\n  cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)\n\n  # Visualization parameters\n  row_size = 50  # pixels\n  left_margin = 24  # pixels\n  text_color = (0, 0, 0)  # black\n  font_size = 1\n  font_thickness = 1\n  fps_avg_frame_count = 10\n\n  detection_frame = None\n  detection_result_list = []\n\n  def save_result(result: vision.ObjectDetectorResult, unused_output_image: mp.Image, timestamp_ms: int):\n      global FPS, COUNTER, START_TIME\n\n      # Calculate the FPS\n      if COUNTER % fps_avg_frame_count == 0:\n          FPS = fps_avg_frame_count / (time.time() - START_TIME)\n          START_TIME = time.time()\n\n      detection_result_list.append(result)\n      COUNTER += 1\n\n  # Initialize the object detection model\n  base_options = python.BaseOptions(model_asset_path=model)\n  options = vision.ObjectDetectorOptions(base_options=base_options,\n                                         running_mode=vision.RunningMode.LIVE_STREAM,\n                                         max_results=max_results, score_threshold=score_threshold,\n                                         result_callback=save_result)\n  detector = vision.ObjectDetector.create_from_options(options)\n\n\n  # Continuously capture images from the camera and run inference\n  while cap.isOpened():\n    success, image = cap.read()\n    if not success:\n      sys.exit(\n          'ERROR: Unable to read from webcam. Please verify your webcam settings.'\n      )\n\n    image = cv2.flip(image, 1)\n\n    # Convert the image from BGR to RGB as required by the TFLite model.\n    rgb_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=rgb_image)\n\n    # Run object detection using the model.\n    detector.detect_async(mp_image, time.time_ns() // 1_000_000)\n\n    # Show the FPS\n    fps_text = 'FPS = {:.1f}'.format(FPS)\n    text_location = (left_margin, row_size)\n    current_frame = image\n    cv2.putText(current_frame, fps_text, text_location, cv2.FONT_HERSHEY_DUPLEX,\n                font_size, text_color, font_thickness, cv2.LINE_AA)\n\n    if detection_result_list:\n        # print(detection_result_list)\n        current_frame = visualize(current_frame, detection_result_list[0])\n        detection_frame = current_frame\n        detection_result_list.clear()\n\n    if detection_frame is not None:\n        cv2.imshow('object_detection', detection_frame)\n\n    # Stop the program if the ESC key is pressed.\n    if cv2.waitKey(1) == 27:\n      break\n\n  detector.close()\n  cap.release()\n  cv2.destroyAllWindows()",
              "prov": [
                {
                  "t": "link",
                  "href": "https://github.com/google-ai-edge/mediapipe-samples/blob/46d60d66baf21ae91977c488ea0875f0e13c4d2b/examples/object_detection/raspberry_pi/detect.py",
                  "label": [
                    {
                      "t": "fact",
                      "fact": "F230"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=mediapipe%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "More projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F216"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            },
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import sys, mediapipe as mp\noptions = mp.tasks.vision.ObjectDetectorOptions(base_options=mp.tasks.BaseOptions(model_asset_path=sys.argv[1]))\nwith mp.tasks.vision.ObjectDetector.create_from_options(options) as detector:\n    print(detector.detect(mp.Image.create_from_file(sys.argv[2])))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://ai.google.dev/edge/mediapipe/solutions/vision/object_detector/python",
                  "label": [
                    {
                      "t": "text",
                      "text": "README.md"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F221"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "paddlex",
          "name": [
            {
              "t": "fact",
              "fact": "F233"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/PaddlePaddle/PaddleX"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/paddlex"
            },
            {
              "label": "Docs",
              "href": "https://paddlepaddle.github.io/PaddleX/latest/en/pipeline_usage/tutorials/cv_pipelines/object_detection.html"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F240"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F234"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F242"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F236"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F235"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://paddlepaddle.github.io/PaddleX/latest/en/pipeline_usage/tutorials/cv_pipelines/object_detection.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F233"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import numpy as np\nfrom paddlex import create_pipeline\npipeline = create_pipeline(pipeline=\"object_detection\", device=\"cpu\")\nfor result in pipeline.predict(np.zeros((640, 640, 3), dtype=np.uint8), threshold=0.5):\n    result.print()\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://paddlepaddle.github.io/PaddleX/latest/en/pipeline_usage/tutorials/cv_pipelines/object_detection.html",
                  "label": [
                    {
                      "t": "text",
                      "text": "object_detection.md"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=paddlex%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F233"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F238"
            }
          ]
        },
        {
          "b": "entry",
          "anchor": "keras-hub",
          "name": [
            {
              "t": "fact",
              "fact": "F246"
            }
          ],
          "links": [
            {
              "label": "GitHub",
              "href": "https://github.com/keras-team/keras-hub"
            },
            {
              "label": "PyPI",
              "href": "https://pypi.org/project/keras-hub"
            },
            {
              "label": "Docs",
              "href": "https://keras.io/keras_hub/api/models/retinanet/retinanet_object_detector/"
            }
          ],
          "what": [
            {
              "t": "fact",
              "fact": "F253"
            }
          ],
          "facts": [
            {
              "label": "Downloads / mo",
              "value": [
                {
                  "t": "fact",
                  "fact": "F247"
                }
              ]
            },
            {
              "label": "Stars",
              "value": [
                {
                  "t": "fact",
                  "fact": "F255"
                }
              ]
            },
            {
              "label": "Last release",
              "value": [
                {
                  "t": "fact",
                  "fact": "F249"
                }
              ]
            },
            {
              "label": "License",
              "value": [
                {
                  "t": "fact",
                  "fact": "F248"
                }
              ]
            },
            {
              "label": "Capabilities",
              "value": [
                {
                  "t": "link",
                  "href": "https://keras.io/keras_hub/api/models/retinanet/retinanet_object_detector/",
                  "label": [
                    {
                      "t": "text",
                      "text": "From the "
                    },
                    {
                      "t": "fact",
                      "fact": "F246"
                    },
                    {
                      "t": "text",
                      "text": " docs"
                    }
                  ]
                }
              ]
            }
          ],
          "pros": [],
          "cons": [],
          "tabs": [
            {
              "label": [
                {
                  "t": "text",
                  "text": "Quickstart"
                }
              ],
              "language": "python",
              "code": "import os\nos.environ[\"KERAS_BACKEND\"] = \"torch\"\nimport numpy as np, keras_hub\ndetector = keras_hub.models.RetinaNetObjectDetector.from_preset(\"retinanet_resnet50_fpn_coco\")\nprint(detector.predict(np.zeros((1, 800, 800, 3), dtype=np.uint8)))\n",
              "prov": [
                {
                  "t": "text",
                  "text": "From "
                },
                {
                  "t": "link",
                  "href": "https://keras.io/keras_hub/api/models/retinanet/retinanet_object_detector/",
                  "label": [
                    {
                      "t": "text",
                      "text": "retinanet_object_detector.py"
                    }
                  ]
                }
              ],
              "more": [
                {
                  "t": "link",
                  "href": "https://dashboard.exa.ai/playground/search?q=keras-hub%20GitHub%20projects",
                  "label": [
                    {
                      "t": "text",
                      "text": "Find projects using "
                    },
                    {
                      "t": "fact",
                      "fact": "F246"
                    },
                    {
                      "t": "text",
                      "text": " →"
                    }
                  ]
                }
              ]
            }
          ],
          "install": [
            {
              "t": "fact",
              "fact": "F251"
            }
          ]
        }
      ]
    }
  ],
  "questions": [
    {
      "q": "Which Python object detection library should I use?",
      "a": [
        {
          "t": "link",
          "href": "#ultralytics",
          "label": [
            {
              "t": "text",
              "text": "Ultralytics"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits YOLO models with prediction, training, and export in one interface. "
        },
        {
          "t": "link",
          "href": "#transformers",
          "label": [
            {
              "t": "text",
              "text": "Transformers"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits pretrained transformer detectors and prompted detection models. "
        },
        {
          "t": "link",
          "href": "#torchvision",
          "label": [
            {
              "t": "text",
              "text": "TorchVision"
            }
          ]
        },
        {
          "t": "text",
          "text": " suits projects already built on PyTorch tensors and training code."
        }
      ]
    },
    {
      "q": "What is Ultralytics?",
      "a": [
        {
          "t": "link",
          "href": "#ultralytics",
          "label": [
            {
              "t": "text",
              "text": "Ultralytics"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a Python package for YOLO models that covers detection, segmentation, classification, and pose estimation. It loads published checkpoints automatically and runs on CPU or GPU."
        }
      ]
    },
    {
      "q": "What is ModelScope?",
      "a": [
        {
          "t": "link",
          "href": "#modelscope",
          "label": [
            {
              "t": "text",
              "text": "ModelScope"
            }
          ]
        },
        {
          "t": "text",
          "text": " is a model hub with task pipelines that load a model by ID and return structured results. Its object detection pipeline runs registered detection models on PyTorch."
        }
      ]
    },
    {
      "q": "How do I detect objects with OpenCV?",
      "a": [
        {
          "t": "link",
          "href": "#opencv-python-headless",
          "label": [
            {
              "t": "text",
              "text": "opencv-python-headless"
            }
          ]
        },
        {
          "t": "text",
          "text": " runs exported detection models through its DNN module, with preprocessing and non-maximum suppression. The application supplies the model files."
        }
      ]
    },
    {
      "q": "What is MediaPipe?",
      "a": [
        {
          "t": "link",
          "href": "#mediapipe",
          "label": [
            {
              "t": "text",
              "text": "MediaPipe"
            }
          ]
        },
        {
          "t": "text",
          "text": " provides an on-device object detector for still images, video, and live streams, with score and category filters."
        }
      ]
    }
  ],
  "facts": {
    "F1": {
      "label": "Library name, transformers",
      "display": "Transformers",
      "asOf": "2026-11-17"
    },
    "F2": {
      "label": "Monthly downloads, transformers",
      "display": "118.0M",
      "asOf": "2026-11-17"
    },
    "F3": {
      "label": "License, transformers",
      "display": "Apache 2.0 License",
      "asOf": "2026-11-17"
    },
    "F4": {
      "label": "Package release, transformers",
      "display": "5.23.0, Nov 2026",
      "asOf": "2026-11-13"
    },
    "F5": {
      "label": "Package release date, transformers",
      "display": "Nov 2026",
      "asOf": "2026-11-13"
    },
    "F6": {
      "label": "Repository stars, transformers",
      "display": "169.1K",
      "asOf": "2026-11-17"
    },
    "F7": {
      "label": "Bounding boxes, transformers",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F8": {
      "label": "Instance masks, transformers",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F9": {
      "label": "Custom training, transformers",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F10": {
      "label": "Text prompts, transformers",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F11": {
      "label": "Install, transformers",
      "display": "pip install transformers torch datasets pillow timm",
      "asOf": "2026-11-17"
    },
    "F12": {
      "label": "What it does, transformers",
      "display": "Loads detection models and processors for box prediction and task-specific fine-tuning.",
      "asOf": "2026-11-17"
    },
    "F13": {
      "label": "strengths lead, transformers",
      "display": "Detects objects from text prompts",
      "asOf": "2026-11-17"
    },
    "F14": {
      "label": "strengths, transformers",
      "display": "Use a zero-shot detector to search for named visual concepts.",
      "asOf": "2026-11-17"
    },
    "F15": {
      "label": "strengths lead, transformers",
      "display": "Rescales boxes to image dimensions",
      "asOf": "2026-11-17"
    },
    "F16": {
      "label": "strengths, transformers",
      "display": "Pass target_sizes when postprocessing model predictions.",
      "asOf": "2026-11-17"
    },
    "F17": {
      "label": "limitations lead, transformers",
      "display": "Custom labels need head replacement",
      "asOf": "2026-11-17"
    },
    "F18": {
      "label": "limitations, transformers",
      "display": "Provide label mappings and replace the pretrained classification head during fine-tuning.",
      "asOf": "2026-11-17"
    },
    "F19": {
      "label": "limitations lead, transformers",
      "display": "Evaluation needs separate box batches",
      "asOf": "2026-11-17"
    },
    "F20": {
      "label": "limitations, transformers",
      "display": "Set eval_do_concat_batches=False when target-box counts differ across images.",
      "asOf": "2026-11-17"
    },
    "F21": {
      "label": "Quickstart, transformers",
      "display": "import torch\nfrom PIL import Image, ImageDraw\nfrom transformers import AutoImageProcessor, AutoModelForObjectDetection\nfrom datasets import load_dataset\n\nds = load_dataset(\"merve/mobile-ui-design\", split=\"train\")\nimage = ds[5][\"image\"].convert(\"RGB\")\n\nmodel_repo = \"merve/rf_detr_finetuned_mobile_ui\"\n\nimage_processor = AutoImageProcessor.from_pretrained(model_repo)\nmodel = AutoModelForObjectDetection.from_pretrained(model_repo)\nmodel.eval()\n\nwith torch.no_grad():\n    inputs = image_processor(images=[image], return_tensors=\"pt\")\n    outputs = model(**inputs)\n    target_sizes = torch.tensor([[image.size[1], image.size[0]]])\n    results = image_processor.post_process_object_detection(outputs, threshold=0.5, target_sizes=target_sizes)[0]\n\nfor score, label, box in zip(results[\"scores\"], results[\"labels\"], results[\"boxes\"]):\n    box = [round(i, 2) for i in box.tolist()]\n    print(\n        f\"Detected {model.config.id2label[label.item()]} with confidence \"\n        f\"{round(score.item(), 3)} at location {box}\"\n    )\n\ndraw = ImageDraw.Draw(image)\n\ncolors = {\"group\": \"blue\", \"image\": \"green\", \"rectangle\": \"red\", \"text\": \"orange\"}\nfor score, label, box in zip(results[\"scores\"], results[\"labels\"], results[\"boxes\"]):\n    box = [round(i, 2) for i in box.tolist()]\n    x, y, x2, y2 = tuple(box)\n    label_name = model.config.id2label[label.item()]\n    color = colors.get(label_name, \"red\")\n    draw.rectangle((x, y, x2, y2), outline=color, width=2)\n    draw.text((x, y), f\"{label_name} {score:.2f}\", fill=color)\n\nimage\n",
      "asOf": "2026-11-17"
    },
    "F22": {
      "label": "Project function, transformers",
      "display": "def load_model(self):\n    from transformers import AutoModelForObjectDetection, AutoProcessor\n\n    hf_token = os.getenv(\"HF_TOKEN\", self._token)\n    model = AutoModelForObjectDetection.from_pretrained(self.model_path, token=hf_token)\n    if self.image_size is not None:\n        if model.base_model_prefix == \"rt_detr_v2\":\n            size = {\"height\": self.image_size, \"width\": self.image_size}\n        else:\n            size = {\"shortest_edge\": self.image_size, \"longest_edge\": None}\n        # use_fast=True raises error: AttributeError: 'SizeDict' object has no attribute 'keys'\n        processor = AutoProcessor.from_pretrained(\n            self.model_path, size=size, do_resize=True, use_fast=False, token=hf_token\n        )\n    else:\n        processor = AutoProcessor.from_pretrained(self.model_path, use_fast=False, token=hf_token)\n    self.set_model(model, processor)\n",
      "asOf": "2026-11-17"
    },
    "F23": {
      "label": "Project function reference, transformers",
      "display": "huggingface.py · load_model()",
      "asOf": "2026-11-17"
    },
    "F24": {
      "label": "Project repository, transformers",
      "display": "obss/sahi",
      "asOf": "2026-11-17"
    },
    "F25": {
      "label": "Project stars, obss/sahi",
      "display": "5.6K",
      "asOf": "2026-11-17"
    },
    "F26": {
      "label": "Project push date, obss/sahi",
      "display": "Nov 2026",
      "asOf": "2026-11-01"
    },
    "F27": {
      "label": "Library name, torchvision",
      "display": "TorchVision",
      "asOf": "2026-11-17"
    },
    "F28": {
      "label": "Monthly downloads, torchvision",
      "display": "17.7M",
      "asOf": "2026-11-17"
    },
    "F29": {
      "label": "License, torchvision",
      "display": "BSD",
      "asOf": "2026-11-17"
    },
    "F30": {
      "label": "Package release, torchvision",
      "display": "0.29.2, Oct 2026",
      "asOf": "2026-10-28"
    },
    "F31": {
      "label": "Package release date, torchvision",
      "display": "Oct 2026",
      "asOf": "2026-10-28"
    },
    "F32": {
      "label": "Repository stars, torchvision",
      "display": "18.0K",
      "asOf": "2026-11-17"
    },
    "F33": {
      "label": "Bounding boxes, torchvision",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F34": {
      "label": "Instance masks, torchvision",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F35": {
      "label": "Custom training, torchvision",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F36": {
      "label": "Install, torchvision",
      "display": "pip install torchvision",
      "asOf": "2026-11-17"
    },
    "F37": {
      "label": "What it does, torchvision",
      "display": "Provides models for object detection and instance segmentation.",
      "asOf": "2026-11-17"
    },
    "F38": {
      "label": "strengths lead, torchvision",
      "display": "Pairs weights with preprocessing",
      "asOf": "2026-11-17"
    },
    "F39": {
      "label": "strengths, torchvision",
      "display": "Use the chosen weights’ transforms before running the detector.",
      "asOf": "2026-11-17"
    },
    "F40": {
      "label": "strengths lead, torchvision",
      "display": "Returns detection training losses",
      "asOf": "2026-11-17"
    },
    "F41": {
      "label": "strengths, torchvision",
      "display": "Inspect the classification and regression losses returned during training.",
      "asOf": "2026-11-17"
    },
    "F42": {
      "label": "limitations lead, torchvision",
      "display": "Detection APIs can change",
      "asOf": "2026-11-17"
    },
    "F43": {
      "label": "limitations, torchvision",
      "display": "The detection module is beta and does not guarantee backward compatibility.",
      "asOf": "2026-11-17"
    },
    "F44": {
      "label": "limitations lead, torchvision",
      "display": "Requires scaled tensor inputs",
      "asOf": "2026-11-17"
    },
    "F45": {
      "label": "limitations, torchvision",
      "display": "Pass image tensors with values scaled between zero and one.",
      "asOf": "2026-11-17"
    },
    "F46": {
      "label": "Quickstart, torchvision",
      "display": "from torchvision.io.image import decode_image\nfrom torchvision.models.detection import fasterrcnn_resnet50_fpn_v2, FasterRCNN_ResNet50_FPN_V2_Weights\nfrom torchvision.utils import draw_bounding_boxes\nfrom torchvision.transforms.functional import to_pil_image\n\nimg = decode_image(\"test/assets/encode_jpeg/grace_hopper_517x606.jpg\")\n\n# Step 1: Initialize model with the best available weights\nweights = FasterRCNN_ResNet50_FPN_V2_Weights.DEFAULT\nmodel = fasterrcnn_resnet50_fpn_v2(weights=weights, box_score_thresh=0.9)\nmodel.eval()\n\n# Step 2: Initialize the inference transforms\npreprocess = weights.transforms()\n\n# Step 3: Apply inference preprocessing transforms\nbatch = [preprocess(img)]\n\n# Step 4: Use the model and visualize the prediction\nprediction = model(batch)[0]\nlabels = [weights.meta[\"categories\"][i] for i in prediction[\"labels\"]]\nbox = draw_bounding_boxes(img, boxes=prediction[\"boxes\"],\n                          labels=labels,\n                          colors=\"red\",\n                          width=4, font_size=30)\nim = to_pil_image(box.detach())\nim.show()\n\n",
      "asOf": "2026-11-17"
    },
    "F47": {
      "label": "Project function, torchvision",
      "display": "def detect(\n    self, context: cvataa.DetectionFunctionContext, image: PIL.Image.Image\n) -> list[models.LabeledShapeRequest]:\n    conf_threshold = context.conf_threshold or 0\n    results = self._model([self._transforms(image)])\n\n    return [\n        cvataa.rectangle(label.item(), [x.item() for x in box])\n        for result in results\n        for box, label, score in zip(result[\"boxes\"], result[\"labels\"], result[\"scores\"])\n        if score >= conf_threshold\n    ]\n",
      "asOf": "2026-11-17"
    },
    "F48": {
      "label": "Project function reference, torchvision",
      "display": "torchvision_detection.py · detect()",
      "asOf": "2026-11-17"
    },
    "F49": {
      "label": "Project repository, torchvision",
      "display": "cvat-ai/cvat",
      "asOf": "2026-11-17"
    },
    "F50": {
      "label": "Project stars, cvat-ai/cvat",
      "display": "17.1K",
      "asOf": "2026-11-17"
    },
    "F51": {
      "label": "Project push date, cvat-ai/cvat",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F52": {
      "label": "Library name, ultralytics",
      "display": "Ultralytics",
      "asOf": "2026-11-17"
    },
    "F53": {
      "label": "Monthly downloads, ultralytics",
      "display": "5.0M",
      "asOf": "2026-11-17"
    },
    "F54": {
      "label": "License, ultralytics",
      "display": "AGPL-3.0",
      "asOf": "2026-11-17"
    },
    "F55": {
      "label": "Package release, ultralytics",
      "display": "8.4.215, Nov 2026",
      "asOf": "2026-11-16"
    },
    "F56": {
      "label": "Package release date, ultralytics",
      "display": "Nov 2026",
      "asOf": "2026-11-16"
    },
    "F57": {
      "label": "Repository stars, ultralytics",
      "display": "63.5K",
      "asOf": "2026-11-17"
    },
    "F58": {
      "label": "Bounding boxes, ultralytics",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F59": {
      "label": "Instance masks, ultralytics",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F60": {
      "label": "Custom training, ultralytics",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F61": {
      "label": "Text prompts, ultralytics",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F62": {
      "label": "Install, ultralytics",
      "display": "pip install ultralytics",
      "asOf": "2026-11-17"
    },
    "F63": {
      "label": "What it does, ultralytics",
      "display": "Runs YOLO detection and exposes structured results for images, batches, and streams.",
      "asOf": "2026-11-17"
    },
    "F64": {
      "label": "strengths lead, ultralytics",
      "display": "Streams results as they arrive",
      "asOf": "2026-11-17"
    },
    "F65": {
      "label": "strengths, ultralytics",
      "display": "Use stream=True to process results without retaining the complete list.",
      "asOf": "2026-11-17"
    },
    "F66": {
      "label": "strengths lead, ultralytics",
      "display": "Accepts custom text labels",
      "asOf": "2026-11-17"
    },
    "F67": {
      "label": "strengths, ultralytics",
      "display": "Set the class vocabulary with a supported YOLO-World model.",
      "asOf": "2026-11-17"
    },
    "F68": {
      "label": "limitations lead, ultralytics",
      "display": "Default results retain every frame",
      "asOf": "2026-11-17"
    },
    "F69": {
      "label": "limitations, ultralytics",
      "display": "Use stream=True for long videos instead of keeping every result in memory.",
      "asOf": "2026-11-17"
    },
    "F70": {
      "label": "limitations lead, ultralytics",
      "display": "Threads need separate model instances",
      "asOf": "2026-11-17"
    },
    "F71": {
      "label": "limitations, ultralytics",
      "display": "Instantiate a model inside each prediction thread.",
      "asOf": "2026-11-17"
    },
    "F72": {
      "label": "Quickstart, ultralytics",
      "display": "from ultralytics import YOLO\n\n# Load a model\nmodel = YOLO(\"yolo26n.pt\")  # pretrained YOLO26n model\n\n# Run batched inference on a list of images\nresults = model([\"image1.jpg\", \"image2.jpg\"])  # return a list of Results objects\n\n# Process results list\nfor result in results:\n    boxes = result.boxes  # Boxes object for bounding box outputs\n    masks = result.masks  # Masks object for segmentation masks outputs\n    keypoints = result.keypoints  # Keypoints object for pose outputs\n    probs = result.probs  # Probs object for classification outputs\n    obb = result.obb  # Oriented boxes object for OBB outputs\n    result.show()  # display to screen\n    result.save(filename=\"result.jpg\")  # save to disk\n",
      "asOf": "2026-11-17"
    },
    "F73": {
      "label": "Project function, ultralytics",
      "display": "def load_model(self):\n    \"\"\"Detection model is initialized and set to self.model.\n\n    Supports both PyTorch (.pt) and ONNX (.onnx) models.\n    \"\"\"\n\n    from ultralytics import YOLO\n\n    if self.model_path and \".onnx\" in self.model_path:\n        check_requirements([\"onnx\", \"onnxruntime\"])\n\n    try:\n        model = YOLO(self.model_path)\n        # Only call .to(device) for PyTorch models, not ONNX\n        if self.model_path and not self.model_path.endswith(\".onnx\"):\n            model.to(self.device)\n        self.set_model(model)\n        if self.fuse and hasattr(model, \"fuse\"):\n            model.fuse()\n\n    except Exception as e:\n        raise TypeError(\"model_path is not a valid Ultralytics model path: \", e)\n",
      "asOf": "2026-11-17"
    },
    "F74": {
      "label": "Project function reference, ultralytics",
      "display": "ultralytics.py · load_model()",
      "asOf": "2026-11-17"
    },
    "F75": {
      "label": "Project repository, ultralytics",
      "display": "obss/sahi",
      "asOf": "2026-11-17"
    },
    "F76": {
      "label": "Project stars, obss/sahi",
      "display": "5.6K",
      "asOf": "2026-11-17"
    },
    "F77": {
      "label": "Project push date, obss/sahi",
      "display": "Nov 2026",
      "asOf": "2026-11-01"
    },
    "F78": {
      "label": "Library name, mmdet",
      "display": "MMDetection",
      "asOf": "2026-11-17"
    },
    "F79": {
      "label": "Monthly downloads, mmdet",
      "display": "128.5K",
      "asOf": "2026-11-17"
    },
    "F80": {
      "label": "License, mmdet",
      "display": "Apache-2.0",
      "asOf": "2026-11-17"
    },
    "F81": {
      "label": "Package release, mmdet",
      "display": "3.3.0, Jan 2024",
      "asOf": "2024-01-05"
    },
    "F82": {
      "label": "Package release date, mmdet",
      "display": "Jan 2024",
      "asOf": "2024-01-05"
    },
    "F83": {
      "label": "Repository stars, mmdet",
      "display": "33.0K",
      "asOf": "2026-11-17"
    },
    "F84": {
      "label": "Bounding boxes, mmdet",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F85": {
      "label": "Instance masks, mmdet",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F86": {
      "label": "Custom training, mmdet",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F87": {
      "label": "Text prompts, mmdet",
      "display": "Built-in",
      "asOf": "2026-11-17"
    },
    "F88": {
      "label": "Install, mmdet",
      "display": "pip install mmdet",
      "asOf": "2026-11-17"
    },
    "F89": {
      "label": "What it does, mmdet",
      "display": "Builds configured detection models and runs inference with boxes, masks and model-dependent prompts.",
      "asOf": "2026-11-17"
    },
    "F90": {
      "label": "strengths lead, mmdet",
      "display": "Batches images through an inferencer",
      "asOf": "2026-11-17"
    },
    "F91": {
      "label": "strengths, mmdet",
      "display": "Set batch_size to control the inference batch.",
      "asOf": "2026-11-17"
    },
    "F92": {
      "label": "strengths lead, mmdet",
      "display": "Supports custom detection datasets",
      "asOf": "2026-11-17"
    },
    "F93": {
      "label": "strengths, mmdet",
      "display": "Train configured models on a prepared custom dataset.",
      "asOf": "2026-11-17"
    },
    "F94": {
      "label": "limitations lead, mmdet",
      "display": "Needs additional engine packages",
      "asOf": "2026-11-17"
    },
    "F95": {
      "label": "limitations, mmdet",
      "display": "Install compatible MMCV and MMEngine builds before loading detectors.",
      "asOf": "2026-11-17"
    },
    "F96": {
      "label": "limitations lead, mmdet",
      "display": "RoIPool excludes CPU inference",
      "asOf": "2026-11-17"
    },
    "F97": {
      "label": "limitations, mmdet",
      "display": "Use a compatible detector when running inference on the CPU.",
      "asOf": "2026-11-17"
    },
    "F98": {
      "label": "Quickstart, mmdet",
      "display": "from mmdet.apis import DetInferencer\n\n# Initialize the DetInferencer\ninferencer = DetInferencer('rtmdet_tiny_8xb32-300e_coco')\n\n# Perform inference\ninferencer('demo/demo.jpg', show=True)\n\n",
      "asOf": "2026-11-17"
    },
    "F99": {
      "label": "Project function, mmdet",
      "display": "def detection_inference(args, frame_paths):\n    \"\"\"Detect human boxes given frame paths.\n\n    Args:\n        args (argparse.Namespace): The arguments.\n        frame_paths (list[str]): The paths of frames to do detection inference.\n\n    Returns:\n        list[np.ndarray]: The human detection results.\n    \"\"\"\n    model = init_detector(args.det_config, args.det_checkpoint, args.device)\n    assert model is not None, ('Failed to build the detection model. Check if you have installed mmcv-full properly. '\n                               'You should first install mmcv-full successfully, then install mmdet, mmpose. ')\n    assert model.CLASSES[0] == 'person', 'We require you to use a detector trained on COCO'\n    results = []\n    print('Performing Human Detection for each frame')\n    prog_bar = mmcv.ProgressBar(len(frame_paths))\n    for frame_path in frame_paths:\n        result = inference_detector(model, frame_path)\n        # We only keep human detections with score larger than det_score_thr\n        result = result[0][result[0][:, 4] >= args.det_score_thr]\n        results.append(result)\n        prog_bar.update()\n    return results\n",
      "asOf": "2026-11-17"
    },
    "F100": {
      "label": "Project function reference, mmdet",
      "display": "demo_skeleton.py · detection_inference()",
      "asOf": "2026-11-17"
    },
    "F101": {
      "label": "Project repository, mmdet",
      "display": "kennymckormick/pyskl",
      "asOf": "2026-11-17"
    },
    "F102": {
      "label": "Project stars, kennymckormick/pyskl",
      "display": "1.3K",
      "asOf": "2026-11-17"
    },
    "F103": {
      "label": "Project push date, kennymckormick/pyskl",
      "display": "Feb 2026",
      "asOf": "2026-02-19"
    },
    "F104": {
      "label": "Developer need",
      "display": "Processing long image or video streams",
      "asOf": "2026-11-17"
    },
    "F105": {
      "label": "Why choose ultralytics",
      "display": "incremental prediction results",
      "asOf": "2026-11-17"
    },
    "F106": {
      "label": "Developer need in introduction",
      "display": "processing long image or video streams",
      "asOf": "2026-11-17"
    },
    "F107": {
      "label": "When to consider transformers",
      "display": "text-prompt-driven models are central to the application",
      "asOf": "2026-11-17"
    },
    "F108": {
      "label": "Developer need",
      "display": "Pairing detector weights with input transforms",
      "asOf": "2026-11-17"
    },
    "F109": {
      "label": "Why choose torchvision",
      "display": "weight-specific preprocessing",
      "asOf": "2026-11-17"
    },
    "F110": {
      "label": "Developer need in introduction",
      "display": "pairing detector weights with input transforms",
      "asOf": "2026-11-17"
    },
    "F111": {
      "label": "When to consider mmdet",
      "display": "a configured inferencer should manage batches",
      "asOf": "2026-11-17"
    },
    "F112": {
      "label": "Developer need",
      "display": "Finding objects named in text",
      "asOf": "2026-11-17"
    },
    "F113": {
      "label": "Why choose transformers",
      "display": "zero-shot object detection models",
      "asOf": "2026-11-17"
    },
    "F114": {
      "label": "Developer need in introduction",
      "display": "finding objects named in text",
      "asOf": "2026-11-17"
    },
    "F115": {
      "label": "When to consider ultralytics",
      "display": "streamed prediction results are required",
      "asOf": "2026-11-17"
    },
    "F116": {
      "label": "Developer need",
      "display": "Running configurable image batches",
      "asOf": "2026-11-17"
    },
    "F117": {
      "label": "Why choose mmdet",
      "display": "the DetInferencer batch_size control",
      "asOf": "2026-11-17"
    },
    "F118": {
      "label": "Developer need in introduction",
      "display": "running configurable image batches",
      "asOf": "2026-11-17"
    },
    "F119": {
      "label": "Page introduction",
      "display": "Python object detection libraries let machine-learning developers locate and label objects in images.",
      "asOf": "2026-11-17"
    },
    "F120": {
      "label": "FAQ: Does every checkpoint return boxes and instance masks?",
      "display": "Ultralytics segmentation models return object-level masks, classes, confidence, and boxes.",
      "asOf": "2026-11-17"
    },
    "F121": {
      "label": "FAQ: Does every checkpoint return boxes and instance masks?",
      "display": "TorchVision provides separate object detection and instance segmentation models.",
      "asOf": "2026-11-17"
    },
    "F122": {
      "label": "FAQ: Which SDKs support text-prompted object detection?",
      "display": "Transformers zero-shot object detection models can detect objects based on text prompts.",
      "asOf": "2026-11-17"
    },
    "F123": {
      "label": "FAQ: Which SDKs support text-prompted object detection?",
      "display": "Ultralytics YOLO-World exposes set_classes for a custom vocabulary.",
      "asOf": "2026-11-17"
    },
    "F124": {
      "label": "FAQ: Which SDKs support text-prompted object detection?",
      "display": "MMDetection inferencer accepts texts for compatible prompted detectors.",
      "asOf": "2026-11-17"
    },
    "F125": {
      "label": "FAQ: How should a TorchVision detector preprocess images?",
      "display": "Use the selected weights’ transforms; the complete own module applies them before passing an image list to the detector.",
      "asOf": "2026-11-17"
    },
    "F126": {
      "label": "FAQ: How should a TorchVision detector preprocess images?",
      "display": "The Faster R-CNN model expects image tensors with values between zero and one.",
      "asOf": "2026-11-17"
    },
    "F127": {
      "label": "FAQ: How are detection boxes mapped back to image dimensions?",
      "display": "The Transformers workflow passes the image height and width as target_sizes to post_process_object_detection.",
      "asOf": "2026-11-17"
    },
    "F128": {
      "label": "FAQ: How are detection boxes mapped back to image dimensions?",
      "display": "TorchVision Faster R-CNN boxes use corner coordinates in the image bounds.",
      "asOf": "2026-11-17"
    },
    "F129": {
      "label": "FAQ: How can video prediction memory use be reduced?",
      "display": "Ultralytics stream=True yields individual results; the default call retains a list containing all results.",
      "asOf": "2026-11-17"
    },
    "F130": {
      "label": "FAQ: Can an Ultralytics model be shared freely across prediction threads?",
      "display": "The own thread-safe recipe creates a separate model inside each thread.",
      "asOf": "2026-11-17"
    },
    "F131": {
      "label": "FAQ: How do Transformers training labels differ from checkpoint labels?",
      "display": "Custom training passes label2id and id2label mappings; ignore_mismatched_sizes replaces the pretrained classification head when needed.",
      "asOf": "2026-11-17"
    },
    "F132": {
      "label": "FAQ: Why does Transformers evaluation keep target batches separate?",
      "display": "Images can have different numbers of target boxes, so eval_do_concat_batches=False preserves their image association.",
      "asOf": "2026-11-17"
    },
    "F133": {
      "label": "FAQ: What does MMDetection need before model loading?",
      "display": "Its installation sequence installs MMEngine and MMCV before MMDetection.",
      "asOf": "2026-11-17"
    },
    "F134": {
      "label": "FAQ: What does MMDetection need before model loading?",
      "display": "CPU inference excludes models containing RoIPool.",
      "asOf": "2026-11-17"
    },
    "F135": {
      "label": "FAQ: Does accepting multiple images guarantee one GPU batch?",
      "display": "MMDetection DetInferencer has a separate batch_size control.",
      "asOf": "2026-11-17"
    },
    "F136": {
      "label": "FAQ: Does accepting multiple images guarantee one GPU batch?",
      "display": "The historical video adapter loops over frame paths and invokes inference_detector separately.",
      "asOf": "2026-11-17"
    },
    "F137": {
      "label": "FAQ: Which native result serializers are established?",
      "display": "Ultralytics Results has a native JSON conversion method.",
      "asOf": "2026-11-17"
    },
    "F138": {
      "label": "FAQ: Which native result serializers are established?",
      "display": "MMDetection inferencer writes its prediction dictionary to a per-image JSON path when saving is enabled.",
      "asOf": "2026-11-17"
    },
    "F139": {
      "label": "FAQ: Are application confidence filters or saved model files export guarantees?",
      "display": "The annotation adapter applies its own confidence filter before creating rectangle annotations.",
      "asOf": "2026-11-17"
    },
    "F140": {
      "label": "FAQ: Are application confidence filters or saved model files export guarantees?",
      "display": "TorchVision pretrained models can have their own licenses or terms beyond the SDK.",
      "asOf": "2026-11-17"
    },
    "F141": {
      "label": "Library name, transformers",
      "display": "Transformers",
      "asOf": "2026-11-20"
    },
    "F142": {
      "label": "Monthly downloads, transformers",
      "display": "120.5M",
      "asOf": "2026-11-20"
    },
    "F143": {
      "label": "License, transformers",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F144": {
      "label": "Package release, transformers",
      "display": "5.23.0",
      "asOf": "2026-11-20"
    },
    "F145": {
      "label": "Package release date, transformers",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F146": {
      "label": "Install, transformers",
      "display": "pip install \"transformers[torch,vision]==5.23.0\" pillow",
      "asOf": "2026-11-20"
    },
    "F147": {
      "label": "Quickstart, transformers",
      "display": "from PIL import Image\nfrom transformers import pipeline\ndetector = pipeline(\"object-detection\", model=\"facebook/detr-resnet-50\", device=-1)\nprint(detector(Image.new(\"RGB\", (640, 480))))\n",
      "asOf": "2026-11-20"
    },
    "F148": {
      "label": "Repository stars, transformers",
      "display": "169.2K",
      "asOf": "2026-11-20"
    },
    "F149": {
      "label": "PyTorch required for detector, transformers",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F150": {
      "label": "Downloads pretrained weights, transformers",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F151": {
      "label": "Detector runtime and model contract, transformers",
      "display": "Pretrained detection architectures and processors with explicit task pipelines, including transformer and prompted detector families. Broad NLP/multimodal package downloads do not measure object-detection adoption.",
      "asOf": "2026-11-20"
    },
    "F152": {
      "label": "Project function, transformers",
      "display": "def perform_inference(self, image: list | np.ndarray):\n    \"\"\"Prediction is performed using self.model and the prediction result is set to self._original_predictions.\n\n    Args:\n        image: np.ndarray\n            A numpy array that contains the image to be predicted. 3 channel image should be in RGB order.\n    \"\"\"\n    import torch\n\n    # Confirm model is loaded\n    if self.model is None or self.processor is None:\n        raise RuntimeError(\"Model is not loaded, load it by calling .load_model()\")\n\n    with torch.no_grad():\n        inputs = self.processor(images=image, return_tensors=\"pt\")\n        inputs[\"pixel_values\"] = inputs.pixel_values.to(self.device)\n        if hasattr(inputs, \"pixel_mask\"):\n            inputs[\"pixel_mask\"] = inputs.pixel_mask.to(self.device)\n        outputs = self.model(**inputs)\n\n    if isinstance(image, list):\n        self._image_shapes = [img.shape for img in image]\n    else:\n        self._image_shapes = [image.shape]\n    self._original_predictions = outputs",
      "asOf": "2026-11-20"
    },
    "F153": {
      "label": "Project source file, transformers",
      "display": "sahi/models/huggingface.py",
      "asOf": "2026-11-20"
    },
    "F154": {
      "label": "Project full_name, transformers",
      "display": "obss/sahi",
      "asOf": "2026-11-20"
    },
    "F155": {
      "label": "Project stargazers_count, transformers",
      "display": "5.6K",
      "asOf": "2026-11-20"
    },
    "F156": {
      "label": "Library name, opencv-python-headless",
      "display": "opencv-python-headless",
      "asOf": "2026-11-20"
    },
    "F157": {
      "label": "Monthly downloads, opencv-python-headless",
      "display": "64.1M",
      "asOf": "2026-11-20"
    },
    "F158": {
      "label": "License, opencv-python-headless",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F159": {
      "label": "Package release, opencv-python-headless",
      "display": "5.1.0.95",
      "asOf": "2026-11-20"
    },
    "F160": {
      "label": "Package release date, opencv-python-headless",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F161": {
      "label": "Install, opencv-python-headless",
      "display": "pip install opencv-python-headless==5.1.0.95",
      "asOf": "2026-11-20"
    },
    "F162": {
      "label": "Quickstart, opencv-python-headless",
      "display": "import json, sys, cv2\ndetector = cv2.dnn.DetectionModel(sys.argv[1])\ndetector.setInputParams(**json.loads(sys.argv[2]))\nprint(detector.detect(cv2.imread(sys.argv[3]), confThreshold=0.5, nmsThreshold=0.4))\n",
      "asOf": "2026-11-20"
    },
    "F163": {
      "label": "Official description, opencv-python-headless",
      "display": "Wraps the OpenCV Python bindings.",
      "asOf": "2026-11-20"
    },
    "F164": {
      "label": "Quickstart source file, opencv-python-headless",
      "display": "dnn.hpp",
      "asOf": "2026-11-20"
    },
    "F165": {
      "label": "Repository stars, opencv-python-headless",
      "display": "5.5K",
      "asOf": "2026-11-20"
    },
    "F166": {
      "label": "PyTorch required for detector, opencv-python-headless",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F167": {
      "label": "Downloads pretrained weights, opencv-python-headless",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F168": {
      "label": "Detector runtime and model contract, opencv-python-headless",
      "display": "Headless cv2 distribution with native DNN model inference, preprocessing, NMS, and detection wrappers. Bring compatible exported model files and exact model-card preprocessing; no bundled task model zoo download is implied.",
      "asOf": "2026-11-20"
    },
    "F169": {
      "label": "Project function, opencv-python-headless",
      "display": "def processingThreadBody():\n    global processedFramesQueue, predictionsQueue, args, process, asyncN\n\n    futureOutputs = []\n    while process:\n        # Get a next frame\n        frame = None\n        try:\n            frame = framesQueue.get_nowait()\n\n            if asyncN:\n                if len(futureOutputs) == asyncN:\n                    frame = None  # Skip the frame\n            else:\n                framesQueue.queue.clear()  # Skip the rest of frames\n        except queue.Empty:\n            pass\n\n\n        if not frame is None:\n            frameHeight = frame.shape[0]\n            frameWidth = frame.shape[1]\n\n            # Create a 4D blob from a frame.\n            inpWidth = args.width if args.width else frameWidth\n            inpHeight = args.height if args.height else frameHeight\n            blob = cv.dnn.blobFromImage(frame, scalefactor=args.scale, mean=args.mean, size=(inpWidth, inpHeight), swapRB=args.rgb, ddepth=cv.CV_32F)\n            processedFramesQueue.put(frame)\n\n            # Run a model\n            net.setInput(blob)\n\n            if asyncN:\n                futureOutputs.append(net.forwardAsync())\n            else:\n                outs = net.forward(outNames)\n                net.printPerfProfile()\n                predictionsQueue.put(copy.deepcopy(outs))\n\n        while futureOutputs and futureOutputs[0].wait_for(0):\n            out = futureOutputs[0].get()\n            predictionsQueue.put(copy.deepcopy([out]))\n\n            del futureOutputs[0]",
      "asOf": "2026-11-20"
    },
    "F170": {
      "label": "Project source file, opencv-python-headless",
      "display": "samples/dnn/object_detection.py",
      "asOf": "2026-11-20"
    },
    "F171": {
      "label": "Project full_name, opencv-python-headless",
      "display": "opencv/opencv",
      "asOf": "2026-11-20"
    },
    "F172": {
      "label": "Project stargazers_count, opencv-python-headless",
      "display": "91.6K",
      "asOf": "2026-11-20"
    },
    "F173": {
      "label": "Library name, torchvision",
      "display": "TorchVision",
      "asOf": "2026-11-20"
    },
    "F174": {
      "label": "Monthly downloads, torchvision",
      "display": "18.1M",
      "asOf": "2026-11-20"
    },
    "F175": {
      "label": "License, torchvision",
      "display": "BSD-3-Clause",
      "asOf": "2026-11-20"
    },
    "F176": {
      "label": "Package release, torchvision",
      "display": "0.29.2",
      "asOf": "2026-11-20"
    },
    "F177": {
      "label": "Package release date, torchvision",
      "display": "Oct 2026",
      "asOf": "2026-11-20"
    },
    "F178": {
      "label": "Install, torchvision",
      "display": "pip install torchvision==0.29.2 \"torch>=2.14.0\" pillow",
      "asOf": "2026-11-20"
    },
    "F179": {
      "label": "Quickstart, torchvision",
      "display": "from PIL import Image\nfrom torchvision.models.detection import fasterrcnn_resnet50_fpn, FasterRCNN_ResNet50_FPN_Weights\nweights = FasterRCNN_ResNet50_FPN_Weights.DEFAULT\nmodel = fasterrcnn_resnet50_fpn(weights=weights).eval()\nprint(model([weights.transforms()(Image.new(\"RGB\", (640, 480)))]))\n",
      "asOf": "2026-11-20"
    },
    "F180": {
      "label": "Repository stars, torchvision",
      "display": "18.0K",
      "asOf": "2026-11-20"
    },
    "F181": {
      "label": "PyTorch required for detector, torchvision",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F182": {
      "label": "Downloads pretrained weights, torchvision",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F183": {
      "label": "Detector runtime and model contract, torchvision",
      "display": "PyTorch-native detector builders and typed weights/preprocessing, fitting existing Torch tensor/training systems. Detection model is selected separately from generic classification models.",
      "asOf": "2026-11-20"
    },
    "F184": {
      "label": "Project function, torchvision",
      "display": "def detect(\n    self, context: cvataa.DetectionFunctionContext, image: PIL.Image.Image\n) -> list[models.LabeledShapeRequest]:\n    conf_threshold = context.conf_threshold or 0\n    results = self._model([self._transforms(image)])\n\n    return [\n        cvataa.rectangle(label.item(), [x.item() for x in box])\n        for result in results\n        for box, label, score in zip(result[\"boxes\"], result[\"labels\"], result[\"scores\"])\n        if score >= conf_threshold\n    ]",
      "asOf": "2026-11-20"
    },
    "F185": {
      "label": "Project source file, torchvision",
      "display": "cvat-sdk/cvat_sdk/auto_annotation/functions/torchvision_detection.py",
      "asOf": "2026-11-20"
    },
    "F186": {
      "label": "Project full_name, torchvision",
      "display": "cvat-ai/cvat",
      "asOf": "2026-11-20"
    },
    "F187": {
      "label": "Project stargazers_count, torchvision",
      "display": "17.1K",
      "asOf": "2026-11-20"
    },
    "F188": {
      "label": "Library name, ultralytics",
      "display": "Ultralytics",
      "asOf": "2026-11-20"
    },
    "F189": {
      "label": "Monthly downloads, ultralytics",
      "display": "5.1M",
      "asOf": "2026-11-20"
    },
    "F190": {
      "label": "License, ultralytics",
      "display": "AGPL-3.0",
      "asOf": "2026-11-20"
    },
    "F191": {
      "label": "Package release, ultralytics",
      "display": "8.4.215",
      "asOf": "2026-11-20"
    },
    "F192": {
      "label": "Package release date, ultralytics",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F193": {
      "label": "Install, ultralytics",
      "display": "pip install ultralytics==8.4.215 numpy",
      "asOf": "2026-11-20"
    },
    "F194": {
      "label": "Quickstart, ultralytics",
      "display": "import numpy as np\nfrom ultralytics import YOLO\nmodel = YOLO(\"yolo26n.pt\")\nprint(model.predict(np.zeros((640, 640, 3), dtype=np.uint8), device=\"cpu\"))\n",
      "asOf": "2026-11-20"
    },
    "F195": {
      "label": "Repository stars, ultralytics",
      "display": "63.6K",
      "asOf": "2026-11-20"
    },
    "F196": {
      "label": "PyTorch required for detector, ultralytics",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F197": {
      "label": "Downloads pretrained weights, ultralytics",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F198": {
      "label": "Detector runtime and model contract, ultralytics",
      "display": "Task-focused YOLO model loading, predict/train/export interfaces, automatic published checkpoint loading, and CPU/GPU configuration. Current default example uses documented yolo26n.pt, not stale weights aliases.",
      "asOf": "2026-11-20"
    },
    "F199": {
      "label": "Project function, ultralytics",
      "display": "def load_model(self):\n    \"\"\"Detection model is initialized and set to self.model.\n\n    Supports both PyTorch (.pt) and ONNX (.onnx) models.\n    \"\"\"\n\n    from ultralytics import YOLO\n\n    if self.model_path and \".onnx\" in self.model_path:\n        check_requirements([\"onnx\", \"onnxruntime\"])\n\n    try:\n        model = YOLO(self.model_path)\n        # Only call .to(device) for PyTorch models, not ONNX\n        if self.model_path and not self.model_path.endswith(\".onnx\"):\n            model.to(self.device)\n        self.set_model(model)\n        if self.fuse and hasattr(model, \"fuse\"):\n            model.fuse()\n\n    except Exception as e:\n        raise TypeError(\"model_path is not a valid Ultralytics model path: \", e)",
      "asOf": "2026-11-20"
    },
    "F200": {
      "label": "Project source file, ultralytics",
      "display": "sahi/models/ultralytics.py",
      "asOf": "2026-11-20"
    },
    "F201": {
      "label": "Project full_name, ultralytics",
      "display": "obss/sahi",
      "asOf": "2026-11-20"
    },
    "F202": {
      "label": "Project stargazers_count, ultralytics",
      "display": "5.6K",
      "asOf": "2026-11-20"
    },
    "F203": {
      "label": "Library name, modelscope",
      "display": "ModelScope",
      "asOf": "2026-11-20"
    },
    "F204": {
      "label": "Monthly downloads, modelscope",
      "display": "4.3M",
      "asOf": "2026-11-20"
    },
    "F205": {
      "label": "License, modelscope",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F206": {
      "label": "Package release, modelscope",
      "display": "1.40.3",
      "asOf": "2026-11-20"
    },
    "F207": {
      "label": "Package release date, modelscope",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F208": {
      "label": "Install, modelscope",
      "display": "pip install \"modelscope[cv]==1.40.3\" torch numpy",
      "asOf": "2026-11-20"
    },
    "F209": {
      "label": "Quickstart, modelscope",
      "display": "import sys, numpy as np\nfrom modelscope.pipelines import pipeline\nfrom modelscope.utils.constant import Tasks\ndetector = pipeline(Tasks.image_object_detection, model=sys.argv[1], device=\"cpu\")\nprint(detector(np.zeros((640, 640, 3), dtype=np.uint8)))\n",
      "asOf": "2026-11-20"
    },
    "F210": {
      "label": "Official description, modelscope",
      "display": "Provides models as a service.",
      "asOf": "2026-11-20"
    },
    "F211": {
      "label": "Quickstart source file, modelscope",
      "display": "tinynas_detection_pipeline.py",
      "asOf": "2026-11-20"
    },
    "F212": {
      "label": "Repository stars, modelscope",
      "display": "9.2K",
      "asOf": "2026-11-20"
    },
    "F213": {
      "label": "PyTorch required for detector, modelscope",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F214": {
      "label": "Downloads pretrained weights, modelscope",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F215": {
      "label": "Detector runtime and model contract, modelscope",
      "display": "Model-hub task pipeline with registered TinyNAS image_object_detection models, model-ID/local-directory loading, preprocessing, and structured detection output; selected TinyNAS backend is PyTorch.",
      "asOf": "2026-11-20"
    },
    "F216": {
      "label": "Library name, mediapipe",
      "display": "MediaPipe",
      "asOf": "2026-11-20"
    },
    "F217": {
      "label": "Monthly downloads, mediapipe",
      "display": "3.0M",
      "asOf": "2026-11-20"
    },
    "F218": {
      "label": "License, mediapipe",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F219": {
      "label": "Package release, mediapipe",
      "display": "1.2.3",
      "asOf": "2026-11-20"
    },
    "F220": {
      "label": "Package release date, mediapipe",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F221": {
      "label": "Install, mediapipe",
      "display": "pip install mediapipe==1.2.3",
      "asOf": "2026-11-20"
    },
    "F222": {
      "label": "Quickstart, mediapipe",
      "display": "import sys, mediapipe as mp\noptions = mp.tasks.vision.ObjectDetectorOptions(base_options=mp.tasks.BaseOptions(model_asset_path=sys.argv[1]))\nwith mp.tasks.vision.ObjectDetector.create_from_options(options) as detector:\n    print(detector.detect(mp.Image.create_from_file(sys.argv[2])))\n",
      "asOf": "2026-11-20"
    },
    "F223": {
      "label": "Official description, mediapipe",
      "display": "Builds machine learning solutions for mobile, edge, cloud, and web.",
      "asOf": "2026-11-20"
    },
    "F224": {
      "label": "Quickstart source file, mediapipe",
      "display": "object_detector/python",
      "asOf": "2026-11-20"
    },
    "F225": {
      "label": "Repository stars, mediapipe",
      "display": "37.7K",
      "asOf": "2026-11-20"
    },
    "F226": {
      "label": "PyTorch required for detector, mediapipe",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F227": {
      "label": "Downloads pretrained weights, mediapipe",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F228": {
      "label": "Detector runtime and model contract, mediapipe",
      "display": "Packaged on-device ObjectDetector with TFLite model asset, still-image/video/live-stream modes, score/category filtering, and callback-based live results. Custom training belongs to a separate Model Maker toolchain.",
      "asOf": "2026-11-20"
    },
    "F229": {
      "label": "Project function, mediapipe",
      "display": "def run(model: str, max_results: int, score_threshold: float, \n        camera_id: int, width: int, height: int) -> None:\n  \"\"\"Continuously run inference on images acquired from the camera.\n\n  Args:\n    model: Name of the TFLite object detection model.\n    max_results: Max number of detection results.\n    score_threshold: The score threshold of detection results.\n    camera_id: The camera id to be passed to OpenCV.\n    width: The width of the frame captured from the camera.\n    height: The height of the frame captured from the camera.\n  \"\"\"\n\n  # Start capturing video input from the camera\n  cap = cv2.VideoCapture(camera_id)\n  cap.set(cv2.CAP_PROP_FRAME_WIDTH, width)\n  cap.set(cv2.CAP_PROP_FRAME_HEIGHT, height)\n\n  # Visualization parameters\n  row_size = 50  # pixels\n  left_margin = 24  # pixels\n  text_color = (0, 0, 0)  # black\n  font_size = 1\n  font_thickness = 1\n  fps_avg_frame_count = 10\n\n  detection_frame = None\n  detection_result_list = []\n\n  def save_result(result: vision.ObjectDetectorResult, unused_output_image: mp.Image, timestamp_ms: int):\n      global FPS, COUNTER, START_TIME\n\n      # Calculate the FPS\n      if COUNTER % fps_avg_frame_count == 0:\n          FPS = fps_avg_frame_count / (time.time() - START_TIME)\n          START_TIME = time.time()\n\n      detection_result_list.append(result)\n      COUNTER += 1\n\n  # Initialize the object detection model\n  base_options = python.BaseOptions(model_asset_path=model)\n  options = vision.ObjectDetectorOptions(base_options=base_options,\n                                         running_mode=vision.RunningMode.LIVE_STREAM,\n                                         max_results=max_results, score_threshold=score_threshold,\n                                         result_callback=save_result)\n  detector = vision.ObjectDetector.create_from_options(options)\n\n\n  # Continuously capture images from the camera and run inference\n  while cap.isOpened():\n    success, image = cap.read()\n    if not success:\n      sys.exit(\n          'ERROR: Unable to read from webcam. Please verify your webcam settings.'\n      )\n\n    image = cv2.flip(image, 1)\n\n    # Convert the image from BGR to RGB as required by the TFLite model.\n    rgb_image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)\n    mp_image = mp.Image(image_format=mp.ImageFormat.SRGB, data=rgb_image)\n\n    # Run object detection using the model.\n    detector.detect_async(mp_image, time.time_ns() // 1_000_000)\n\n    # Show the FPS\n    fps_text = 'FPS = {:.1f}'.format(FPS)\n    text_location = (left_margin, row_size)\n    current_frame = image\n    cv2.putText(current_frame, fps_text, text_location, cv2.FONT_HERSHEY_DUPLEX,\n                font_size, text_color, font_thickness, cv2.LINE_AA)\n\n    if detection_result_list:\n        # print(detection_result_list)\n        current_frame = visualize(current_frame, detection_result_list[0])\n        detection_frame = current_frame\n        detection_result_list.clear()\n\n    if detection_frame is not None:\n        cv2.imshow('object_detection', detection_frame)\n\n    # Stop the program if the ESC key is pressed.\n    if cv2.waitKey(1) == 27:\n      break\n\n  detector.close()\n  cap.release()\n  cv2.destroyAllWindows()",
      "asOf": "2026-11-20"
    },
    "F230": {
      "label": "Project source file, mediapipe",
      "display": "examples/object_detection/raspberry_pi/detect.py",
      "asOf": "2026-11-20"
    },
    "F231": {
      "label": "Project full_name, mediapipe",
      "display": "google-ai-edge/mediapipe-samples",
      "asOf": "2026-11-20"
    },
    "F232": {
      "label": "Project stargazers_count, mediapipe",
      "display": "2.9K",
      "asOf": "2026-11-20"
    },
    "F233": {
      "label": "Library name, paddlex",
      "display": "PaddleX",
      "asOf": "2026-11-20"
    },
    "F234": {
      "label": "Monthly downloads, paddlex",
      "display": "1.1M",
      "asOf": "2026-11-20"
    },
    "F235": {
      "label": "License, paddlex",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F236": {
      "label": "Package release, paddlex",
      "display": "3.7.2",
      "asOf": "2026-11-20"
    },
    "F237": {
      "label": "Package release date, paddlex",
      "display": "Jun 2026",
      "asOf": "2026-11-20"
    },
    "F238": {
      "label": "Install, paddlex",
      "display": "pip install \"paddlex[base]==3.7.2\" paddlepaddle numpy",
      "asOf": "2026-11-20"
    },
    "F239": {
      "label": "Quickstart, paddlex",
      "display": "import numpy as np\nfrom paddlex import create_pipeline\npipeline = create_pipeline(pipeline=\"object_detection\", device=\"cpu\")\nfor result in pipeline.predict(np.zeros((640, 640, 3), dtype=np.uint8), threshold=0.5):\n    result.print()\n",
      "asOf": "2026-11-20"
    },
    "F240": {
      "label": "Official description, paddlex",
      "display": "Develops models with low code on PaddlePaddle.",
      "asOf": "2026-11-20"
    },
    "F241": {
      "label": "Quickstart source file, paddlex",
      "display": "object_detection.md",
      "asOf": "2026-11-20"
    },
    "F242": {
      "label": "Repository stars, paddlex",
      "display": "6.3K",
      "asOf": "2026-11-20"
    },
    "F243": {
      "label": "PyTorch required for detector, paddlex",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F244": {
      "label": "Downloads pretrained weights, paddlex",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F245": {
      "label": "Detector runtime and model contract, paddlex",
      "display": "Configured object_detection pipeline with model download/cache, preprocessing, prediction results, visualization/JSON outputs, and publisher PaddlePaddle deployment/training tooling. Selected default detector uses Paddle runtime.",
      "asOf": "2026-11-20"
    },
    "F246": {
      "label": "Library name, keras-hub",
      "display": "KerasHub",
      "asOf": "2026-11-20"
    },
    "F247": {
      "label": "Monthly downloads, keras-hub",
      "display": "471.7K",
      "asOf": "2026-11-20"
    },
    "F248": {
      "label": "License, keras-hub",
      "display": "Apache-2.0",
      "asOf": "2026-11-20"
    },
    "F249": {
      "label": "Package release, keras-hub",
      "display": "0.33.0",
      "asOf": "2026-11-20"
    },
    "F250": {
      "label": "Package release date, keras-hub",
      "display": "Nov 2026",
      "asOf": "2026-11-20"
    },
    "F251": {
      "label": "Install, keras-hub",
      "display": "pip install keras-hub==0.33.0 numpy torch",
      "asOf": "2026-11-20"
    },
    "F252": {
      "label": "Quickstart, keras-hub",
      "display": "import os\nos.environ[\"KERAS_BACKEND\"] = \"torch\"\nimport numpy as np, keras_hub\ndetector = keras_hub.models.RetinaNetObjectDetector.from_preset(\"retinanet_resnet50_fpn_coco\")\nprint(detector.predict(np.zeros((1, 800, 800, 3), dtype=np.uint8)))\n",
      "asOf": "2026-11-20"
    },
    "F253": {
      "label": "Official description, keras-hub",
      "display": "Provides pretrained models for Keras.",
      "asOf": "2026-11-20"
    },
    "F254": {
      "label": "Quickstart source file, keras-hub",
      "display": "retinanet_object_detector.py",
      "asOf": "2026-11-20"
    },
    "F255": {
      "label": "Repository stars, keras-hub",
      "display": "999",
      "asOf": "2026-11-20"
    },
    "F256": {
      "label": "PyTorch required for detector, keras-hub",
      "display": "No",
      "asOf": "2026-11-20"
    },
    "F257": {
      "label": "Downloads pretrained weights, keras-hub",
      "display": "Yes",
      "asOf": "2026-11-20"
    },
    "F258": {
      "label": "Detector runtime and model contract, keras-hub",
      "display": "Keras-native RetinaNet and D-FINE detector classes with pretrained presets, preprocessors, bounding-box formats, and prediction decoders. Keras backend can be TensorFlow, JAX, or PyTorch; the starter explicitly chooses PyTorch before imports.",
      "asOf": "2026-11-20"
    }
  },
  "dataCheckedAt": "2026-11-20",
  "agent": {
    "exaCall": {
      "endpoint": "/search",
      "body": {
        "query": "Best Python object detection libraries Ultralytics TorchVision Transformers MMDetection code examples",
        "numResults": 5
      },
      "docsUrl": "https://exa.ai/docs/reference/search"
    },
    "calls": []
  }
}
