initial push
This commit is contained in:
40
backend/models/Annotation.js
Normal file
40
backend/models/Annotation.js
Normal file
@@ -0,0 +1,40 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
|
||||
const Annotation = sequelize.define('Annotation', {
|
||||
annotation_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
image_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
x: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: false,
|
||||
},
|
||||
y: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: false,
|
||||
},
|
||||
height: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: false,
|
||||
},
|
||||
width: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: false,
|
||||
},
|
||||
Label: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
}, {
|
||||
tableName: 'annotation',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = Annotation;
|
||||
35
backend/models/Images.js
Normal file
35
backend/models/Images.js
Normal file
@@ -0,0 +1,35 @@
|
||||
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const Image = sequelize.define('Image', {
|
||||
image_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
},
|
||||
image_path: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
project_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
},
|
||||
width: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: true,
|
||||
},
|
||||
height: {
|
||||
type: DataTypes.FLOAT,
|
||||
allowNull: true,
|
||||
},
|
||||
|
||||
}, {
|
||||
tableName: 'image',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = Image;
|
||||
|
||||
|
||||
24
backend/models/LabelStudioProject.js
Normal file
24
backend/models/LabelStudioProject.js
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const Label_studio_project = sequelize.define('LabelStudioProject', {
|
||||
project_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
unique: true,
|
||||
allowNull: false,
|
||||
},
|
||||
title:{
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
}
|
||||
|
||||
}, {
|
||||
tableName: 'label_studio_project',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = Label_studio_project;
|
||||
|
||||
|
||||
38
backend/models/TrainingProject.js
Normal file
38
backend/models/TrainingProject.js
Normal file
@@ -0,0 +1,38 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const Training_Project = sequelize.define('LabelStudioProject', {
|
||||
project_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
unique: true,
|
||||
allowNull: false,
|
||||
autoIncrement: true,
|
||||
},
|
||||
title:{
|
||||
type: DataTypes.STRING,
|
||||
allowNull: false,
|
||||
},
|
||||
description: {
|
||||
type: DataTypes.STRING,
|
||||
},
|
||||
classes: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: false,
|
||||
},
|
||||
project_image: {
|
||||
type: DataTypes.BLOB,
|
||||
},
|
||||
project_image_type: {
|
||||
type: DataTypes.STRING,
|
||||
allowNull: true,
|
||||
}
|
||||
|
||||
}, {
|
||||
tableName: 'training_project',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = Training_Project;
|
||||
|
||||
|
||||
33
backend/models/TrainingProjectDetails.js
Normal file
33
backend/models/TrainingProjectDetails.js
Normal file
@@ -0,0 +1,33 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const TrainingProjectDetails = sequelize.define('TrainingProjectDetails', {
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
primaryKey: true,
|
||||
autoIncrement: true,
|
||||
unique: true,
|
||||
},
|
||||
project_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false,
|
||||
unique: true,
|
||||
},
|
||||
annotation_projects: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: false,
|
||||
},
|
||||
class_map: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: true,
|
||||
},
|
||||
description: {
|
||||
type: DataTypes.JSON,
|
||||
allowNull: true,
|
||||
}
|
||||
}, {
|
||||
tableName: 'training_project_details',
|
||||
timestamps: false,
|
||||
});
|
||||
|
||||
module.exports = TrainingProjectDetails;
|
||||
30
backend/models/index.js
Normal file
30
backend/models/index.js
Normal file
@@ -0,0 +1,30 @@
|
||||
const LabelStudioProject = require('./LabelStudioProject.js');
|
||||
const Annotation = require('./Annotation.js');
|
||||
const Image = require('./Images.js');
|
||||
const sequelize = require('../database/database.js');
|
||||
const TrainingProjectDetails = require('./TrainingProjectDetails.js');
|
||||
const TrainingProject = require('./TrainingProject.js');
|
||||
const Training = require('./training.js');
|
||||
|
||||
|
||||
|
||||
const Project = LabelStudioProject;
|
||||
const Img = Image;
|
||||
const Ann = Annotation;
|
||||
|
||||
// Associations
|
||||
Project.hasMany(Img, { foreignKey: 'project_id' });
|
||||
Img.belongsTo(Project, { foreignKey: 'project_id' });
|
||||
|
||||
Img.hasMany(Ann, { foreignKey: 'image_id' });
|
||||
Ann.belongsTo(Img, { foreignKey: 'image_id' });
|
||||
|
||||
// TrainingProjectDetails <-> TrainingProject
|
||||
TrainingProjectDetails.belongsTo(TrainingProject, { foreignKey: 'project_id' });
|
||||
TrainingProject.hasOne(TrainingProjectDetails, { foreignKey: 'project_id' });
|
||||
|
||||
// Training <-> TrainingProjectDetails
|
||||
Training.belongsTo(TrainingProjectDetails, { foreignKey: 'project_details_id' });
|
||||
TrainingProjectDetails.hasMany(Training, { foreignKey: 'project_details_id' });
|
||||
|
||||
module.exports = { Project, Img, Ann, TrainingProjectDetails, TrainingProject, Training };
|
||||
140
backend/models/training.js
Normal file
140
backend/models/training.js
Normal file
@@ -0,0 +1,140 @@
|
||||
const { DataTypes } = require('sequelize');
|
||||
const sequelize = require('../database/database.js');
|
||||
|
||||
const Training = sequelize.define('training', {
|
||||
id: {
|
||||
type: DataTypes.INTEGER,
|
||||
autoIncrement: true,
|
||||
unique: true,
|
||||
primaryKey: true
|
||||
},
|
||||
exp_name: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
max_epoch: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
depth: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
width: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
activation: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
warmup_epochs: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
warmup_lr: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
basic_lr_per_img: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
scheduler: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
no_aug_epochs: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
min_lr_ratio: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
ema: {
|
||||
type: DataTypes.BOOLEAN
|
||||
},
|
||||
weight_decay: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
momentum: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
input_size: {
|
||||
type: DataTypes.JSON
|
||||
},
|
||||
print_interval: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
eval_interval: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
save_history_ckpt: {
|
||||
type: DataTypes.BOOLEAN
|
||||
},
|
||||
test_size: {
|
||||
type: DataTypes.JSON
|
||||
},
|
||||
test_conf: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
nms_thre: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
multiscale_range: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
enable_mixup: {
|
||||
type: DataTypes.BOOLEAN
|
||||
},
|
||||
mosaic_prob: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
mixup_prob: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
hsv_prob: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
flip_prob: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
degrees: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
mosaic_scale: {
|
||||
type: DataTypes.JSON
|
||||
},
|
||||
mixup_scale: {
|
||||
type: DataTypes.JSON
|
||||
},
|
||||
translate: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
shear: {
|
||||
type: DataTypes.FLOAT
|
||||
},
|
||||
training_name: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
project_details_id: {
|
||||
type: DataTypes.INTEGER,
|
||||
allowNull: false
|
||||
},
|
||||
seed: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
train: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
valid: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
test: {
|
||||
type: DataTypes.INTEGER
|
||||
},
|
||||
selected_model: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
transfer_learning: {
|
||||
type: DataTypes.STRING(255)
|
||||
},
|
||||
model_upload: {
|
||||
type: DataTypes.BLOB
|
||||
}
|
||||
}, {
|
||||
tableName: 'training',
|
||||
timestamps: false
|
||||
});
|
||||
|
||||
module.exports = Training;
|
||||
Reference in New Issue
Block a user