-
Notifications
You must be signed in to change notification settings - Fork 3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #8362 from cvat-ai/release-2.17.0
Release v2.17.0
- Loading branch information
Showing
117 changed files
with
3,514 additions
and
1,047 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
cvat-sdk~=2.16.3 | ||
cvat-sdk~=2.17.0 | ||
Pillow>=10.3.0 | ||
setuptools>=70.0.0 # not directly required, pinned by Snyk to avoid a vulnerability |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
VERSION = "2.16.3" | ||
VERSION = "2.17.0" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
// Copyright (C) 2024 CVAT.ai Corporation | ||
// | ||
// SPDX-License-Identifier: MIT | ||
|
||
import Axios, { AxiosRequestConfig, AxiosResponse } from 'axios'; | ||
import * as tus from 'tus-js-client'; | ||
|
||
class AxiosHttpResponse implements tus.HttpResponse { | ||
readonly #axiosResponse: AxiosResponse; | ||
|
||
constructor(axiosResponse: AxiosResponse) { | ||
this.#axiosResponse = axiosResponse; | ||
} | ||
|
||
getStatus(): number { | ||
return this.#axiosResponse.status; | ||
} | ||
getHeader(header: string): string | undefined { | ||
return this.#axiosResponse.headers[header.toLowerCase()]; | ||
} | ||
getBody(): string { | ||
return this.#axiosResponse.data; | ||
} | ||
getUnderlyingObject(): AxiosResponse { | ||
return this.#axiosResponse; | ||
} | ||
} | ||
|
||
class AxiosHttpRequest implements tus.HttpRequest { | ||
readonly #axiosConfig: AxiosRequestConfig; | ||
readonly #abortController: AbortController; | ||
|
||
constructor(method: string, url: string) { | ||
this.#abortController = new AbortController(); | ||
this.#axiosConfig = { | ||
method, | ||
url, | ||
headers: {}, | ||
signal: this.#abortController.signal, | ||
validateStatus: () => true, | ||
}; | ||
} | ||
|
||
getMethod(): string { | ||
return this.#axiosConfig.method; | ||
} | ||
getURL(): string { | ||
return this.#axiosConfig.url; | ||
} | ||
|
||
setHeader(header: string, value: string): void { | ||
this.#axiosConfig.headers[header.toLowerCase()] = value; | ||
} | ||
getHeader(header: string): string | undefined { | ||
return this.#axiosConfig.headers[header.toLowerCase()]; | ||
} | ||
|
||
setProgressHandler(handler: (bytesSent: number) => void): void { | ||
this.#axiosConfig.onUploadProgress = (progressEvent) => { | ||
handler(progressEvent.loaded); | ||
}; | ||
} | ||
|
||
async send(body: any): Promise<tus.HttpResponse> { | ||
const axiosResponse = await Axios({ ...this.#axiosConfig, data: body }); | ||
return new AxiosHttpResponse(axiosResponse); | ||
} | ||
|
||
async abort(): Promise<void> { | ||
this.#abortController.abort(); | ||
} | ||
|
||
getUnderlyingObject(): AxiosRequestConfig { | ||
return this.#axiosConfig; | ||
} | ||
} | ||
|
||
class AxiosHttpStack implements tus.HttpStack { | ||
createRequest(method: string, url: string): tus.HttpRequest { | ||
return new AxiosHttpRequest(method, url); | ||
} | ||
getName(): string { | ||
return 'AxiosHttpStack'; | ||
} | ||
} | ||
|
||
export const axiosTusHttpStack = new AxiosHttpStack(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.