界面已本地化;技能介绍与说明文档按所选语言由 AI 自动翻译,代码、命令、路径和专业术语保留原文,以原作者文档为准。
探索技能
设计与创意 · SKILL.md

core-apis

core-apis

【设计与创意】Routes Mask_RCNN core API, Config, Dataset, MaskRCNN, utility, visualization, and TensorFlow/Keras compatibility tasks.

独立 GitHub 快照 · 自动分类 · 以原作者文档为准

技能说明

GitHub

name: core-apis description: "Routes Mask_RCNN core API, Config, Dataset, MaskRCNN, utility, visualization, and TensorFlow/Keras compatibility tasks." disable-model-invocation: true metadata: disco-role: operating license: NOASSERTION

Core APIs

Use this sub-skill when a task asks how to use or debug the installed mrcnn package itself: configuration classes, MaskRCNN construction, utility functions, visualization signatures, graph-building constraints, or legacy TensorFlow/Keras compatibility.

Read first by need

Core API workflow

  1. Verify the runtime stack and import package:

    python sub-skills/core-apis/scripts/inspect_mask_rcnn_api.py --show-signatures
    
  2. Define a Config subclass. Set at least NAME, NUM_CLASSES, image size/resize mode, GPU_COUNT, and IMAGES_PER_GPU. Dimensions that flow into the FPN should be divisible by 64.

  3. Construct the model with a mode-specific object:

    from mrcnn.config import Config
    from mrcnn import model as modellib
    
    class MyConfig(Config):
        NAME = "my_project"
        NUM_CLASSES = 1 + 1
        GPU_COUNT = 1
        IMAGES_PER_GPU = 1
        IMAGE_MIN_DIM = 512
        IMAGE_MAX_DIM = 512
    
    config = MyConfig()
    model = modellib.MaskRCNN(mode="inference", config=config, model_dir="logs")
    
  4. For training, route to training. For dataset subclasses and masks, route to data-preparation. For detect() results and visualization, route to inference-evaluation.

Decision points

  • Using modern Keras? Treat failures as compatibility/porting unless a full graph build and target workflow already pass. The legacy stack is the safer operating default.
  • CPU versus GPU? CPU can validate imports, shapes, utilities, and tiny graphs. Real training and multi-GPU behavior need backend-specific runtime verification.
  • Weights mismatch? Core API can explain load_weights; training owns the transfer-learning recipes and layer exclusions.
  • Original sample path requested? Use bundled references/scripts instead. This repo skill is meant to operate without reopening the source checkout.
我的收藏