Skip to content

Commit

Permalink
Merge branch 'refs/heads/develop' into dl/fix-invalid-tracks
Browse files Browse the repository at this point in the history
  • Loading branch information
Eldies committed Oct 23, 2024
2 parents 0c27398 + 6a26362 commit 13c559a
Show file tree
Hide file tree
Showing 53 changed files with 334 additions and 350 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,7 @@ RUN apt-get update && \
supervisor \
tzdata \
unrar \
wait-for-it \
&& ln -fs /usr/share/zoneinfo/${TZ} /etc/localtime && \
dpkg-reconfigure -f noninteractive tzdata && \
rm -rf /var/lib/apt/lists/* && \
Expand Down Expand Up @@ -192,7 +193,7 @@ RUN python -m pip uninstall -y pip
COPY cvat/nginx.conf /etc/nginx/nginx.conf
COPY --chown=${USER} components /tmp/components
COPY --chown=${USER} supervisord/ ${HOME}/supervisord
COPY --chown=${USER} wait-for-it.sh manage.py backend_entrypoint.sh wait_for_deps.sh ${HOME}/
COPY --chown=${USER} manage.py backend_entrypoint.sh wait_for_deps.sh ${HOME}/
COPY --chown=${USER} utils/ ${HOME}/utils
COPY --chown=${USER} cvat/ ${HOME}/cvat
COPY --chown=${USER} rqscheduler.py ${HOME}
Expand Down
4 changes: 2 additions & 2 deletions backend_entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ fail() {
}

wait_for_db() {
~/wait-for-it.sh "${CVAT_POSTGRES_HOST}:${CVAT_POSTGRES_PORT:-5432}" -t 0
wait-for-it "${CVAT_POSTGRES_HOST}:${CVAT_POSTGRES_PORT:-5432}" -t 0
}

cmd_bash() {
Expand All @@ -19,7 +19,7 @@ cmd_init() {
wait_for_db
~/manage.py migrate

~/wait-for-it.sh "${CVAT_REDIS_INMEM_HOST}:${CVAT_REDIS_INMEM_PORT:-6379}" -t 0
wait-for-it "${CVAT_REDIS_INMEM_HOST}:${CVAT_REDIS_INMEM_PORT:-6379}" -t 0
~/manage.py syncperiodicjobs
}

Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Added

- Access to /analytics can now be granted
(<https://github.com/cvat-ai/cvat/pull/8509>)
4 changes: 4 additions & 0 deletions changelog.d/20241022_114627_gui-u.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Fix Grafana container restart policy
(<https://github.com/cvat-ai/cvat/pull/8577>)
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
### Fixed

- Fixed some interface tooltips having 'undefined' shortcuts
(<https://github.com/cvat-ai/cvat/pull/8578>)
5 changes: 5 additions & 0 deletions changelog.d/20241022_191618_roman_fix_integer_dependencies.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
### Fixed

- Fixed a bug where an export RQ job being retried may break scheduling
of new jobs
(<https://github.com/cvat-ai/cvat/pull/8584>)
2 changes: 1 addition & 1 deletion cvat-core/src/annotations-collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1295,7 +1295,7 @@ export default class Collection {
const predicate = sign > 0 ? (frame) => frame <= frameTo : (frame) => frame >= frameTo;
const update = sign > 0 ? (frame) => frame + 1 : (frame) => frame - 1;

// if not looking for an emty frame nor frame with annotations, return the next frame
// if not looking for an empty frame nor frame with annotations, return the next frame
// check if deleted frames are allowed additionally
if (!annotationsFilters) {
let frame = frameFrom;
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/cloud-storage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ Object.defineProperties(CloudStorage.prototype.save, {
}
// update
if (typeof this.id !== 'undefined') {
// provider_type and recource should not change;
// provider_type and resource should not change;
// send to the server only the values that have changed
const initialData: SerializedCloudStorage = {};
if (this.displayName) {
Expand Down
4 changes: 2 additions & 2 deletions cvat-core/src/frames.ts
Original file line number Diff line number Diff line change
Expand Up @@ -683,7 +683,7 @@ export function getContextImage(jobID: number, frame: number): Promise<Record<st
// it might raise multiple server requests for context images
// if the promise was pending before and several requests came for the same frame
// all these requests will stuck on "finally"
// and when the promise fullfilled, it will run all the microtasks
// and when the promise is fulfilled, it will run all the microtasks
// since they all have the same request id, all they will perform in executor()
frameData.activeContextRequest.finally(() => setTimeout(checkAndExecute));
} else {
Expand Down Expand Up @@ -775,7 +775,7 @@ export async function getFrame(
// - getContextImage
// - getCachedChunks
// And from this idea we should call refreshJobCacheIfOutdated from each one
// Hovewer, following from the order, these methods are usually called
// However, following from the order, these methods are usually called
// it may lead to even more confusing behaviour
//
// Usually user first receives frame, then user receives ranges and finally user receives context images
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/object-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ export function findAngleDiff(rightAngle: number, leftAngle: number): number {
angleDiff = ((angleDiff + 180) % 360) - 180;
if (Math.abs(angleDiff) >= 180) {
// if the main arc is bigger than 180, go another arc
// to find it, just substract absolute value from 360 and inverse sign
// to find it, just subtract absolute value from 360 and inverse sign
angleDiff = 360 - Math.abs(angleDiff) * Math.sign(angleDiff) * -1;
}
return angleDiff;
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/requests-manager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ class RequestsManager {
const promise = new Promise<Request>((resolve, reject) => {
const timeoutCallback = async (): Promise<void> => {
// We make sure that no more than REQUESTS_COUNT requests are sent simultaneously
// If thats the case, we re-schedule the timeout
// If that's the case, we re-schedule the timeout
const timestamp = Date.now();
if (this.requestStack.length >= REQUESTS_COUNT) {
const timestampToCheck = this.requestStack[this.requestStack.length - 1];
Expand Down
2 changes: 1 addition & 1 deletion cvat-core/src/server-proxy.ts
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ function fetchAll(url, filter = {}): Promise<any> {
}
});

// removing possible dublicates
// removing possible duplicates
const obj = result.results.reduce((acc: Record<string, any>, item: any) => {
acc[item.id] = item;
return acc;
Expand Down
1 change: 1 addition & 0 deletions cvat-core/src/server-response-types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@ export interface SerializedUser {
last_login?: string;
date_joined?: string;
email_verification_required: boolean;
has_analytics_access: boolean;
}

interface SerializedStorage {
Expand Down
4 changes: 2 additions & 2 deletions cvat-core/src/session-implementation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -377,7 +377,7 @@ export function implementJob(Job: typeof JobClass): typeof JobClass {
}

if ('annotationsFilters' in searchParameters && 'generalFilters' in searchParameters) {
throw new ArgumentError('Both annotations filters and general fiters could not be used together');
throw new ArgumentError('Both annotations filters and general filters could not be used together');
}

if (!Number.isInteger(frameFrom) || !Number.isInteger(frameTo)) {
Expand Down Expand Up @@ -1046,7 +1046,7 @@ export function implementTask(Task: typeof TaskClass): typeof TaskClass {
}

if ('annotationsFilters' in searchParameters && 'generalFilters' in searchParameters) {
throw new ArgumentError('Both annotations filters and general fiters could not be used together');
throw new ArgumentError('Both annotations filters and general filters could not be used together');
}

if (!Number.isInteger(frameFrom) || !Number.isInteger(frameTo)) {
Expand Down
8 changes: 7 additions & 1 deletion cvat-core/src/user.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-2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT

Expand All @@ -18,6 +18,7 @@ export default class User {
public readonly isSuperuser: boolean;
public readonly isActive: boolean;
public readonly isVerified: boolean;
public readonly hasAnalyticsAccess: boolean;

constructor(initialData: SerializedUser) {
const data = {
Expand All @@ -33,6 +34,7 @@ export default class User {
is_superuser: null,
is_active: null,
email_verification_required: null,
has_analytics_access: null,
};

for (const property in data) {
Expand Down Expand Up @@ -80,6 +82,9 @@ export default class User {
isVerified: {
get: () => !data.email_verification_required,
},
hasAnalyticsAccess: {
get: () => data.has_analytics_access,
},
}),
);
}
Expand All @@ -98,6 +103,7 @@ export default class User {
is_superuser: this.isSuperuser,
is_active: this.isActive,
email_verification_required: this.isVerified,
has_analytics_access: this.hasAnalyticsAccess,
};
}
}
4 changes: 2 additions & 2 deletions cvat-data/src/ts/3rdparty/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,8 @@ These files are from the [Broadway.js](https://github.com/mbebenita/Broadway) re
Authors don't provide an npm package, so we need to store these components in our repository.
We use this dependency to decode video chunks from a server and split them to frames on client side.

We need to run this package in node environent (for example for debug, or for running unit tests).
But there aren't any ways to do that (even with syntetic environment, provided for example by the package ``browser-env``).
We need to run this package in node environment (for example for debug, or for running unit tests).
But there aren't any ways to do that (even with synthetic environment, provided for example by the package ``browser-env``).
For example there are issues with canvas using (webpack doesn't work with binary canvas package for node-js) and others.
So, we have solved to write patch file for this library.
It modifies source code a little to support our scenario of using.
Expand Down
2 changes: 1 addition & 1 deletion cvat-data/src/ts/unzip_imgs.worker.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ onmessage = (e) => {
.async('blob')
.then((fileData) => {
if (!errored) {
// do not need to read the rest of block if an error already occured
// do not need to read the rest of block if an error already occurred
if (dimension === dimension2D) {
createImageBitmap(fileData).then((img) => {
postMessage({
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/react_nginx.conf
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
server {
root /usr/share/nginx/html;

# Disable server signature to make it slighty harder for
# Disable server signature to make it slightly harder for
# attackers to find known vulnerabilities. See
# https://datatracker.ietf.org/doc/html/rfc9110#name-server
server_tokens off;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ function ObjectItemComponent(props: Props): JSX.Element {
propagateShortcut={normalizedKeyMap.PROPAGATE_OBJECT}
toBackgroundShortcut={normalizedKeyMap.TO_BACKGROUND}
toForegroundShortcut={normalizedKeyMap.TO_FOREGROUND}
removeShortcut={normalizedKeyMap.DELETE_OBJECT}
removeShortcut={normalizedKeyMap.DELETE_OBJECT_STANDARD_WORKSPACE}
changeColorShortcut={normalizedKeyMap.CHANGE_OBJECT_COLOR}
sliceShortcut={normalizedKeyMap.SWITCH_SLICE_MODE}
changeLabel={changeLabel}
Expand Down
2 changes: 1 addition & 1 deletion cvat-ui/src/components/header/header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -513,7 +513,7 @@ function HeaderComponent(props: Props): JSX.Element {
Models
</Button>
) : null}
{isAnalyticsPluginActive && user.isSuperuser ? (
{isAnalyticsPluginActive && user.hasAnalyticsAccess ? (
<Button
className={getButtonClassName('analytics', false)}
type='link'
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ function ObjectMapperComponent(props: Props): JSX.Element {
const [rightValue, setRightValue] = useState<object | null>(null);

const setMappingWrapper = (updated: Props['defaultMapping']): void => {
// if we prefer useEffect instead of this approch
// if we prefer useEffect instead of this approach
// component will be rerendered first with extras that depends on parent state
// these extras will use outdated information in this case
onUpdateMapping(updated);
Expand Down
14 changes: 5 additions & 9 deletions cvat-ui/src/components/quality-control/quality-control-page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import Result from 'antd/lib/result';

import {
Job, JobType, QualityReport, QualitySettings, Task,
TargetMetric, TaskValidationLayout, getCore, FramesMetaData,
TaskValidationLayout, getCore, FramesMetaData,
} from 'cvat-core-wrapper';
import CVATLoadingSpinner from 'components/common/loading-spinner';
import GoBackButton from 'components/common/go-back-button';
Expand All @@ -43,7 +43,6 @@ interface State {
qualitySettings: {
settings: QualitySettings | null;
fetching: boolean;
targetMetric: TargetMetric | null;
};
}

Expand Down Expand Up @@ -107,7 +106,6 @@ const reducer = (state: State, action: ActionUnion<typeof reducerActions>): Stat
qualitySettings: {
...state.qualitySettings,
settings: action.payload.qualitySettings,
targetMetric: action.payload.qualitySettings.targetMetric,
},
};
}
Expand Down Expand Up @@ -172,7 +170,6 @@ function QualityControlPage(): JSX.Element {
qualitySettings: {
settings: null,
fetching: false,
targetMetric: null,
},
});

Expand Down Expand Up @@ -331,7 +328,6 @@ function QualityControlPage(): JSX.Element {
qualitySettings: {
settings: qualitySettings,
fetching: qualitySettingsFetching,
targetMetric,
},
} = state;

Expand Down Expand Up @@ -372,18 +368,18 @@ function QualityControlPage(): JSX.Element {

const tabsItems: NonNullable<TabsProps['items']>[0][] = [];

if (targetMetric) {
if (qualitySettings) {
tabsItems.push({
key: 'overview',
label: 'Overview',
children: (
<QualityOverviewTab task={instance} targetMetric={targetMetric} />
<QualityOverviewTab task={instance} qualitySettings={qualitySettings} />
),
});
}

if (gtJobInstance && gtJobMeta) {
if (validationLayout) {
if (validationLayout && qualitySettings) {
tabsItems.push({
key: 'management',
label: 'Management',
Expand All @@ -393,9 +389,9 @@ function QualityControlPage(): JSX.Element {
gtJobId={gtJobInstance.id}
gtJobMeta={gtJobMeta}
validationLayout={validationLayout}
qualitySettings={qualitySettings}
onDeleteFrames={onDeleteFrames}
onRestoreFrames={onRestoreFrames}
fetching={fetching}
/>
),
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import { Key } from 'antd/lib/table/interface';
import Icon, { DeleteOutlined } from '@ant-design/icons';

import { RestoreIcon } from 'icons';
import { Task, FramesMetaData, TaskValidationLayout } from 'cvat-core-wrapper';
import {
Task, FramesMetaData, TaskValidationLayout, QualitySettings,
} from 'cvat-core-wrapper';
import CVATTooltip from 'components/common/cvat-tooltip';
import { sorter } from 'utils/quality';

Expand All @@ -23,6 +25,7 @@ interface Props {
gtJobId: number;
gtJobMeta: FramesMetaData;
validationLayout: TaskValidationLayout;
qualitySettings: QualitySettings;
onDeleteFrames: (frames: number[]) => void;
onRestoreFrames: (frames: number[]) => void;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@

import React from 'react';
import { Row, Col } from 'antd/es/grid';
import Spin from 'antd/lib/spin';

import { FramesMetaData, Task, TaskValidationLayout } from 'cvat-core-wrapper';
import {
FramesMetaData, QualitySettings,
Task, TaskValidationLayout,
} from 'cvat-core-wrapper';
import AllocationTable from './allocation-table';
import SummaryComponent from './summary';

Expand All @@ -15,14 +17,15 @@ interface Props {
gtJobId: number;
gtJobMeta: FramesMetaData;
validationLayout: TaskValidationLayout;
fetching: boolean;
qualitySettings: QualitySettings;
onDeleteFrames: (frames: number[]) => void;
onRestoreFrames: (frames: number[]) => void;
}

function QualityManagementTab(props: Readonly<Props>): JSX.Element {
const {
task, gtJobId, gtJobMeta, fetching, validationLayout,
task, gtJobId, gtJobMeta,
validationLayout, qualitySettings,
onDeleteFrames, onRestoreFrames,
} = props;

Expand All @@ -32,13 +35,6 @@ function QualityManagementTab(props: Readonly<Props>): JSX.Element {

return (
<div className='cvat-quality-control-management-tab'>
{
fetching && (
<div className='cvat-spinner-container'>
<Spin className='cvat-spinner' />
</div>
)
}
<Row>
<Col span={24}>
<SummaryComponent
Expand All @@ -56,6 +52,7 @@ function QualityManagementTab(props: Readonly<Props>): JSX.Element {
gtJobId={gtJobId}
gtJobMeta={gtJobMeta}
validationLayout={validationLayout}
qualitySettings={qualitySettings}
onDeleteFrames={onDeleteFrames}
onRestoreFrames={onRestoreFrames}
/>
Expand Down
Loading

0 comments on commit 13c559a

Please sign in to comment.