Merge branch 'develop' of https://github.com/openvinotoolkit/cvat into dkru/cypress-test-canvas-grid-feature

main
Kruchinin 5 years ago
commit f1810cd0cb

@ -33,6 +33,9 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Exception: "Value must be a user instance" (<https://github.com/openvinotoolkit/cvat/pull/2441>)
- Reset zoom option doesn't work in tag annotation mode (<https://github.com/openvinotoolkit/cvat/pull/2443>)
- Canvas is busy error (<https://github.com/openvinotoolkit/cvat/pull/2437>)
- Projects view layout fix (<https://github.com/openvinotoolkit/cvat/pull/2503>)
- Fixed the tasks view (infinite loading) when it is impossible to get a preview of the task (<https://github.com/openvinotoolkit/cvat/pull/2504>)
- Empty frames navigation (<https://github.com/openvinotoolkit/cvat/pull/2505>)
### Security

@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.10.7",
"version": "1.10.9",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
@ -1213,9 +1213,9 @@
"dev": true
},
"@types/react": {
"version": "16.9.55",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.55.tgz",
"integrity": "sha512-6KLe6lkILeRwyyy7yG9rULKJ0sXplUsl98MGoCfpteXf9sPWFWWMknDcsvubcpaTdBuxtsLF6HDUwdApZL/xIg==",
"version": "16.9.56",
"resolved": "https://registry.npmjs.org/@types/react/-/react-16.9.56.tgz",
"integrity": "sha512-gIkl4J44G/qxbuC6r2Xh+D3CGZpJ+NdWTItAPmZbR5mUS+JQ8Zvzpl0ea5qT/ZT3ZNTUcDKUVqV3xBE8wv/DyQ==",
"requires": {
"@types/prop-types": "*",
"csstype": "^3.0.2"

@ -1,6 +1,6 @@
{
"name": "cvat-ui",
"version": "1.10.7",
"version": "1.10.9",
"description": "CVAT single-page application",
"main": "src/index.tsx",
"scripts": {
@ -49,7 +49,7 @@
"dependencies": {
"@types/lodash": "^4.14.165",
"@types/platform": "^1.3.3",
"@types/react": "^16.9.55",
"@types/react": "^16.9.56",
"@types/react-color": "^3.0.4",
"@types/react-dom": "^16.9.9",
"@types/react-redux": "^7.1.11",

@ -93,7 +93,7 @@ export function getTasksAsync(query: TasksQuery): ThunkAction<Promise<void>, {},
}
const array = Array.from(result);
const promises = array.map((task): string => (task as any).frames.preview().catch(''));
const promises = array.map((task): string => (task as any).frames.preview().catch(() => ''));
dispatch(getInferenceStatusAsync());

@ -15,7 +15,7 @@ export default function ProjectListComponent(): JSX.Element {
const dispatch = useDispatch();
const projectsCount = useSelector((state: CombinedState) => state.projects.count);
const { page } = useSelector((state: CombinedState) => state.projects.gettingQuery);
const projectInstances = useSelector((state: CombinedState) => state.projects.current);
let projectInstances = useSelector((state: CombinedState) => state.projects.current);
const gettingQuery = useSelector((state: CombinedState) => state.projects.gettingQuery);
function changePage(p: number): void {
@ -27,19 +27,30 @@ export default function ProjectListComponent(): JSX.Element {
);
}
projectInstances = projectInstances.reduce((rows, key, index) => {
if (index % 4 === 0) {
rows.push([key]);
} else {
rows[rows.length - 1].push(key);
}
return rows;
}, []);
return (
<>
<Row type='flex' justify='center' align='middle'>
<Col className='cvat-projects-list' md={22} lg={18} xl={16} xxl={14}>
<Row gutter={[8, 8]}>
{projectInstances.map(
(instance: any): JSX.Element => (
<Col xs={8} sm={8} xl={6} key={instance.id}>
<ProjectItem projectInstance={instance} />
</Col>
),
)}
</Row>
{projectInstances.map(
(row: any[]): JSX.Element => (
<Row gutter={[8, 8]}>
{row.map((instance: any) => (
<Col span={6} key={instance.id}>
<ProjectItem projectInstance={instance} />
</Col>
))}
</Row>
),
)}
</Col>
</Row>
<Row type='flex' justify='center' align='middle'>

@ -109,11 +109,11 @@
.cvat-projects-project-item-card {
.ant-empty {
margin: $grid-unit-size;
height: $grid-unit-size * 16;
}
img {
height: 100%;
max-height: $grid-unit-size * 18;
height: $grid-unit-size * 18;
object-fit: cover;
}
}

@ -446,9 +446,9 @@ class AnnotationTopBarContainer extends React.PureComponent<Props, State> {
}
private searchEmptyFrame(start: number, stop: number): void {
const { canvasInstance, jobInstance, searchAnnotations } = this.props;
const { canvasInstance, jobInstance, searchEmptyFrame } = this.props;
if (canvasInstance.isAbleToChangeFrame()) {
searchAnnotations(jobInstance, start, stop);
searchEmptyFrame(jobInstance, start, stop);
}
}

@ -25,7 +25,7 @@ from drf_yasg.inspectors import CoreAPICompatInspector, NotHandled
from drf_yasg.utils import swagger_auto_schema
from rest_framework import mixins, serializers, status, viewsets
from rest_framework.decorators import action
from rest_framework.exceptions import APIException
from rest_framework.exceptions import APIException, NotFound, ValidationError
from rest_framework.permissions import SAFE_METHODS, IsAuthenticated
from rest_framework.renderers import JSONRenderer
from rest_framework.response import Response
@ -426,17 +426,20 @@ class TaskViewSet(auth.TaskGetQuerySetMixin, viewsets.ModelViewSet):
possible_data_type_values = ('chunk', 'frame', 'preview')
possible_quality_values = ('compressed', 'original')
if not data_type or data_type not in possible_data_type_values:
return Response(data='data type not specified or has wrong value', status=status.HTTP_400_BAD_REQUEST)
elif data_type == 'chunk' or data_type == 'frame':
if not data_id:
return Response(data='number not specified', status=status.HTTP_400_BAD_REQUEST)
elif data_quality not in possible_quality_values:
return Response(data='wrong quality value', status=status.HTTP_400_BAD_REQUEST)
try:
if not data_type or data_type not in possible_data_type_values:
raise ValidationError(detail='Data type not specified or has wrong value')
elif data_type == 'chunk' or data_type == 'frame':
if not data_id:
raise ValidationError(detail='Number is not specified')
elif data_quality not in possible_quality_values:
raise ValidationError(detail='Wrong quality value')
db_task = self.get_object()
db_data = db_task.data
if not db_data:
raise NotFound(detail='Cannot find requested data for the task')
frame_provider = FrameProvider(db_task.data)
if data_type == 'chunk':
@ -468,7 +471,7 @@ class TaskViewSet(auth.TaskGetQuerySetMixin, viewsets.ModelViewSet):
else:
return Response(data='unknown data type {}.'.format(data_type), status=status.HTTP_400_BAD_REQUEST)
except APIException as e:
return Response(data=e.default_detail, status=e.status_code)
return Response(data=e.get_full_details(), status=e.status_code)
except Exception as e:
msg = 'cannot get requested data type: {}, number: {}, quality: {}'.format(data_type, data_id, data_quality)
slogger.task[pk].error(msg, exc_info=True)

Loading…
Cancel
Save