Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#877] Format and lint core-model module #1094

Merged
merged 1 commit into from
Jan 16, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion ui/.eslintignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ cypress/fixtures/**/*.csv

# Remove these in the future to lint additional modules
# Please also see .prettierignore
src/app/core-model
src/app/core-services
src/app/core-ui
src/app/CustomMaterial
Expand Down
1 change: 0 additions & 1 deletion ui/.prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ cypress/fixtures/**/*.csv

# Remove these in the future to format additional modules
# Please also see .eslintignore
src/app/core-model
src/app/core-services
src/app/core-ui
src/app/CustomMaterial
Expand Down
16 changes: 8 additions & 8 deletions ui/src/app/core-model/base/UserErrorMessage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,13 @@
*/

export class UserErrorMessage {
public title: string;
public content: string;
public level: string;
public title: string;
public content: string;
public level: string;

constructor(title: string, content: string, level = 'error') {
this.title = title;
this.content = content;
this.level = level;
}
constructor(title: string, content: string, level = 'error') {
this.title = title;
this.content = content;
this.level = level;
}
}
40 changes: 19 additions & 21 deletions ui/src/app/core-model/coco/Annotation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,27 +17,25 @@
*/

export class Annotation {
id: number;
image_id: number;
category_id: number;
segmentation: [any]; // RLE or [polygon] -> polygon [[x1,y1,x2,y2,... xn, yn]]
area: number;
bbox: [number, number, number, number]; // [x,y,width,height]
iscrowd: number; // (iscrowd=0 in which case polygons are used) or a collection of objects (iscrowd=1 in which case RLE is used)
brushSize: number [];
id: number;
image_id: number;
category_id: number;
segmentation: [any]; // RLE or [polygon] -> polygon [[x1,y1,x2,y2,... xn, yn]]
area: number;
bbox: [number, number, number, number]; // [x,y,width,height]
iscrowd: number; // (iscrowd=0 in which case polygons are used) or a collection of objects (iscrowd=1 in which case RLE is used)
brushSize: number[];

// For UI
isSelected = false;
isHovered = false;
category_name: string;
color: string;
label_name: string;

// For UI
isSelected = false;
isHovered = false;
category_name: string;
color: string;
label_name: string;

constructor() {
this.segmentation = undefined;
this.bbox = undefined;
this.brushSize = undefined;
}

constructor() {
this.segmentation = undefined;
this.bbox = undefined;
this.brushSize = undefined;
}
}
26 changes: 15 additions & 11 deletions ui/src/app/core-model/coco/Category.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,20 @@
*/

export class Category {
constructor(
id: number,
name: string,
supercategory: string,
label_name: string,
) {
this.id = id;
this.name = name;
this.supercategory = supercategory;
this.label_name = label_name;
}

constructor(id: number, name: string, supercategory: string, label_name: string) {
this.id = id;
this.name = name;
this.supercategory = supercategory;
this.label_name = label_name;
}

id: number;
name: string;
supercategory: string;
label_name: string;
id: number;
name: string;
supercategory: string;
label_name: string;
}
28 changes: 13 additions & 15 deletions ui/src/app/core-model/coco/Coco.format.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,20 +21,18 @@ import { Category } from './Category';
import { Image } from './Image';

export class CocoFormat {
info: {
year: number;
version: string;
description: string;
contributor: string;
url: string;
date_created: Date;
};
licenses: [];
images: Image[] = [];
annotations: Annotation[] = [];
categories: Category[] = [];

info: {
'year': number,
'version': string,
'description': string,
'contributor': string,
'url': string,
'date_created': Date,
};
licenses: [];
images: Image[] = [];
annotations: Annotation[] = [];
categories: Category[] = [];

constructor() { }

constructor() {}
}
16 changes: 8 additions & 8 deletions ui/src/app/core-model/coco/Image.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,12 +17,12 @@
*/

export class Image {
id: number;
width: number;
height: number;
file_name: Date;
license: number;
flickr_url: Date;
coco_url: Date;
date_captured: Date;
id: number;
width: number;
height: number;
file_name: Date;
license: number;
flickr_url: Date;
coco_url: Date;
date_captured: Date;
}