技能创建器
skill-creator
创建、改进和评估自定义技能,把专业流程转化为可重复使用的 AI 能力。
detectron2【数据与研究】Use Detectron2 for object detection, segmentation, configuration, datasets, training, inference, export, and extension workflows.
独立 GitHub 快照 · 自动分类 · 以原作者文档为准
Use this repo skill when a task mentions Detectron2, Detectron, object detection, instance/keypoint/panoptic/semantic segmentation, Detectron2 model zoo configs, DefaultPredictor, DefaultTrainer, DatasetCatalog, Detectron2 export, or custom Detectron2 model components.
Detectron2 is a PyTorch-based library with native C++/CUDA extensions. Public installs should start from a compatible PyTorch and torchvision pair, then install Detectron2 from a release wheel or source build appropriate for the platform.
python -m pip install torch torchvision
python -m pip install 'git+https://github.com/facebookresearch/detectron2.git'
python - <<'PY'
import detectron2
print(detectron2.__version__)
PY
For source builds, ensure torch is importable before running Detectron2 setup. If editable source installation fails because build isolation cannot import torch, retry with a package/build process that disables build isolation after installing torch. OpenCV is optional for core APIs but needed for demo-style image/video visualization workflows.
_BASE_, overrides, LazyCall, instantiate, model-zoo config paths, and checkpoint URLs.DatasetCatalog, MetadataCatalog, COCO helpers, standard dataset dicts, metadata keys, mappers, augmentations, and train/test data loaders.DefaultTrainer, hooks, launch, checkpointing, evaluators, inference_on_dataset, and solver/LR/batch-size adjustments.DefaultPredictor, direct model inference, Instances, Boxes, masks, model input/output formats, Visualizer, confidence thresholds, CPU overrides, and prediction JSON sanity checks.TracingAdapter, scripting_with_instances, model analysis, benchmarking, and safe export command construction.@configurable, custom trainers, and bundled or optional research projects such as PointRend, DeepLab, Panoptic-DeepLab, DensePose, TensorMask, ViTDet, and MViTv2.get_cfg(), merge_from_file(), and alternating KEY VALUE overrides. Python configs use LazyConfig.load() and key=value overrides.cfg.DATASETS.TRAIN/TEST or evaluator logic can work.MODEL.DEVICE cpu for Yacs configs or the matching LazyConfig model device field before constructing predictors/models.0.6 and a clean git state at the recorded commit in provenance.demo.py imports a non-package path in this checkout; use the inference sub-skill helpers and API patterns instead.