Skip to content

Commit

Permalink
Merge branch 'develop' into bs/update_pillow
Browse files Browse the repository at this point in the history
  • Loading branch information
bsekachev committed Nov 6, 2023
2 parents 1e2da24 + 506c96b commit 1e2be21
Show file tree
Hide file tree
Showing 35 changed files with 590 additions and 191 deletions.
53 changes: 53 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,59 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

<!-- scriv-insert-here -->

<a id='changelog-2.8.1'></a>
## \[2.8.1\] - 2023-11-03

### Added

- Support for default bucket prefix
(<https://github.com/opencv/cvat/pull/6943>)
- Search for cloud storage and share files
(<https://github.com/opencv/cvat/pull/6943>)

- Ability to limit one user to one task at a time
(<https://github.com/opencv/cvat/pull/6975>)

- Support for using an external database in a Docker Compose-based deployment
(<https://github.com/opencv/cvat/pull/7055>)

### Changed

- Migrated to rq 1.15.1
(<https://github.com/opencv/cvat/pull/6975>)

- Compressed sequental `change:frame` events into one
(<https://github.com/opencv/cvat/pull/7048>)

- Create a local session for AWS S3 client instead of using the default global one
(<https://github.com/opencv/cvat/pull/7067>)

- Improved performance of chunk preparation when creating tasks
(<https://github.com/opencv/cvat/pull/7081>)

### Fixed

- Race condition in a task data upload request, which may lead to problems with task creation in some specific cases,
such as multiple identical data requests at the same time
(<https://github.com/opencv/cvat/pull/7025>)

- Bug with viewing dependent RQ jobs for downloading resources from
cloud storage when file path contains sub-directories.
This is relevant for admins that can view detailed information about RQ queues.
(<https://github.com/opencv/cvat/pull/6975>)

- OpenCV.js memory leak with TrackerMIL
(<https://github.com/opencv/cvat/pull/7032>)

- Can't deploy detectron serverless function
(<https://github.com/opencv/cvat/pull/7047>)

- A mask becomes visible even if hidden after changing opacity level
(<https://github.com/opencv/cvat/pull/7060>)

- There is no switcher to personal workspace if an organization request failed
(<https://github.com/opencv/cvat/pull/7063>)

<a id='changelog-2.8.0'></a>

## \[2.8.0\] - 2023-10-23
Expand Down

This file was deleted.

5 changes: 0 additions & 5 deletions changelog.d/20231018_224126_andrey_bulk_save_server_files.md

This file was deleted.

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions changelog.d/20231024_105610_boris_fix_detectron.md

This file was deleted.

This file was deleted.

4 changes: 0 additions & 4 deletions changelog.d/20231025_101044_boris_keypoints.md

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- OpenCV runtime initialization
(<https://github.com/opencv/cvat/pull/7101>)
1 change: 1 addition & 0 deletions cvat-core/src/log.ts
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ export default function logFactory(logType: LogType, payload: any): EventLogger
LogType.copyObject,
LogType.undoAction,
LogType.redoAction,
LogType.changeFrame,
];

if (logsWithCount.includes(logType)) {
Expand Down
58 changes: 46 additions & 12 deletions cvat-core/src/logger-storage.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) 2022 CVAT.ai Corporation
// Copyright (C) 2022-2023 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -15,40 +15,70 @@ function sleep(ms): Promise<void> {
});
}

function defaultUpdate(previousLog: EventLogger, currentPayload: any): object {
return {
...previousLog.payload,
...currentPayload,
};
}

interface IgnoreRule {
lastLog: EventLogger | null;
timeThreshold?: number;
ignore: (previousLog: EventLogger, currentPayload: any) => boolean;
update: (previousLog: EventLogger, currentPayload: any) => object;
}

type IgnoredRules = LogType.zoomImage | LogType.changeAttribute | LogType.changeFrame;

class LoggerStorage {
public clientID: string;
public collection: Array<EventLogger>;
public ignoreRules: Record<LogType.zoomImage | LogType.changeAttribute, IgnoreRule>;
public ignoreRules: Record<IgnoredRules, IgnoreRule>;
public isActiveChecker: (() => boolean) | null;
public saving: boolean;
public compressedLogs: Array<LogType>;

constructor() {
this.clientID = Date.now().toString().substr(-6);
this.collection = [];
this.isActiveChecker = null;
this.saving = false;
this.compressedLogs = [LogType.changeFrame];
this.ignoreRules = {
[LogType.zoomImage]: {
lastLog: null,
timeThreshold: 1000,
ignore(previousLog: EventLogger) {
timeThreshold: 4000,
ignore(previousLog: EventLogger): boolean {
return (Date.now() - previousLog.time.getTime()) < this.timeThreshold;
},
update: defaultUpdate,
},
[LogType.changeAttribute]: {
lastLog: null,
ignore(previousLog: EventLogger, currentPayload: any) {
ignore(previousLog: EventLogger, currentPayload: any): boolean {
return (
currentPayload.object_id === previousLog.payload.object_id &&
currentPayload.id === previousLog.payload.id
);
},
update: defaultUpdate,
},
[LogType.changeFrame]: {
lastLog: null,
ignore(previousLog: EventLogger, currentPayload: any): boolean {
return (
currentPayload.job_id === previousLog.payload.job_id &&
currentPayload.step === previousLog.payload.step
);
},
update(previousLog: EventLogger, currentPayload: any): object {
return {
...previousLog.payload,
to: currentPayload.to,
count: previousLog.payload.count + 1,
};
},
},
};
}
Expand Down Expand Up @@ -105,14 +135,17 @@ Object.defineProperties(LoggerStorage.prototype.log, {
throw new ArgumentError('Wait must be boolean');
}

if (!this.compressedLogs.includes(logType)) {
this.compressedLogs.forEach((compressedType: LogType) => {
this.ignoreRules[compressedType].lastLog = null;
});
}

if (logType in this.ignoreRules) {
const ignoreRule = this.ignoreRules[logType];
const { lastLog } = ignoreRule;
if (lastLog && ignoreRule.ignore(lastLog, payload)) {
lastLog.payload = {
...lastLog.payload,
...payload,
};
lastLog.payload = ignoreRule.update(lastLog, payload);

return ignoreRule.lastLog;
}
Expand All @@ -125,14 +158,15 @@ Object.defineProperties(LoggerStorage.prototype.log, {
}

const log = logFactory(logType, { ...logPayload });
if (logType in this.ignoreRules) {
this.ignoreRules[logType].lastLog = log;
}

const pushEvent = (): void => {
log.validatePayload();
log.onClose(null);
this.collection.push(log);

if (logType in this.ignoreRules) {
this.ignoreRules[logType].lastLog = log;
}
};

if (log.scope === LogType.exception) {
Expand Down
9 changes: 7 additions & 2 deletions cvat-ui/src/actions/annotation-actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -593,6 +593,7 @@ export function confirmCanvasReadyAsync(): ThunkAction {
try {
const state: CombinedState = getState();
const { instance: job } = state.annotation.job;
const { changeFrameLog } = state.annotation.player.frame;
const chunks = await job.frames.cachedChunks() as number[];
const { startFrame, stopFrame, dataChunkSize } = job;

Expand All @@ -612,6 +613,7 @@ export function confirmCanvasReadyAsync(): ThunkAction {
}, []).map(([start, end]) => `${start}:${end}`).join(';');

dispatch(confirmCanvasReady(ranges));
await changeFrameLog?.close();
} catch (error) {
// even if error happens here, do not need to notify the users
dispatch(confirmCanvasReady());
Expand Down Expand Up @@ -662,10 +664,12 @@ export function changeFrameAsync(

// commit the latest job frame to local storage
localStorage.setItem(`Job_${job.id}_frame`, `${toFrame}`);
await job.logger.log(LogType.changeFrame, {
const changeFrameLog = await job.logger.log(LogType.changeFrame, {
from: frame,
to: toFrame,
});
step: toFrame - frame,
count: 1,
}, true);

const [minZ, maxZ] = computeZRange(states);
const currentTime = new Date().getTime();
Expand Down Expand Up @@ -701,6 +705,7 @@ export function changeFrameAsync(
curZ: maxZ,
changeTime: currentTime + delay,
delay,
changeFrameLog,
},
});
} catch (error) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,8 @@ class OpenCVControlComponent extends React.PureComponent<Props & DispatchToProps
} else if (libraryInitialized !== openCVWrapper.isInitialized) {
this.setState({
libraryInitialized: openCVWrapper.isInitialized,
trackers: Object.values(openCVWrapper.tracking),
activeTracker: Object.values(openCVWrapper.tracking)[0] || null,
});
}
}}
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/src/components/organization-page/member-item.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function MemberItem(props: Props): JSX.Element {
const { username, firstName, lastName } = user;
const { username: selfUserName } = useSelector((state: CombinedState) => state.auth.user);

const invitationActionsMenu = (
const invitationActionsMenu = invitation && (
<Dropdown overlay={(
<Menu onClick={(action: MenuInfo) => {
if (action.key === MenuKeys.RESEND_INVITATION) {
Expand Down
2 changes: 2 additions & 0 deletions cvat-ui/src/cvat-core-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ import Organization, { Membership, Invitation } from 'cvat-core/src/organization
import AnnotationGuide from 'cvat-core/src/guide';
import AnalyticsReport, { AnalyticsEntryViewType, AnalyticsEntry } from 'cvat-core/src/analytics-report';
import { Dumper } from 'cvat-core/src/annotation-formats';
import { EventLogger } from 'cvat-core/src/log';
import { APIWrapperEnterOptions } from 'cvat-core/src/plugins';

const cvat: any = _cvat;
Expand Down Expand Up @@ -87,6 +88,7 @@ export {
AnalyticsEntry,
AnalyticsEntryViewType,
ServerError,
EventLogger,
};

export type {
Expand Down
4 changes: 4 additions & 0 deletions cvat-ui/src/reducers/annotation-reducer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,7 @@ const defaultState: AnnotationState = {
fetching: false,
delay: 0,
changeTime: null,
changeFrameLog: null,
},
ranges: '',
playing: false,
Expand Down Expand Up @@ -287,6 +288,7 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
curZ,
delay,
changeTime,
changeFrameLog,
} = action.payload;
return {
...state,
Expand All @@ -300,6 +302,7 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
fetching: false,
changeTime,
delay,
changeFrameLog,
},
},
annotations: {
Expand All @@ -323,6 +326,7 @@ export default (state = defaultState, action: AnyAction): AnnotationState => {
frame: {
...state.player.frame,
fetching: false,
changeFrameLog: null,
},
},
};
Expand Down
3 changes: 2 additions & 1 deletion cvat-ui/src/reducers/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Canvas3d } from 'cvat-canvas3d/src/typescript/canvas3d';
import { Canvas, RectDrawingMethod, CuboidDrawingMethod } from 'cvat-canvas-wrapper';
import {
Webhook, MLModel, ModelProvider, Organization,
QualityReport, QualityConflict, QualitySettings, FramesMetaData, RQStatus,
QualityReport, QualityConflict, QualitySettings, FramesMetaData, RQStatus, EventLogger,
} from 'cvat-core-wrapper';
import { IntelligentScissors } from 'utils/opencv-wrapper/intelligent-scissors';
import { KeyMap } from 'utils/mousetrap-react';
Expand Down Expand Up @@ -693,6 +693,7 @@ export interface AnnotationState {
fetching: boolean;
delay: number;
changeTime: number | null;
changeFrameLog: EventLogger | null;
};
ranges: string;
navigationBlocked: boolean;
Expand Down
Loading

0 comments on commit 1e2be21

Please sign in to comment.