Skip to content

Commit 34269a2

Browse files
authored
feat: add image_polygons to human-app and repo (#2854)
* feat: add image_polygons to human-app * feat: add image_polygons to ro
1 parent 903e0e1 commit 34269a2

File tree

7 files changed

+27
-1
lines changed

7 files changed

+27
-1
lines changed

packages/apps/human-app/frontend/src/i18n/en.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -405,6 +405,7 @@
405405
"image_points": "Points",
406406
"image_boxes": "Bounding Boxes",
407407
"image_boxes_from_points": "Bounding Boxes from Points",
408-
"image_skeletons_from_boxes": "Skeletons from Bounding Boxes"
408+
"image_skeletons_from_boxes": "Skeletons from Bounding Boxes",
409+
"image_polygons": "Polygons"
409410
}
410411
}

packages/apps/human-app/frontend/src/smart-contracts/EthKVStore/config.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ export enum JobType {
1111
BoundingBoxes = 'image_boxes',
1212
BoundingBoxesFromPoints = 'image_boxes_from_points',
1313
SkeletonsFromBoundingBoxes = 'image_skeletons_from_boxes',
14+
Polygons = 'image_polygons',
1415
}
1516

1617
export const EthKVStoreKeys = {

packages/apps/reputation-oracle/server/src/common/constants/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ export const CVAT_JOB_TYPES = [
2323
JobRequestType.IMAGE_POINTS,
2424
JobRequestType.IMAGE_BOXES_FROM_POINTS,
2525
JobRequestType.IMAGE_SKELETONS_FROM_BOXES,
26+
JobRequestType.IMAGE_POLYGONS,
2627
];
2728

2829
export const HEADER_SIGNATURE_KEY = 'human-signature';

packages/apps/reputation-oracle/server/src/common/enums/job.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ export enum JobRequestType {
44
IMAGE_BOXES_FROM_POINTS = 'image_boxes_from_points',
55
IMAGE_SKELETONS_FROM_BOXES = 'image_skeletons_from_boxes',
66
FORTUNE = 'fortune',
7+
IMAGE_POLYGONS = 'image_polygons',
78
}
89

910
export enum SolutionError {

packages/apps/reputation-oracle/server/src/modules/payout/payout.service.spec.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,10 @@ describe('PayoutService', () => {
9999
calculatePayouts: jest.fn(),
100100
saveResults: jest.fn(),
101101
},
102+
[JobRequestType.IMAGE_POLYGONS]: {
103+
calculatePayouts: jest.fn(),
104+
saveResults: jest.fn(),
105+
},
102106
};
103107
});
104108

packages/apps/reputation-oracle/server/src/modules/payout/payout.service.ts

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,17 @@ export class PayoutService {
189189
escrowAddress: string,
190190
): Promise<SaveResultDto> => this.saveResultsCvat(chainId, escrowAddress),
191191
},
192+
[JobRequestType.IMAGE_POLYGONS]: {
193+
calculatePayouts: async (
194+
manifest: CvatManifestDto,
195+
data: CalculatePayoutsDto,
196+
): Promise<PayoutsDataDto> =>
197+
this.calculatePayoutsCvat(manifest, data.chainId, data.escrowAddress),
198+
saveResults: async (
199+
chainId: ChainId,
200+
escrowAddress: string,
201+
): Promise<SaveResultDto> => this.saveResultsCvat(chainId, escrowAddress),
202+
},
192203
};
193204

194205
/**

packages/apps/reputation-oracle/server/src/modules/reputation/reputation.service.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -151,6 +151,13 @@ export class ReputationService {
151151
manifest: CvatManifestDto,
152152
): Promise<void> => this.processCvat(chainId, escrowAddress, manifest),
153153
},
154+
[JobRequestType.IMAGE_POLYGONS]: {
155+
assessWorkerReputationScores: async (
156+
chainId: ChainId,
157+
escrowAddress: string,
158+
manifest: CvatManifestDto,
159+
): Promise<void> => this.processCvat(chainId, escrowAddress, manifest),
160+
},
154161
};
155162

156163
private async processFortune(

0 commit comments

Comments
 (0)