Add cropping

This commit is contained in:
khalid@traclabs.com
2026-04-30 15:30:52 -05:00
parent bfc32e78a9
commit 62e5e309ad
4 changed files with 216 additions and 5 deletions

View File

@@ -49,8 +49,25 @@ export const Job = sequelize.define('Job', {
allowNull: false,
defaultValue: 'qwen3.5:397b-cloud',
},
inputTokens: { type: DataTypes.INTEGER, allowNull: true },
inputTokens: { type: DataTypes.INTEGER, allowNull: true },
outputTokens: { type: DataTypes.INTEGER, allowNull: true },
// ---- Bounding-box detection fields (Pass 1) ----
detectedSubject: {
type: DataTypes.STRING(256),
allowNull: true,
comment: 'Short description of what the LLM identified as the subject',
},
bboxX: { type: DataTypes.FLOAT, allowNull: true },
bboxY: { type: DataTypes.FLOAT, allowNull: true },
bboxWidth: { type: DataTypes.FLOAT, allowNull: true },
bboxHeight: { type: DataTypes.FLOAT, allowNull: true },
// Cropped image data URL (stored for UI preview / debugging)
croppedImageDataUrl: {
type: DataTypes.TEXT,
allowNull: true,
},
}, {
tableName: 'jobs',
timestamps: true,
@@ -59,5 +76,6 @@ export const Job = sequelize.define('Job', {
export async function initDb() {
const { mkdirSync } = await import('fs');
mkdirSync(join(__dirname, '../data'), { recursive: true });
await sequelize.sync();
// alter: true adds new columns to an existing table without dropping data
await sequelize.sync({ alter: true });
}