sha256 stringlengths 64 64 | language stringclasses 27
values | size int32 1 491k | lines int32 1 21.8k | content stringlengths 1 200k |
|---|---|---|---|---|
1fdf0214cd66cd808d0925d3dfca609ea6dc20f20bf3c3fd21a6e0cf85c420eb | TypeScript | 367 | 25 | enum Type {
Bool = "bool",
}
type Argument = {
name: string;
default?: string | number;
description: string;
required?: boolean;
type?: Type;
};
type Group = {
name: string;
description: string;
arguments: Array<Argument>;
};
type Command = {
name: string;
groups: Array<Group>;
};
export type ... |
8074e1aebdfcbe2c5be87ebc4111ef67cd7ea7c6364a3756b8e0bb70127a9f0d | TypeScript | 371 | 16 | import { fileURLToPath, URL } from "url";
import { defineConfig } from "vite";
import vue from "@vitejs/plugin-vue";
import vueJsx from "@vitejs/plugin-vue-jsx";
// https://vitejs.dev/config/
export default defineConfig({
plugins: [vue(), vueJsx()],
resolve: {
alias: {
"@": fileURLToPath(new URL("./src"... |
fb7d53d0ffcfead7150daf7e2d6ea8a5e3c2f050edc46ed0b103bcdc21c3bcb6 | TypeScript | 396 | 20 |
/**
* An interface for vectors contained in the embedding that is being visualized by the embedding visualizer.
*/
export interface EmbeddingVector {
// #region Properties
/**
* Contains the value of the data point.
*/
value: number[];
/**
* Contains the index of the cluster to whic... |
669713607b4e2d85a9e3b8c1bf1de22a0cbbdd26f35d1577965627446cc19257 | TypeScript | 435 | 17 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { getCore, Task } from 'cvat-core-wrapper';
const core = getCore();
export async function fetchTask(id: number): Promise<Task> {
let taskInstance = null;
try {
[taskInstance] = await core.tasks.get({ id });
} catch (_e... |
e618ddbdf6d481155786e761fee977d352f34464a557c8659d717d63fa67a930 | TypeScript | 438 | 21 | import type { Config } from "tailwindcss";
const config: Config = {
content: [
"./pages/**/*.{js,ts,jsx,tsx,mdx}",
"./components/**/*.{js,ts,jsx,tsx,mdx}",
"./app/**/*.{js,ts,jsx,tsx,mdx}",
],
theme: {
extend: {
colors: {
background: "var(--background)",
foreground: "var(--f... |
75b36b5ca77fa86ca0e2410a6cf27fb9a590d39fcee6a4265542faa40dd9fb5a | TypeScript | 453 | 17 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ActionUnion, createAction } from 'utils/redux';
export enum NavigationActionTypes {
CHANGE_LOCATION = 'CHANGE_LOCATION',
}
export const navigationActions = {
changeLocation: (from: string, to: string) => createAction(
Na... |
a3252d2db025405dcc372146b5c6ac060e247c48cf76314f68088d0a90372194 | TypeScript | 458 | 25 |
/**
* Represents a single cluster of embedding vectors.
*/
export interface Cluster {
// #region Properties
/**
* Contains the index of the cluster.
*/
index: number;
/**
* Contains the hex color of the cluster in the embedding visualizer and the clustering selection pane.
*/
... |
cdaf444667eff1f45a728ba632633c6ce1793eafb9bfdeecc672b43fe8f55b0a | TypeScript | 480 | 19 |
export enum AttributionImageMode {
/**
* The image of the dataset sample corresponding to the attribution is retrieved.
*/
Input = 'input',
/**
* The image of the dataset sample corresponding to the attribution is retrieved as black and white image with the heatmap of the attribution
... |
2fb70b595154df5915b4e60069f8806f17dc2e02b69298407e79a7771c96c1b4 | TypeScript | 488 | 20 | // Copyright (C) 2021-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import {
Canvas3d,
MouseInteraction,
ViewType,
CameraAction,
ViewsDOM,
CanvasMode,
} from 'cvat-canvas3d/src/typescript/canvas3d';
import { OrientationVisibility } from 'cvat-can... |
079bb28e41ab1c33ab2b2b95301bb8714f613016e439969f959c4e1e82412c5b | TypeScript | 533 | 18 | // Copyright (C) 2025 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
export function dispatchContextMenuEvent(element: HTMLElement, clickEvent: React.MouseEvent): void {
setTimeout(() => {
clickEvent.preventDefault();
element.dispatchEvent(
new MouseEvent('contextmenu', {
... |
9ff3fd901f08cda39605278ab800ac5379a393166ebaf1f8253cf9d91829661d | TypeScript | 538 | 22 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
export function ensureError(error: unknown): Error {
if (error instanceof Error) {
return error;
}
if (typeof error === 'string') {
return new Error(error);
}
if (error && typeof error === 'object') {
... |
a4cbfe771056c58cd90c793d289473607bcef8fdcb938423658e24a6c52402e0 | TypeScript | 544 | 25 |
import {Attribution} from '@services/attributions/attribution';
/**
* Represents the attribution of an embedding vector.
*/
export interface EmbeddingVectorAttribution {
// #region Properties
/**
* Contains the attribution of the embedding vector.
*/
attribution: Attribution;
/**
*... |
38890064d084b63bdf4e3adae7c2ffef860050f613218908c15337851ae6ad3a | TypeScript | 560 | 23 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import * as THREE from 'three';
function getCircleTexture(size: number): THREE.CanvasTexture<OffscreenCanvas> {
const canvas = new OffscreenCanvas(size, size);
const ctx = canvas.getContext('2d');
if (ctx) {
ctx.fillStyle = '... |
0c5b87b08e6d40ae0a4ffeb28b8926036198bec05342d8e4d15f7652c99365f3 | TypeScript | 569 | 28 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import { AnyAction } from 'redux';
export enum NotificationsActionType {
RESET_ERRORS = 'RESET_ERRORS',
RESET_MESSAGES = 'RESET_MESSAGES',
}
export function resetErrors(): AnyAction {
const action = {
type: Notificati... |
1101fee3396eb9fd59df36ae3ada484f4bf4b2ad268996ae199793e7785fea2c | TypeScript | 590 | 20 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import type { SerializedShape } from '../server-response-types';
import { Shape } from './shape';
import type { AnnotationInjection } from './types';
export class PolyShape extends Shape {
construc... |
ca73e4f9537b675220561f725cda4754ae4bb9220b0f47581e0774b5fbd07c3c | TypeScript | 594 | 23 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
export async function toClipboard(text: string): Promise<boolean> {
const fallback = (): boolean => {
// eslint-disable-next-line
window.prompt('Browser Clipboard API not allowed, please copy manually', text);
return fa... |
038924d2983ce004085f0b9290a4f9f492cc9f0995983ea6951ce27d7fa8dd84 | TypeScript | 605 | 24 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { getCore, ProjectOrTaskOrJob } from 'cvat-core-wrapper';
import { RequestInstanceType } from './requests-actions';
const core = getCore();
export function getInstanceType(instance: ProjectOrTaskOrJob | RequestInstanceType): 'project' | '... |
0d0c10955d5af15411f81c4bdc05d1f0815ea13d6df23b1cd5b2b74cd0ebdf05 | TypeScript | 605 | 21 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { Indexable } from 'reducers';
export type NonNullableProperties<T> = {
[K in keyof T]: NonNullable<T[K]>;
};
export function filterNull<Type>(obj: Type): NonNullableProperties<Type> {
const filteredObject = { ...obj };
if (fi... |
cdbe4d45e6175511ae77628e40600feced8eabf811f58df6b094436a9a244902 | TypeScript | 635 | 17 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import type { Region } from 'wavesurfer.js/dist/plugins/regions';
import type RegionsPlugin from 'wavesurfer.js/dist/plugins/regions';
import { clientIDFromWaveRegionId } from './audio-interval';
export function getIntervalRegionsByClientID(regi... |
aa82533a32a0880fa3cce0071e87a86aab94dcb21e29fdf6da26ed4997bb3a62 | TypeScript | 646 | 26 | // Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
export interface Point {
x: number;
y: number;
}
export function clamp(value: number, min: number, max: number): number {
return Math.min(Math.max(value, min), max);
}
export function numb... |
c904543b4c6f7afc0364a9f7a504592e22311d4ce31f3932c338e9cc5c37a3d4 | TypeScript | 648 | 29 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
const config = {
backendAPI: '/api',
organization: {
organizationID: null,
organizationSlug: null,
},
origin: '',
uploadChunkSize: 100,
opencvPath: '',
remove... |
6fa79454bd44e1373354858733b219b686651052b9de8126207c1e0ec5f8583d | TypeScript | 656 | 30 | // Copyright (C) 2019-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
export interface Master {
subscribe(listener: Listener): void;
notify(reason: string): void;
}
export interface Listener {
notify(master: Master, reason: string): void;
}
export class MasterImpl implements Master {
privat... |
daacc7584c905b8ba7623ce00d31f720bda21b3ed1f4f1c0c3d23669521dfe15 | TypeScript | 670 | 20 | // ***********************************************************
// This example support/index.js is processed and
// loaded automatically before your test files.
//
// This is a great place to put global configuration and
// behavior that modifies Cypress.
//
// You can change the location of this file or turn off
// au... |
e0ba9fc5ffb6adfedfab8679df6fe2579f3bfc493131179d3e8afbbf6ff1d83a | TypeScript | 671 | 20 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
export function computeTextColor(backgroundHex: string): string {
let textColor = '#ffffff';
try {
// convert color to grayscale and from the result get better text color
// (for darken background -> lighter text, etc.)
... |
9a45848fb7e70fbe3804e1c6b5baa915a585ae1583bc4b7fdc16a11eb1c0779d | TypeScript | 677 | 20 |
export enum ImageSamplingMode {
/**
* The sampling mode for the dataset samples and the attributions is automatically determined based on the image size and the size of the image
* element displaying the image.
*/
Automatic = 'automatic',
/**
* The sampling mode for the dataset sample... |
7a84693c1e86b7e3ee710f013460e3fa54446f5ec8e3f749ae5c2a087c41b423 | TypeScript | 684 | 23 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { Indexable } from 'reducers';
import { filterNull } from './filter-null';
export function authQuery(queryParams: URLSearchParams): Record<string, string> | null {
const updatedQuery: Record<string, string | null> = {
email: nu... |
b5eeaf3e74033586a95e45230cb1e5d6af11d6e1ee8b04aa6a5333e7daff8b67 | TypeScript | 717 | 19 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
function updateParts(element: Element, update: (parts: Set<string>) => void): void {
const parts = new Set(element.getAttribute('part')?.split(' ').filter(Boolean));
update(parts);
element.setAttribute('part', [...parts].join(' '));
}
... |
101afcff929c2cbc026392b301f4a10f183c1242b2888b7e202d725d4941d525 | TypeScript | 742 | 24 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { SerializedAPISchema } from './server-response-types';
import serverProxy from './server-proxy';
let schemaCache: SerializedAPISchema | null = null;
export async function getServerAPISchema(): Promise<SerializedAPISchema> {
if (schem... |
4c8bd4a5709a2da683b3d5aae599f829ef233dc0d4dc75f83c42d830b6470e8d | TypeScript | 750 | 22 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
export function clamp(value: number, min: number, max: number): number {
return Math.max(Math.min(value, max), min);
}
export function shift<T>(array: Array<T>, k: number): Array<T> {
if (k % array.length !== 0) {
return a... |
8d4cea9aa21165687cb51259f22477a6faebbc2b9b37f84b805defa564023faf | TypeScript | 755 | 37 |
import { InjectionToken } from '@angular/core';
/**
* Represents the configuration of the application.
*/
export interface Configuration {
/**
* Indicates whether the application is running in production mode.
*/
production: boolean,
/**
* The base URL of the ViRelAy backend REST API.
... |
2a6d8115d266ec9a7c6800a32c5533312f04f348f63ecbd3f082eeeee58c80a7 | TypeScript | 766 | 26 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { BaseImageFilter } from 'cvat-core-wrapper';
export default class FabricFilter extends BaseImageFilter {
public processImage(src: ImageData, frameNumber: number): ImageData {
if (this.filter) {
const dataCopy = new... |
93bcb799065c0850554931bd7cf17bfe1ff817172af2aa2888f1012ee778459f | TypeScript | 768 | 23 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { getFileContentType } from 'utils/files';
function getUrlExtension(url: string): string {
return (url.split(/[#?]/)[0].split('.').pop()?.trim() || '').toLowerCase();
}
const AUDIO_EXTENSIONS = ['aac', 'aif', 'aifc', 'aiff', 'amr', 'a... |
d7028dd13e21addf45dd08402bec13aa0ae208797820dd547ed4d0156419b617 | TypeScript | 777 | 37 |
import { InjectionToken } from '@angular/core';
/**
* Represents the configuration of the application.
*/
export interface Configuration {
/**
* Indicates whether the application is running in production mode.
*/
production: boolean,
/**
* The base URL of the ViRelAy backend REST API.
... |
9af86ad3a46ee3fbba7093e64a8f655c0f3b88aef30d0ffe532b6c510427e507 | TypeScript | 833 | 28 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
// Audio data is deliberately kept outside Redux: Redux holds only its token, so
// serialization cannot retain or copy the decoded PCM samples or waveform peaks.
export interface CachedAudioData {
audioBuffer: AudioBuffer;
peaks: Float32A... |
5487923ceb34857fda0d367402d3bc9fdb467e7bb67b94894708ffc0e2e99745 | TypeScript | 834 | 28 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import dayjs from 'dayjs';
import advancedFormat from 'dayjs/plugin/advancedFormat';
import customParseFormat from 'dayjs/plugin/customParseFormat';
import localeData from 'dayjs/plugin/localeData';
import relativeTime from 'dayjs/plugin/relative... |
06d57a7686b0d083bf21ec28ed2c386e9310f7f67802eba512dac8ab2dbcbf45 | TypeScript | 848 | 18 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
export { default as QualityConflict, AnnotationConflict, ConflictSeverity } from './quality-conflict';
export { default as QualityReport } from './quality-report';
export type {
QualitySummary, QualityReportScoreComponents, QualityReportRequir... |
2ab79b0e52a72dcc825d51c95c4e62e9c4aec65d84f0c3a38523a5f7baa4b75a | TypeScript | 851 | 26 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { AudioIntervalState } from 'cvat-core-wrapper';
import { MIN_INTERVAL_DURATION } from './waveform-geometry';
export function isAudioIntervalWithinSplitRange(
interval: AudioIntervalState,
duration: number,
playbackPosition: n... |
64b240c7e709824cf66b2b4e848997fc5c4a335aa5f1b52a8386f6b3e9ea8e87 | TypeScript | 893 | 23 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ShapeType } from '../enums';
import type { SerializedTrack } from '../server-response-types';
import { checkNumberOfPoints } from '../object-utils';
import type { AnnotationInjection } from './... |
c1ce812e962406a200cb0d210ffb0894df31d19f8dfa584fb94561671abd500d | TypeScript | 894 | 41 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { SerializedAbout } from './server-response-types';
export default class AboutData {
#description: string;
#name: string;
#version: string;
#logoURL: string;
#subtitle: string;
constructor(initialData: SerializedAb... |
3d1fcb9932ebbe3ebfef56476dc1d0b4169014f382ecc6b4450da01cbef729fc | TypeScript | 900 | 25 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import Axios from 'axios';
import axiosRetry from 'axios-retry';
Axios.defaults.withCredentials = true;
Axios.defaults.xsrfHeaderName = 'X-CSRFTOKEN';
Axios.defaults.xsrfCookieName = 'csrftoken';
axiosRetry(Axios, {
retryCondition: (error) =... |
d075bd06a32700b9f81f7a9b8d3dcc52fc85ec96cab60f3659b0f51bb12c833b | TypeScript | 901 | 31 | import { createRouter, createWebHashHistory } from "vue-router";
import HomeView from "../views/PACEView.vue";
const router = createRouter({
history: createWebHashHistory(import.meta.env.BASE_URL),
routes: [
{
path: "/",
name: "home",
component: HomeView,
},
{
path: "/classic",
... |
5d9701b9159cd8e7861b2ae542b3619222fb2519f0ef6c3464fb317977d698c5 | TypeScript | 919 | 33 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
export interface SerializedImageFilter {
alias: string;
params: object;
}
export interface ImageProcessing {
filter: any;
currentProcessedImage: number | null;
processImage: (src: ImageData, frameNumber: number) => ImageData;... |
097a7ebea2427a748af5a1ac5bdb39677149bcafaaca67b24012726c09e7d5df | TypeScript | 943 | 35 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
const FALLBACK_HEX = 'ffffff';
function normalizeHex(hex: string): string {
let clean = hex.replace('#', '');
if (clean.length === 3) {
clean = clean.split('').map((ch) => ch + ch).join('');
}
if (!/^([0-9a-f]{6})$/i.test(... |
a4adf5f19aef49af7c181cb72f3108a9dae3fb0071e167e338b347923d547fc1 | TypeScript | 944 | 26 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
const STYLE_ID = 'cvat-scrollbar-style';
const SCROLLBAR_CSS = `
.scroll { overflow-x: scroll !important; }
.scroll::-webkit-scrollbar { height: 12px; }
.scroll::-webkit-scrollbar-button { display: none; }
.scroll::-webkit-scrollb... |
4e6064abd2ab431c7a60093ca307086a4056e3e6ea37a442c8bf989eae9b50b8 | TypeScript | 949 | 30 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import type { AnnotationContext } from './annotation-context';
import type { Constructor } from './types';
type AnnotationContextConstructor = Constructor<AnnotationContext>;
export type Scored = {
score: number;
votes: number;
};
expor... |
4fee1b78d9b2147b2f13072dfaa34edfcea613b7b9d05e5a3c12b4002cc92f1f | TypeScript | 960 | 25 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
type CamelizeString<T extends PropertyKey, C extends string = ''> =
T extends string ? string extends T ? string :
T extends `${infer F}_${infer R}` ?
CamelizeString<Capitalize<R>, `${C}${F}`> : (T extends 'Id' ? `${C}${'ID... |
4a3e5c1a522857e24936be08089fd9dae224d268dbf73bebc6c5cd3d4b97d479 | TypeScript | 971 | 46 |
/**
* An enumeration for the different states that the loading, creation, updating, or deletion of a resource can be in.
*/
export enum ResourceState {
/**
* The resource hasn't been loaded, created, updated, or deleted yet.
*/
Pending = 'pending',
/**
* The resource is currently being l... |
cab43e16e3a8e113fdec7e19a5033f81b5babc934c6b0c9e9bd2a96c39ccfc83 | TypeScript | 995 | 30 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import _ from 'lodash';
import { Config } from '@react-awesome-query-builder/antd';
import { config as jobPageFilterConfig } from 'components/jobs-page/jobs-filter-configuration';
export const config: Partial<Config> = {
fields: {
...... |
782da31aa7444eaa93e99ef2b0ad66d3cbcaace8aea06d27b2cd74e33360a11e | TypeScript | 1,004 | 36 | // Copyright (C) 2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import './styles.scss';
import { Indexable } from 'reducers';
import SortingComponent from './sorting';
import ResourceFilterHOC from './filtering';
import { ResourceSelectionInfo } from './resource-selection-info';
const defaultVisibility = {... |
4e8e03826eaa11953025464e35d11b6ffb2af3ec25540e66a53274079134646e | TypeScript | 1,012 | 33 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
/* eslint-disable no-restricted-globals */
import { createOpenCVInterface } from './opencv/opencv-interface';
import type { OpenCVInterface } from './opencv/opencv-interface';
export function initializeOpenCVInWorker(opencvPath: string): Promise... |
9419c1c27a7045dee89e7083cd36292829b59716b26784c66c2fb01b40cf18ae | TypeScript | 1,027 | 24 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { SelectedResourceType } from 'reducers';
import { ActionUnion, createAction } from 'utils/redux';
export enum SelectionActionsTypes {
DESELECT_RESOURCES = 'DESELECT_RESOURCES',
SELECT_RESOURCES = 'SELECT_RESOURCES',
CLEAR_SELE... |
f6724522bce395a8a110708e544d45be447007c84d4d272b1ca698568c8a50df | TypeScript | 1,034 | 44 | // Copyright (C) 2021-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
export interface Master {
subscribe(listener: Listener): void;
unsubscribe(listener: Listener): void;
unsubscribeAll(): void;
notify(reason: string): void;
}
export interface Listener {
notify(master: Master, reason: s... |
3d61f177a4f24ed61a7384e4872331e453afe8c26f458922cc1d2284930fb3d3 | TypeScript | 1,043 | 39 |
import * as THREE from 'three';
import { EmbeddingVector } from '@components/embedding-visualizer/embedding-vector';
/**
* An event that is triggered when the user hovers an embedding vector in the embedding visualizer.
*/
export class HoverEvent {
// #region Constructor
/**
* Initializes a new Hove... |
1660e229f6a1201ec20e5563659384b96f0eab7231381b028ac23e1ba0cf3151 | TypeScript | 1,061 | 33 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import { ActionUnion, createAction, ThunkAction } from 'utils/redux';
import { AboutData, getCore } from 'cvat-core-wrapper';
const core = getCore();
export enum AboutActionTypes {
GET_ABOUT = 'GET_ABOUT',
GET_ABOUT_SUCCESS = 'GE... |
be866f0c56d558e537875ef7f929d1445ea13c30b11db6cae13da6c3d14e2119 | TypeScript | 1,084 | 38 |
import { Component, Input } from "@angular/core";
import { ClarityModule } from "@clr/angular";
/**
* A component that renders an error message. The error message is displayed in an alert box with red color.
*/
@Component({
selector: 'virelay-error-message',
templateUrl: 'error-message.component.html',
... |
ffe0685f63adbf8eb1fd0d941e1ab9d42e93579fe7882eaca2ac4bda0f252056 | TypeScript | 1,086 | 35 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { Canvas, RectDrawingMethod } from 'cvat-canvas-wrapper';
import { Canvas3d } from 'cvat-canvas3d-wrapper';
import { ActiveControl } from 'reducers';
export function finishDrawAvailable(
activeControl: ActiveControl,
rectDrawingMet... |
ce67c2f6a6909102c66e20cd0957d893127cf84e72c40519012e8a5e9fd54db6 | TypeScript | 1,087 | 32 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { Label, ObjectState, LabelType } from 'cvat-core-wrapper';
export function filterApplicableForType(type: LabelType, labels: Label[]): Label[] {
const applicableLabels = labels.filter((label: Label) => (
[type, 'any'].includes(... |
21145c7ba07f704c246c5622646cae278244af2fd1a9bbcb7d26875d1d59e643 | TypeScript | 1,090 | 32 | // Copyright (C) 2021-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { getCVATStore } from 'cvat-store';
import { CombinedState } from 'reducers';
export default function isAbleToChangeFrame(frame?: number): boolean {
const store = getCVATStore();
const ... |
6321e8b3f724ebeb30e08b3b9f44fda9965a3d74babcab009734ce4f51ac5247 | TypeScript | 1,093 | 41 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { BaseShapesAction, ShapesActionInput, ShapesActionOutput } from './base-shapes-action';
import { ActionParameters } from './base-action';
export class RemoveFilteredShapes extends BaseShapesAction {
public async init(): Promise<void> ... |
55aad0efff58d90d92fd03d475decc5c6f40b6be7a55d75fabfc4bebee025ca4 | TypeScript | 1,101 | 43 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { NavigationActions, NavigationActionTypes } from 'actions/navigation-actions';
import config from 'config';
import { NavigationState } from '.';
const defaultState: NavigationState = {
prevLocation: null,
};
export default function (... |
6ced60db56651eda7d8a9a2232d2838a1ef6bc126c90919fb33dccc368c0fd5c | TypeScript | 1,109 | 42 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { BulkActionsState } from 'reducers';
import {
BulkActionsTypes,
BulkActions,
} from '../actions/bulk-actions';
const initialState: BulkActionsState = {
fetching: false,
status: null,
cancelled: false,
};
export defaul... |
3202f9b40440ff2b0373df50fbb0966ba754b0213c9978842252c6d2d6461afc | TypeScript | 1,154 | 41 | import { ObjectState } from 'cvat-core-wrapper';
import { ColorBy } from 'reducers';
export function getObjectStateColor(state: ObjectState, colorBy: ColorBy): {
hex: string;
rgbComponents: () => string;
} {
let color = '';
try {
if (colorBy === ColorBy.INSTANCE) {
color = state.col... |
02c67796835c9898a8f36bad6fb588e385818de5af7692c1286d8c6bcb485bac | TypeScript | 1,176 | 51 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
type ImageObjectStat = Readonly<{
track: number;
shape: number;
}>;
type IntervalStat = Readonly<{
count: number;
duration: number;
coverage: number;
}>;
type Stats = Readonly<{
... |
a6acaa5895266583c49c312c92ba0c2a6d73e40cb1098e2d34060d97017d2bef | TypeScript | 1,229 | 28 | // Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { Action, ActionCreatorsMapObject, AnyAction } from 'redux';
import { shallowEqual } from 'react-redux';
import { ThunkAction as _ThunkAction, ThunkDispatch as _ThunkDispatch } from 'redux-thunk'... |
c8db7c6ee0d30a110ee00bb32d3be7fa3bff7187fe40650943b64d2158eadc62 | TypeScript | 1,258 | 41 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import { ActionUnion, createAction, ThunkAction } from 'utils/redux';
import { getCore } from 'cvat-core-wrapper';
const cvat = getCore();
export enum FormatsActionTypes {
GET_FORMATS = 'GET_FORMATS',
GET_FORMATS_SUCCESS = 'GET_F... |
2d7594074feeed89edfbf5064ad3a766e07297a725fe458348a9b3e25174bc7b | TypeScript | 1,285 | 41 | import { ObjectState } from 'cvat-core-wrapper';
export const OBJECTS_SIDEBAR_EXPAND_Z_LAYER_EVENT = 'cvat.objects-sidebar.expand-z-layer';
export const OBJECTS_SIDEBAR_OPEN_Z_LAYER_EVENT = 'cvat.objects-sidebar.open-z-layer';
function getSidebarItemId(state: ObjectState): string {
const { clientID, parentID } = ... |
ad422ee013268dbb34ed283f936807e662ed2dbafc8c6182c41f702cba361875 | TypeScript | 1,287 | 39 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ShapeType } from '../enums';
import type { SerializedShape } from '../server-response-types';
import { checkNumberOfPoints } from '../object-utils';
import type { AnnotationInjection } from './... |
749f31881eaa13054da1c7d153772de3c54bf093046874f1db24abf2396934aa | TypeScript | 1,303 | 34 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ShapeType } from '../enums';
import type { SerializedShape } from '../server-response-types';
import { checkNumberOfPoints, rotatePoint } from '../object-utils';
import { Shape } from './shape'... |
204481014d561c784cf9daa092e693044652a86a54da7c7038917081dadd7e10 | TypeScript | 1,315 | 37 | /// <reference types="cypress" />
// ***********************************************
// This example commands.ts shows you how to
// create various custom commands and overwrite
// existing commands.
//
// For more comprehensive examples of custom
// commands please read more here:
// https://on.cypress.io/custom-comma... |
8a86702822d282f2b60c09f1b2c1d6919ff1c2fb10f12f118d44dfe4aaacf8c0 | TypeScript | 1,319 | 41 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import Modal from 'antd/lib/modal';
import { Organization, Project, Task } from 'cvat-core-wrapper';
export function confirmTransferModal(
instances: Project[] | Task[],
activeWorkspace: Organization | null,
dstWorkspace: Organizatio... |
7e8837be441fc1ebfaa0df47d3ba29dc5b50ccdb0efb7ec03f756a611b88adb9 | TypeScript | 1,325 | 50 | // Copyright (C) 2021-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
const BASE_GRID_WIDTH = 2;
const MOVEMENT_FACTOR = 200;
const DOLLY_FACTOR = 5;
const MAX_DISTANCE = 100;
const MIN_DISTANCE = 0.3;
const ORTHO_FRUSTUM_HEIGHT = 1;
const ROTATION_HELPER_OFFSET = 0.75;
c... |
25afa362c3327949ecbec52649fe51cf534e17ae43166f8e7e0e5dd32ca09d53 | TypeScript | 1,329 | 37 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ActionUnion, createAction, ThunkAction } from 'utils/redux';
import { getCore, SerializedAPISchema } from 'cvat-core-wrapper';
const core = getCore();
export enum ServerAPIActionTypes {
GET_SERVER_API_SCHEMA = 'GET_SERVER_API_SCHEMA... |
3f4260f25c291b29999cd8c2fe8746a42535fb0b415511dcf4f66473711b9096 | TypeScript | 1,337 | 38 | // Copyright (C) 2026 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ObjectState, ShapeType } from 'cvat-core-wrapper';
export type OrientationAngle = -90 | 90 | 180;
export default function changeObjectOrientation(objectState: ObjectState, degrees: OrientationAngle): boolean {
const state = obj... |
9eb496d5f7ff4ffebda3b39908fba085696c5f28cd42cb1de5919e55632fcc76 | TypeScript | 1,353 | 42 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { AudioWaveform } from './use-audio-waveform';
import { IntervalNavigation, useIntervalNavigation } from './use-interval-navigation';
import { useAudioRecording } from './use-audio-recording';
import { useIntervalPlayback } from './use-inte... |
8e6a1e7d8b3c32a1e39556adbb187e112745445acd7d1ebc048fddec398e487c | TypeScript | 1,363 | 58 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { StorageLocation } from './enums';
export interface StorageData {
location: StorageLocation;
cloudStorageId?: number;
}
interface StorageJsonData {
location: StorageLocation;
cloud_storage_id?: number;
}
export class Sto... |
8168e6a1d9c5330685780a9bd1fc54eef4b4579ab84cfc8a633cd7f10e07048d | TypeScript | 1,369 | 31 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import type { AnnotationInjection } from './types';
// Stores shared annotation infrastructure injected by the collection.
// It intentionally has no behavior so derived classes can access context without owning object state.
export class Annotat... |
2875552c472dc7001fb32398a854e2cb98dae7586c7344415c328026f519151e | TypeScript | 1,386 | 51 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { fabric } from 'fabric';
import { SerializedImageFilter } from 'cvat-core-wrapper';
import { ImageFilterAlias } from 'utils/image-processing';
import FabricFilter from './fabric-wrapper';
export interface GammaFilterOptions {
gamma: n... |
07ca105c77c38bc49631ebaff761ed09f354cc384325d3b6b58bf57aeea32f86 | TypeScript | 1,412 | 38 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import { ActionUnion, createAction, ThunkAction } from 'utils/redux';
import { getCore } from 'cvat-core-wrapper';
import { UserAgreement } from 'reducers';
const core = getCore();
export enum UserAgreementsActionTypes {
GET_USER_AGR... |
2a6b7d54853edd9ab98c229e80f97ddb9e87471494ad543140c23c959f31049d | TypeScript | 1,414 | 39 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import {
QualityMetric,
QualityMetricAggregation,
QualityRequirementMetric,
} from './server-response-types';
export interface QualityTargetMetric {
metric: QualityMetric;
aggregation: QualityMetricAggregation;
}
export funct... |
77cde5621e7df41de6fe92ce68c2f1fb7a321341023c5a0da4797a89161fc46b | TypeScript | 1,426 | 44 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import config from 'config';
export function readLatestFrameStorage(): Map<number, number> {
let latestFrameStorage: [number, number][] = [];
try {
latestFrameStorage = JSON.parse(localStorage.getItem('latestFrameStorage') || '[]'... |
0aa2b23038a7a242c4146b8a78431273ded6a33879d365a7541e955e8a0de5ce | TypeScript | 1,440 | 61 | import type { Argument, Command, Group } from "./model";
function parseCommand(help: string, name: string): Command {
const cmd = { name, groups: [] } as Command;
const arr = help.split("\n");
let currGrp;
for (let i = 0; i < arr.length; i++) {
let content = arr[i];
content = content.trim();
if (co... |
1a413b6da17d5ae9c453a313fc1b0e6478f8972c9c817ee25f7c4cf4396946d9 | TypeScript | 1,442 | 68 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import {
LabelType, ModelKind, RQStatus, ShapeType,
} from './enums';
export interface ModelAttribute {
name: string;
values: string[];
input_type: 'select' | 'number' | 'checkbox' | 'radio' | 'text';
}
export interface ModelPara... |
607fa84acaab9cb7ea16e0bb2996c0a470f11aaceefacb0114c08bcf04696846 | TypeScript | 1,445 | 46 | // Copyright (C) 2024 CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { RuleObject } from 'antd/lib/form';
// eslint-disable-next-line import/no-extraneous-dependencies
import { ValidateErrorEntity } from 'rc-field-form/lib/interface';
export const isInteger = ({ min, max, filter }: {
min?: number;
... |
3b2ec9e236717c1ecd939d88874f07442c92050d523370923976840f12062384 | TypeScript | 1,457 | 49 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import { BoundariesActions, BoundariesActionTypes } from 'actions/boundaries-actions';
import { FormatsActionTypes, FormatsActions } from 'actions/formats-actions';
import { AuthActionTypes, AuthActions } from 'actions/auth-actions';
impo... |
ddf2f077d5f0419a242d71597d464ad280dd9bfe4a200f145134929930f67ce5 | TypeScript | 1,470 | 48 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import {
Canvas,
CanvasMode,
CanvasHistorySource,
RectDrawingMethod,
CuboidDrawingMethod,
finalizePastedShapePoints,
CanvasHint as _CanvasHint,
InteractionData as _InteractionData,
InteractionResult as _... |
43b91ce31d13de827920326688a2088eadcc5553c59b50aa7669ef3123b50bc6 | TypeScript | 1,471 | 44 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { Config } from '@react-awesome-query-builder/antd';
import asyncFetchUsers from 'components/resource-sorting-filtering/request-users';
export const config: Partial<Config> = {
fields: {
user: {
label: 'User',
... |
f06a59ae6af527feebe99a9c1dd95fa290d08007855797aa2aeaf3921f568523 | TypeScript | 1,495 | 50 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { HistoryActions } from '../enums';
import type { AnnotationBase } from './annotation-common';
import type { Constructor } from './types';
type AnnotationBaseConstructor = Constructor<AnnotationBase>;
interface Pinnable {
pinned: boole... |
656e100e6191fbc41aee59d0ced20cbfd39e8ab9cd27c6242b348683a27421e6 | TypeScript | 1,507 | 39 | // Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { getCVATStore } from 'cvat-store';
import { KeyMapItem } from 'utils/mousetrap-react';
import { ActionUnion, createAction } from 'utils/redux';
export enum ShortcutsActionsTypes {
SWITCH_SH... |
4297975bbf0a9ccb6ba109baa62f3bb1ff92b2fff8d849b7aad3291daa28802f | TypeScript | 1,519 | 42 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ShapeType } from '../enums';
import type { SerializedTrack } from '../server-response-types';
import { checkNumberOfPoints } from '../object-utils';
import type { AnnotationInjection, Interpola... |
3f08f76029e6b8a91abafd2deaa2773c8f8865a2648cabd57833180c87eb1f76 | TypeScript | 1,521 | 65 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
/**
* Encodes a flattened binary mask into CVAT RLE.
* The encoded sequence always starts with the length of the initial zero run.
* Examples:
* [0, 0, 0, 1] -> [3, 1]
* [1, 1, 0, 0] -> [0, 2, 2]
*/
export function mask2Rle(mask: ArrayLike<n... |
756db820c7e14b664f80cd5e3869178b76cc224d437a96cd2bb0128c7c2b6b92 | TypeScript | 1,525 | 54 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import { BoundariesActions, BoundariesActionTypes } from 'actions/boundaries-actions';
import { AboutActions, AboutActionTypes } from 'actions/about-actions';
import { AuthActions, AuthActionTypes } from 'actions/auth-actions';
import { Ab... |
e6df0af569b6c51c060ba154f81d6621216cbaf16b6e4c85d2105fd9f989ebf3 | TypeScript | 1,545 | 50 | // Copyright (C) 2020-2022 Intel Corporation
//
// SPDX-License-Identifier: MIT
import { BoundariesActions, BoundariesActionTypes } from 'actions/boundaries-actions';
import { UserAgreementsActions, UserAgreementsActionTypes } from 'actions/useragreements-actions';
import { AuthActions, AuthActionTypes } from 'actions... |
42bc30ef6e3abcfb9a596e815c7a94983aab08d2d26b904ca5cb65ac44f4bba3 | TypeScript | 1,566 | 55 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import * as THREE from 'three';
function disposeMaterial(material: THREE.Material): void {
Object.keys(material).forEach((prop) => {
const value = material[prop];
if (value instanceof THREE.Texture) {
value?.dispos... |
df877f792bbde6302238b7127800483aa7a7c51a5d767483202751055ed4bc67 | TypeScript | 1,573 | 57 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { AnyAction } from 'redux';
import { InvitationsActionTypes } from 'actions/invitations-actions';
import { AuthActionTypes } from 'actions/auth-actions';
import { InvitationsState } from '.';
const defaultState: InvitationsState = {
f... |
9d4dcd3af4f46c83a99fe11085f05533a70b58e47779a40a77af49018e7b08fa | TypeScript | 1,588 | 49 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
export const SHORTCUTS_SETTINGS_VERSION = 1;
type SerializedShortcuts = {
version?: number;
keyMap: Record<string, { sequences: string[] }>;
};
const shortcutsMigrations: Record<number, (shortcuts: SerializedShortcuts) => void> = {
1... |
5643bae4305d03f33bd0bb7d0e275530934195c280e93d45142ad5f64a163954 | TypeScript | 1,590 | 39 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ShapeType } from '../enums';
import type { SerializedTrack } from '../server-response-types';
import { checkNumberOfPoints, findAngleDiff } from '../object-utils';
import { Track } from './trac... |
673a4f1a2a3e54bf2e3e0318d8bf7b1df158cd3f4230126b5212a0b6c6feba8d | TypeScript | 1,611 | 53 | // Copyright (C) 2020-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import thunk from 'redux-thunk';
import {
createStore, applyMiddleware, Store, Reducer,
} from 'redux';
import { createLogger } from 'redux-logger';
import { isDev } from 'utils/environment';
import... |
bd1f69f1f9bb3dd30ce9c1ecb6f807a9b3d89fa1624b5f202635f1fb138ee6a5 | TypeScript | 1,611 | 38 | // Copyright (C) 2019-2022 Intel Corporation
// Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ShapeType } from '../enums';
import type { SerializedTrack } from '../server-response-types';
import { checkNumberOfPoints, findAngleDiff } from '../object-utils';
import { Track } from './trac... |
e5ccff9568da353852bbc0fc31fe1aa12d8378335bc12d9f4cb347345c3e6cce | TypeScript | 1,611 | 58 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { ColorBy } from 'reducers';
import { AudioIntervalState, Label } from 'cvat-core-wrapper';
import { hexToRgba } from 'audio/utils/hex-color';
const DEFAULT_COLOR = '#6366F1';
function getAudioAlpha(percent: number): number {
const op... |
eb25a50df0042b3853baed13e0e6eebb61c9246b5b87188073acf05f456eecbd | TypeScript | 1,612 | 66 | // Copyright (C) CVAT.ai Corporation
//
// SPDX-License-Identifier: MIT
import { RuleObject } from 'antd/lib/form';
// eslint-disable-next-line import/no-extraneous-dependencies
import { RuleType } from 'rc-field-form/lib/interface';
import patterns from './validation-patterns';
export function validateUsername(_: R... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.