Skip to content

Commit

Permalink
Merge branch 'develop' into zm/consensus-task-creation
Browse files Browse the repository at this point in the history
  • Loading branch information
zhiltsov-max authored Jan 16, 2025
2 parents f92a3c3 + 3f4de06 commit 5b7e2c2
Show file tree
Hide file tree
Showing 33 changed files with 863 additions and 551 deletions.
2 changes: 1 addition & 1 deletion CITATION.cff
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,6 @@ keywords:
- deep-learning
- annotation
license: MIT
version: 2.8.2
version: 2.25.0
date-released: '2023-11-06'

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
MIT License

Copyright (c) 2018-2022 Intel Corporation
Copyright (c) 2022-2024 CVAT.ai Corporation
Copyright (c) 2022-2025 CVAT.ai Corporation

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 4 additions & 0 deletions changelog.d/20250114_123017_klakhov_improve_quality_ux.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Changed

- Improved UX of quality management page: better table layout, file name search, ability to download table as `.csv`
(<https://github.com/cvat-ai/cvat/pull/8865>)
4 changes: 4 additions & 0 deletions changelog.d/20250115_125619_sekachev.bs_updated_mil.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Changed

- Enhanced MIL tracker. Optimized memory usage. Now it is runnable on many frames, and applicable to drawn rectangles.
(<https://github.com/cvat-ai/cvat/pull/8942>)
10 changes: 7 additions & 3 deletions cvat-core/src/frames.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
// Copyright (C) 2021-2022 Intel Corporation
// Copyright (C) 2022-2024 CVAT.ai Corporation
// Copyright (C) 2022-2025 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -300,7 +300,11 @@ export class FrameData {
);
}

async data(onServerRequest = () => {}): Promise<ImageBitmap | Blob> {
async data(onServerRequest = () => {}): Promise<{
renderWidth: number;
renderHeight: number;
imageData: ImageBitmap | Blob;
}> {
const result = await PluginRegistry.apiWrapper.call(this, FrameData.prototype.data, onServerRequest);
return result;
}
Expand Down Expand Up @@ -372,7 +376,7 @@ Object.defineProperty(FrameData.prototype.data, 'implementation', {
renderWidth: number;
renderHeight: number;
imageData: ImageBitmap | Blob;
} | Blob>((resolve, reject) => {
}>((resolve, reject) => {
const requestId = +_.uniqueId();
const requestedDataFrameNumber = meta.getDataFrameNumber(this.number - jobStartFrame);
const chunkIndex = meta.getFrameChunkIndex(requestedDataFrameNumber);
Expand Down
15 changes: 1 addition & 14 deletions cvat-ui/src/components/analytics-page/styles.scss
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2023-2024 CVAT.ai Corporation
// Copyright (C) 2023-2025 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -66,19 +66,6 @@
min-width: $grid-unit-size * 47;
}

.cvat-analytics-download-report-button {
padding-left: $grid-unit-size * 2;
padding-right: $grid-unit-size * 2;

a {
color: white;

&:hover {
color: white;
}
}
}

.cvat-analytics-page {
height: 100%;
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
// Copyright (C) 2023-2024 CVAT.ai Corporation
// Copyright (C) 2023-2025 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand Down Expand Up @@ -37,7 +37,6 @@ const core = getCore();
interface State {
actions: BaseAction[];
activeAction: BaseAction | null;
initialized: boolean;
fetching: boolean;
progress: number | null;
progressMessage: string | null;
Expand All @@ -50,7 +49,6 @@ interface State {
}

enum ReducerActionType {
SET_INITIALIZED = 'SET_INITIALIZED',
SET_ANNOTATIONS_ACTIONS = 'SET_ANNOTATIONS_ACTIONS',
SET_ACTIVE_ANNOTATIONS_ACTION = 'SET_ACTIVE_ANNOTATIONS_ACTION',
UPDATE_PROGRESS = 'UPDATE_PROGRESS',
Expand All @@ -65,9 +63,6 @@ enum ReducerActionType {
}

export const reducerActions = {
setInitialized: (initialized: boolean) => (
createAction(ReducerActionType.SET_INITIALIZED, { initialized })
),
setAnnotationsActions: (actions: BaseAction[]) => (
createAction(ReducerActionType.SET_ANNOTATIONS_ACTIONS, { actions })
),
Expand Down Expand Up @@ -105,7 +100,6 @@ export const reducerActions = {

const defaultState = {
actions: [],
initialized: false,
fetching: false,
activeAction: null,
progress: null,
Expand All @@ -119,23 +113,13 @@ const defaultState = {
};

const reducer = (state: State = { ...defaultState }, action: ActionUnion<typeof reducerActions>): State => {
if (action.type === ReducerActionType.SET_INITIALIZED) {
return {
...state,
initialized: action.payload.initialized,
};
}

if (action.type === ReducerActionType.SET_ANNOTATIONS_ACTIONS) {
const { actions } = action.payload;
const { targetObjectState } = state;

const filteredActions = targetObjectState ? actions
.filter((_action) => _action.isApplicableForObject(targetObjectState)) : actions;
return {
...state,
actions,
activeAction: filteredActions[0] ?? null,
activeAction: state.activeAction ?? actions[0] ?? null,
};
}

Expand Down Expand Up @@ -246,7 +230,6 @@ type ActionParameterProps = NonNullable<BaseAction['parameters']>[keyof BaseActi

const componentStorage = createStore(reducer, {
actions: [],
initialized: false,
fetching: false,
activeAction: null,
progress: null,
Expand Down Expand Up @@ -319,15 +302,16 @@ function ActionParameterComponent(props: ActionParameterProps & { onChange: (val
interface Props {
onClose: () => void;
targetObjectState?: ObjectState;
defaultAnnotationAction?: string;
}

function AnnotationsActionsModalContent(props: Props): JSX.Element {
const { onClose, targetObjectState: defaultTargetObjectState } = props;
const { onClose, targetObjectState: defaultTargetObjectState, defaultAnnotationAction } = props;
const dispatch = useDispatch();
const storage = getCVATStore();
const cancellationRef = useRef<boolean>(false);
const {
initialized, actions, activeAction, fetching, targetObjectState, cancelled,
actions, activeAction, fetching, targetObjectState, cancelled,
progress, progressMessage, frameFrom, frameTo, actionParameters, modalVisible,
} = useSelector((state: State) => ({ ...state }), shallowEqual);

Expand All @@ -337,20 +321,25 @@ function AnnotationsActionsModalContent(props: Props): JSX.Element {
const currentFrameAction = activeAction instanceof BaseCollectionAction || targetObjectState !== null;

useEffect(() => {
dispatch(reducerActions.setVisible(true));
dispatch(reducerActions.updateFrameFrom(jobInstance.startFrame));
dispatch(reducerActions.updateFrameTo(jobInstance.stopFrame));
dispatch(reducerActions.updateTargetObjectState(defaultTargetObjectState ?? null));
}, []);
core.actions.list().then((list: BaseAction[]) => {
dispatch(reducerActions.setAnnotationsActions(list));

if (defaultAnnotationAction) {
const defaultAction = list.find((action) => action.name === defaultAnnotationAction);
if (
defaultAction &&
(!defaultTargetObjectState || defaultAction.isApplicableForObject(defaultTargetObjectState))
) {
dispatch(reducerActions.setActiveAnnotationsAction(defaultAction));
}
}

useEffect(() => {
if (!initialized) {
core.actions.list().then((list: BaseAction[]) => {
dispatch(reducerActions.setAnnotationsActions(list));
dispatch(reducerActions.setInitialized(true));
});
}
}, [initialized]);
dispatch(reducerActions.setVisible(true));
dispatch(reducerActions.updateFrameFrom(jobInstance.startFrame));
dispatch(reducerActions.updateFrameTo(jobInstance.stopFrame));
dispatch(reducerActions.updateTargetObjectState(defaultTargetObjectState ?? null));
});
}, []);

return (
<Modal
Expand Down Expand Up @@ -643,14 +632,23 @@ function AnnotationsActionsModalContent(props: Props): JSX.Element {

const MemoizedAnnotationsActionsModalContent = React.memo(AnnotationsActionsModalContent);

export function openAnnotationsActionModal(objectState?: ObjectState): void {
export function openAnnotationsActionModal({
defaultObjectState,
defaultAnnotationAction,
}: {
defaultObjectState?: ObjectState,
defaultAnnotationAction?: string,
} = {}): void {
window.document.dispatchEvent(new MouseEvent('mousedown', { bubbles: true }));

const div = window.document.createElement('div');
window.document.body.append(div);
const root = createRoot(div);
root.render(
<Provider store={componentStorage}>
<MemoizedAnnotationsActionsModalContent
targetObjectState={objectState}
targetObjectState={defaultObjectState}
defaultAnnotationAction={defaultAnnotationAction}
onClose={() => {
root.unmount();
div.remove();
Expand Down
Loading

0 comments on commit 5b7e2c2

Please sign in to comment.