HivisionIDPhotos/data_utils.py
houseme 9a466d6626 improve comment
AutoCorrect is a linter and formatter to help you to improve copywriting, correct spaces, words, and punctuations between CJK (Chinese, Japanese, Korean).
AutoCorrect 是一个基于 Rust 编写的工具,用于「自动纠正」或「检查并建议」文案,给 CJK(中文、日语、韩语)与英文混写的场景,补充正确的空格,纠正单词,同时尝试以安全的方式自动纠正标点符号等等。

建议使用,GitHub:https://github.com/huacnlee/autocorrect

GitHub-Action: https://github.com/huacnlee/autocorrect?tab=readme-ov-file#github-action
2024-09-02 16:39:40 +08:00

19 lines
457 B
Python

import csv
def csv_to_size_list(csv_file: str) -> dict:
# 初始化一个空字典
size_list_dict = {}
# 打开 CSV 文件并读取数据
with open(csv_file, mode="r") as file:
reader = csv.reader(file)
# 跳过表头
next(reader)
# 读取数据并填充字典
for row in reader:
size_name, h, w = row
size_list_dict[size_name] = (int(h), int(w))
return size_list_dict