Improved stability of actions_tasks2/case_101_opencv_basic_actions.js (#58)

main
Kirill Lakhov 4 years ago committed by GitHub
parent b50b275e0b
commit 9f2ccb8f81
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -486,12 +486,13 @@ class OpenCVControlComponent extends React.PureComponent<Props & DispatchToProps
switchNavigationBlocked(true);
for (const trackerID of Object.keys(trackingData)) {
const numOfObjects = trackingData[trackerID].length;
const hideMessage = message.loading(
`${trackerID}: ${numOfObjects} ${
const hideMessage = message.loading({
content: `${trackerID}: ${numOfObjects} ${
numOfObjects > 1 ? 'objects are' : 'object is'
} being tracked..`,
0,
);
duration: 0,
className: 'cvat-tracking-notice',
});
const imageData = this.getCanvasImageData();
for (const shape of trackingData[trackerID]) {
const [objectState] = objectStates.filter(

@ -351,7 +351,11 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
this.interaction.latestRequest = null;
try {
this.interaction.hideMessage = message.loading(`Waiting a response from ${activeInteractor?.name}..`, 0);
this.interaction.hideMessage = message.loading({
content: `Waiting a response from ${activeInteractor?.name}..`,
duration: 0,
className: 'cvat-tracking-notice',
});
try {
// run server request
this.setState({ fetching: true });
@ -697,12 +701,13 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
const trackableObjects = trackingData.stateless[trackerID];
const numOfObjects = trackableObjects.clientIDs.length;
hideMessage = message.loading(
`${tracker.name}: states are being initialized for ${numOfObjects} ${
hideMessage = message.loading({
content: `${tracker.name}: states are being initialized for ${numOfObjects} ${
numOfObjects > 1 ? 'objects' : 'object'
} ..`,
0,
);
duration: 0,
className: 'cvat-tracking-notice',
});
// eslint-disable-next-line no-await-in-loop
const response = await core.lambda.call(jobInstance.taskId, tracker, {
frame: frame - 1,
@ -742,12 +747,13 @@ export class ToolsControlComponent extends React.PureComponent<Props, State> {
const trackableObjects = trackingData.statefull[trackerID];
const numOfObjects = trackableObjects.clientIDs.length;
hideMessage = message.loading(
`${tracker.name}: ${numOfObjects} ${
hideMessage = message.loading({
content: `${tracker.name}: ${numOfObjects} ${
numOfObjects > 1 ? 'objects are' : 'object is'
} being tracked..`,
0,
);
duration: 0,
className: 'cvat-tracking-notice',
});
// eslint-disable-next-line no-await-in-loop
const response = await core.lambda.call(jobInstance.taskId, tracker, {
frame: frame - 1,

@ -194,16 +194,17 @@ context('OpenCV. Intelligent scissors. Histogram Equalization. TrackerMIL.', ()
});
it('Create a shape with "TrackerMIL". Track it for several frames.', () => {
// Track shape and move from 0 to 1 frame to init tracker
// We will start testing tracking from 2 frame because it's a bit unstable on inintialization
// We will start testing tracking from 2-d frame because it's a bit unstable on inintialization
cy.createOpenCVTrack(createOpencvTrackerShape);
cy.goToNextFrame(1);
cy.get('.cvat-tracking-notice').should('not.exist');
cy.get('#cvat_canvas_shape_3')
.then((shape) => {
const x = Math.round(shape.attr('x'));
const y = Math.round(shape.attr('y'));
for (let i = 2; i < imagesCount; i++) {
cy.goToNextFrame(i);
cy.get('.cvat-tracking-notice').should('not.exist');
// In the beginning of this test we created images with text
// On each frame text is moved by 5px on x and y axis,
// so we expect shape to be close to real text positions

Loading…
Cancel
Save