I followed the instructions from imagga to run a python script to auto tag multiple images with keywords at once using a 3rd party API (called imagga)
In the required script I have to add 3rd API Key and input and output parameters when running the script. (input is the folder containing the images and output is the folder to contain the results the script generates)
But I'm not a programmer, I don't know how to write the syntax correctly. That's why the code can't run properly, and it shows an error saying I have to add two parameters: input and output
I'm hoping someone can give me a clear syntax example in cmd so I can run this script properly. This is a 3rd party guide (imagga)
https://imagga.com/blog/batch-image-processing-from-local-folder-using-imagga-api/
(I added API key and API secret as instructions)
This is the original script code from imagga. (line 98 99 105 106)
https://bitbucket.org/snippets/imaggateam/LL6dd
I saved script as: tag.py
I try to run in cmd with this prompt: tag.py
But cmd sent me an error that I need add input and output arguments

我正在try 成功启动一个python脚本,以自动标记本地文件夹中的图像并将结果导出到另一个本地文件夹

推荐答案

根据您提供的脚本,要使用所需的输入和输出参数运行它,您需要在命令提示符(Cmd)中使用以下语法:

python3 tag.py <input_folder_path> <output_folder_path>

<input_folder_path>替换为包含您要标记的图像的文件夹的路径,将<output_folder_path>替换为您希望脚本保存结果的文件夹的路径.当您将尖括号(<>)替换为实际文件夹路径时,请确保删除这些尖括号.

Python相关问答推荐

Pydantic 2.7.0模型接受字符串日期时间或无

根据不同列的值在收件箱中移动数据

运行总计基于多列pandas的分组和总和

. str.替换pandas.series的方法未按预期工作

查找两极rame中组之间的所有差异

_repr_html_实现自定义__getattr_时未显示

将图像拖到另一个图像

为什么sys.exit()不能与subproccess.run()或subprocess.call()一起使用

如何从pandas的rame类继承并使用filepath实例化

如何让这个星型模式在Python中只使用一个for循环?

Pandas:计算中间时间条目的总时间增量

干燥化与列姆化的比较

为什么Python内存中的列表大小与文档不匹配?

30个非DATETIME天内的累计金额

Autocad使用pyautocad/comtypes将对象从一个图形复制到另一个图形

为什么后跟inplace方法的`.rename(Columns={';b';:';b';},Copy=False)`没有更新原始数据帧?

FileNotFoundError:[WinError 2]系统找不到指定的文件:在os.listdir中查找扩展名

如何在Polars中处理用户自定义函数的多行结果?

Pandas ,快速从词典栏中提取信息到新栏

IpyWidget Select 框未打开