处理尺寸不一致
This commit is contained in:
@@ -30,7 +30,8 @@ const help = `模型接入与结构理解(新增模式,不调用旧拆件流
|
||||
--input-dir DIR SAM 阶段读理解目录;补全阶段读 SAM 目录
|
||||
--part ID 补全部件 ID,可重复;默认处理所有需补全部件
|
||||
--prepare-only 仅准备补全画布、掩码和提示词,不请求模型
|
||||
--candidates-dir DIR 离线导入 ID.png 补全候选,不请求模型
|
||||
--candidates-dir DIR 离线导入 ID.png,或旧补全目录的首张候选,不请求模型
|
||||
--candidate-size-policy NAME strict(默认)/ uniform(同宽高比缩放后重新检查对齐)
|
||||
--completion-size INT 补全方形画布边长,默认 1024,不缩放原像素
|
||||
--extension-radius INT 补全区域距可见轮廓的最大像素距离,默认 32
|
||||
--sam-dir DIR 本地 SAM 根目录,包含 sam3 与 sam3.1checkpoint
|
||||
@@ -56,6 +57,7 @@ export function parseOptions(argv) {
|
||||
['--input-dir', 'inputDir'], ['--sam-dir', 'samDir'], ['--sam-code-dir', 'samCodeDir'],
|
||||
['--sam-checkpoint', 'samCheckpoint'], ['--sam-confidence', 'samConfidence'], ['--sam-precision', 'samPrecision'],
|
||||
['--candidates-dir', 'candidatesDir'], ['--completion-size', 'completionSize'], ['--extension-radius', 'extensionRadius'],
|
||||
['--candidate-size-policy', 'candidateSizePolicy'],
|
||||
]);
|
||||
for (let i = 0; i < argv.length; i += 1) {
|
||||
const flag = argv[i];
|
||||
@@ -88,7 +90,7 @@ export async function main(argv = process.argv.slice(2)) {
|
||||
}
|
||||
const loaded = loadConfig(options);
|
||||
const partCompletion = options.stage === 'completion' && options.inputDir;
|
||||
if (!partCompletion && (options.prepareOnly || options.candidatesDir || options.partIds.length || options.completionSize || options.extensionRadius)) {
|
||||
if (!partCompletion && (options.prepareOnly || options.candidatesDir || options.partIds.length || options.completionSize || options.extensionRadius || options.candidateSizePolicy)) {
|
||||
throw new Error('部件补全参数需要 --stage completion --input-dir');
|
||||
}
|
||||
if (partCompletion) {
|
||||
|
||||
Reference in New Issue
Block a user