XE

xtmtd/entomokit

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

20 stars 质量 64 趋势 18MIT

一个用于昆虫图像数据集构建与分类的Python工具包

概览

基于Python的工具包用于构建昆虫图像数据集。EntomoKit提供统一的entomokit上下文操作,用于帧提取、分割、形态测量、综合、清理、增强、数据集拆分、AutoMM分类和环境诊断,以及为AI助手提供entomokit工作流程技能。 流水线是可组合的;只需完成你数据所需的步骤。 1. 提取帧——将视频转换为静态帧。2. 片段——从图像中剪取昆虫,并可选地写注释。3. 测量——可选:通过分割遮罩获取形态指标。4. 合成——可选:将复合RGBA剪裁到新背景上。5. 清理——调整大小、填充和去重图像。6. 增强——可选:扩展一个小型训练集。7. 分割CSV——构建训练/评估/测试CSV。8.分类训练→分类预测/评估/分类嵌入/分类cam/分类导出-onnx。

概述(AI 翻译)

中文文档 |英语

一个基于Python的工具包,用于构建昆虫图像数据集。EntomoKit提供了 用于帧提取、分割和形态的统一entomokit CLI处理 测量、综合、清理、增强、数据集拆分、AutoMM 分类和环境诊断,以及entomokit-workflow技能 人工智能助理。

工作流程概述

流水线是可组合的;只需完成你数据所需的步骤。

  1. extract-frames — 将视频转换为静态画面。
  2. segment — 从图像中剪取昆虫,并可选地写注释。
  3. measure — 可选:来自分段掩码的形态度量。
  4. synthesize — 可选:在新背景上添加复合RGBA剪影。
  5. clean — 调整大小、填充和去重图像。
  6. augment — 可选:扩展一个小型训练集。
  7. split-csv — 构建训练/评估/测试CSV。
  8. classify train → classify predict / classify evaluate / classify embed / classify cam / classify export-onnx。

你可以从任意步骤开始:例如直接从clean到classify train 当图像已经被标记时,或者仅使用 segment 进行掩膜提取。

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

Insect Dataset Toolkit (EntomoKit)

中文文档 | English

A Python-based toolkit for building insect image datasets. EntomoKit provides a unified entomokit CLI for frame extraction, segmentation, morphology measurement, synthesis, cleaning, augmentation, dataset splitting, AutoMM classification and environment diagnostics, plus an entomokit-workflow skill for AI assistants.

Workflow Overview

The pipeline is composable; only the steps your data needs are required.

  1. extract-frames — turn videos into still frames.
  2. segment — cut insects out of images and optionally write annotations.
  3. measure — optional: morphology metrics from segmentation masks.
  4. synthesize — optional: composite RGBA cutouts onto new backgrounds.
  5. clean — resize, pad and deduplicate images.
  6. augment — optional: expand a small training set.
  7. split-csv — build train/val/test CSVs.
  8. classify train → classify predict / classify evaluate / classify embed / classify cam / classify export-onnx.

You can start at any step: for example go straight from clean to classify train when the images are already labelled, or use segment alone for mask extraction. AI-assisted runs follow the skill’s own guided policy, not this list.

Requirements and Installation

  • Python 3.9+
  • Linux, macOS or Windows
git clone https://github.com/xtmtd/entomokit.git
cd entomokit

Install into an isolated environment (recommended):

uv venv .venv
source .venv/bin/activate
uv pip install -e .

Equivalent alternatives: python -m venv .venv && source .venv/bin/activate, or conda create -n entomokit python=3.11 -y && conda activate entomokit. Installing directly into a global environment is possible but risks dependency conflicts.

Command extras:

Extra Adds
.[video] extract-frames (OpenCV video decoding)
.[segmentation] SAM3 segmentation, SAM3 repair and synthesis annotation output
.[measurement] measure (morphology metrics, skeleton computation)
.[synthesis] synthesize (polygon simplification, COCO annotations)
.[cleaning] clean perceptual-hash dedup
.[augment] augment (albumentations)
.[classify] classify train/predict/evaluate/embed/cam/export-onnx (AutoMM, timm, GradCAM, UMAP, ONNX)
.[dev] pytest and coverage

measure and synthesize also import scikit-image, which neither the measurement nor the synthesis extra declares; install .[segmentation] (which declares it) or add scikit-image explicitly alongside those extras.

Install several at once, for example the full development set:

uv pip install --only-binary :all: stringzilla
pip install -e ".[dev,classify,segmentation,synthesis,measurement,video,cleaning,augment]"

The stringzilla line above is required before installing .[augment] on platforms where only its binary wheel is available. AutoMM publishes its own install notes at

在 GitHub 查看完整 README

推荐工具

换一个关键词,或者移除筛选条件。

安装

npx skillfish add xtmtd/entomokit
新手?先看 mcpskill.org 教程 →