npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

ai-image-creator

v1.0.7

Published

扩充图片库至40+倍的工具,常用于扩充对象识别的训练集

Downloads

44

Readme

AI Image Creator

standard-readme compliant workflow badge Commitizen friendly

AI Image Creator 是一款可以将 1 张图片一键生成 40+ 张衍生图片的工具,它也可以深度遍历一个文件夹,将里面的所有图片都产生 40+ 张衍生图片,从而达到对一个图库扩充 40+ 倍的效果。

目录

背景

为了解决对象识别中训练集不足的问题,同时又需要使用 Node.js 技术栈,此工具应运而生,它可以通过对训练集中的图片进行翻转,调节亮度、饱和度、色相、对比度等来产生 40 倍的新训练集,后续会逐渐增加新的产生方法,从而达到更大规模。

关于背景更详细的介绍请阅读此文

安装

安装依赖

AI Image Creator 依赖于 GraphicsMagick ,因此首先需要下载和安装 GraphicsMagick。如果是 macOS 系统,可以轻松地用 Homebrew 安装:

brew install graphicsmagick

Windows 系统可以前往 官网下载页面 下载安装包,如果下载链接打不开可以前往 SourceForge 下载。 Linux 系统一般可以使用包管理器安装。

全局安装

AI Image Creator 可以通过 npm 全局安装:

npm i ai-image-creator -g

本地安装

AI Image Creator 也可以通过 npm 安装在项目内:

npm i ai-image-creator -S

使用

命令行

AI Image Creator 可以用过命令行的方式调用。如果是安装在全局,则直接在终端运行 aiimg [options] 即可。如果是安装在项目内,则在项目根目录下通过 npx aiimg [options] 运行。

其中,options 支持以下几种参数:

  • -i --input <path>path 为源图片路径或者包含源图片的目录路径,默认是当前目录。
  • -o --output <path>path 为生成的图片目录路径,默认是当前目录下的 output 文件夹。
  • --output <paths>paths 为遍历时忽略的文件夹或文件名,多个文件或文件夹名用 , 分隔,暂时不支持 Glob 匹配。

例如,下面的命令就是将 images 目录下除去 dogcat 两个目录的所有图片都生成出衍生图片至 outputs 文件夹:

aiimg -i images/ -o outputs --ignore images/dog,images/cat

Node API

AI Image Creator 可以作为 Node 模块被调用:

import { start } from 'ai-image-creator'

/**
 * @param {string} input 源图片路径或者包含源图片的目录路径,默认是当前目录
 * @param {string} output 生成的图片目录路径,默认是当前目录下的 output 文件夹
 * @param {object} options 参数配置
 * @param {string|string[]} options.ignore 遍历时忽略的文件夹或文件名,暂时不支持 Glob 匹配
 * @return {Promise} 生成完毕后会返回一个 Promise
 */
start(input, output, options);

Todo

  • [ ] 支持 Glob 忽略模式
  • [ ] 支持自定义调节生成图片的配置
  • [ ] 支持更多的预处理方式

贡献

欢迎大家提 ISSUE 帮助改进问题,或者提交 PR 来帮助改进和新增功能。

许可证

MIT © vabaly.