← 返回
内容创作 中文

Batch Rename

Rename image datasets and annotations with custom patterns, prefixes, suffixes, and sequential numbering, including preview and undo support.
支持自定义模式、前缀、后缀及序列编号对图像数据集和标注文件进行重命名,并提供预览和撤销功能。
mingo-318
内容创作 clawhub v1.0.0 1 版本 99864.3 Key: 无需
★ 0
Stars
📥 736
下载
💾 11
安装
1
版本
#latest

概述

Batch Rename

Batch rename images and corresponding annotation files with customizable patterns. Use when user needs to rename image datasets with sequential numbers, prefixes, or custom patterns.

Features

  • Sequential Numbering: Add sequential numbers to filenames
  • Custom Prefix/Suffix: Add prefix or suffix to filenames
  • Annotation Aware: Rename corresponding annotation files together
  • Handle Missing: Gracefully handle images without annotation files
  • Preview Mode: Preview changes before applying
  • Undo Support: Restore original filenames

Usage

# Rename with sequential numbers
python scripts/rename.py rename /path/to/images/ --pattern "img_{:04d}"

# Rename with prefix
python scripts/rename.py rename /path/to/images/ --prefix "dataset1_"

# Rename images and annotations together
python scripts/rename.py rename /path/to/images/ --pattern "img_{:04d}" --annotations /path/to/labels/

# Preview first
python scripts/rename.py rename /path/to/images/ --pattern "img_{:04d}" --preview

Examples

$ python scripts/rename.py rename ./images --pattern "img_{:04d}" --annotations ./labels

Found 100 images
Preview (first 10):
  image1.jpg -> img_0001.jpg
  image2.jpg -> img_0002.jpg
  image3.jpg -> img_0003.jpg
  ...

Apply changes? (y/n): y
✓ Renamed 100 images
✓ Renamed 95 annotation files

Pattern Options

  • {:04d} - Sequential number with leading zeros
  • {date} - Current date (YYYYMMDD)
  • {original} - Original filename without extension

Installation

No additional installation required.

Options

  • --pattern: Output filename pattern
  • --prefix: Add prefix to filename
  • --suffix: Add suffix to filename
  • --start: Starting number for sequential renaming
  • --annotations: Path to annotation files (will be renamed together)
  • --preview: Preview changes without applying
  • --force: Overwrite existing files

版本历史

共 1 个版本

  • v1.0.0 当前
    2026-03-30 14:49 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

content-creation

Humanizer

biostartechnology
消除AI写作痕迹,使文本更自然真实。基于维基百科"AI写作特征"指南,识别并修正夸张象征、宣传用语、肤浅-ing分析、模糊归因、破折号滥用、三项排比、AI词汇、负面平行结构及冗长连接词等模式。
★ 857 📥 199,225
developer-tools

Sports Events Query

mingo-318
使用 TheSportsDB 免费 API,无需 API 密钥,即可获取多项体育赛事、赛果、球队信息和联赛详情。
★ 1 📥 688
content-creation

AdMapix

fly0pants
广告情报与应用数据分析助手,支持搜索广告素材、分析应用排名、下载量、收入及市场洞察,用于广告素材和竞品分析。
★ 294 📥 136,391