external-gitcode-ascend-detectron2

Skill to install detectron2 from source inside an Ascend NPU container. Intended for development scenarios such as instance segmentation and object detection models.

Last repository push
GitHub Stars
187
Forks
67
Issues / PRs
15

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "external-gitcode-ascend-detectron2" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-849e743decbeeeb9f92201dfdbfdcaf8c493846cc5194274f8dc2050154ed07b. Verify the upstream source and version against https://github.com/ascend-ai-coding/awesome-ascend-skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Skill to install detectron2 from source inside an Ascend NPU container. Intended for development scenarios such as instance segmentation and object detection models.

0 Downloads

Introduction source: third_party · ascend-ai-coding · 0.0.1 Reference

SkillPi interpretation

Tasks
Translation pending; see source documentation.
Inputs and outputs
bash pip uninstall detectron2 -y pip install git+https://github.com/facebookresearch/detectron2.git ```
Software, accounts and paid services
Translation pending; see source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: external-gitcode-ascend-detectron2
description: 在昇腾NPU容器中从源码安装detectron2。适用于实例分割、目标检测等模型的开发。
type: capability
original-name: ascend-detectron2-install
synced-from: https://gitcode.com/Ascend/agent-skills
synced-date: '2026-05-26'
synced-commit: 1f7666e7768a0ceb21bb1d40ce4b5179fcb6f1d6
license: UNKNOWN

ascend-detectron2-install

功能

在昇腾NPU容器中从源码安装 detectron2(NPU兼容版本)

前置条件

  • mmcv 已安装
  • 容器中已安装 Ascend CANN 和 torch_npu
  • 工作目录已挂载

使用

步骤1:确认前置条件

确保 mmcv 已安装:

python -c "import mmcv; print(mmcv.__version__)"

步骤2:从源码安装 detectron2

关键:在NPU环境下必须从源码安装,不能使用预编译的CUDA版本!

source /opt/conda/bin/activate <conda-env-name>
pip install git+https://github.com/facebookresearch/detectron2.git

步骤3:验证安装

python -c "import detectron2; print('detectron2 installed')"

NPU验证(关键步骤):

python -c "import site; print([p for p in site.getsitepackages() if 'cuda' in p.lower()])"
# 应输出空列表,确保没有安装CUDA版本

如果输出包含 cuda 相关路径,说明安装的是 CUDA 版本,需要卸载并重新从源码安装:

pip uninstall detectron2 -y
pip install git+https://github.com/facebookresearch/detectron2.git

常见问题

  • CUDA版本问题:NPU环境必须从源码安装,使用预编译CUDA版本会导致运行时错误
  • 依赖冲突:可能需要先卸载已安装的CUDA版本detectron2

决策指引

向用户提问:

  1. 是否已安装detectron2?是什么版本?
  2. 当前环境是NPU还是CUDA?

安装后必须验证:

  • 确认 site.getsitepackages() 中没有 cuda 相关路径
  • 否则需要卸载重装

Current listing version

0.0.1

Verify the source revision ↗

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value75/100

Highlights

  • 解决昇腾NPU环境下detectron2安装的特定痛点
  • 提供针对AI开发者的实用工具
Trigger Precision90/100

Highlights

  • 触发描述清晰完整,覆盖核心功能和应用场景
Structure and Standards90/100

Highlights

  • 结构清晰,步骤完整,包含验证和异常处理
Execution Reliability90/100

Highlights

  • 提供可靠的安装流程和验证方法,强调NPU环境关键点
Evidence Verifiability (mean of the first four)86/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

  • Install or fetch external dependencies

    Use official sources and pin versions. Check install scripts in an isolated environment. This document check does not cover code downloaded later.

    Mentioned in main document · lines 39, 57
Domains or addresses referenced in the document

These addresses may be documentation links or examples, not an approved network allowlist. Verify actual destinations and outgoing data before use.

  • gitcode.com
  • github.com

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Translation pending; see source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.