Skip to content

Commit

Permalink
Update added batch swap of track id for bboxes. Closes #449
Browse files Browse the repository at this point in the history
  • Loading branch information
dari1495 committed Feb 26, 2021
1 parent d4c7291 commit b3f6337
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 6 deletions.
9 changes: 7 additions & 2 deletions src/static/javascript/controllers/dialogsController.js
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ function($scope, $mdDialog, dataset, files, adminDatasetsSrvc) {
* Controller of the dialog of change track ID
*/
.controller('batchChangeTrackIDCtrl', ['$scope', '$mdDialog', 'toolSrvc', 'object', 'dataset', 'scene', 'username',
'ignoreRegions', 'bbox_heads', 'persons', 'frame', 'min_frame', 'max_frame',
function($scope, $mdDialog, toolSrvc, object, dataset, scene, username, ignoreRegions, bbox_heads, persons, frame,
'ignoreRegions', 'bbox_heads', 'bboxes', 'persons', 'frame', 'min_frame', 'max_frame',
function($scope, $mdDialog, toolSrvc, object, dataset, scene, username, ignoreRegions, bbox_heads, bboxes, persons, frame,
min_frame, max_frame) {
$scope.object = object;
$scope.dataset = dataset;
Expand Down Expand Up @@ -676,6 +676,8 @@ function($scope, $mdDialog, dataset, files, adminDatasetsSrvc) {
($scope.values.new_track_id >= 60 && $scope.values.new_track_id < 100)) ||
($scope.object.type === 'bbox_head' &&
($scope.values.new_track_id < 60 && $scope.values.new_track_id >= 0)) ||
($scope.object.type === 'bbox' &&
($scope.values.new_track_id < 60 && $scope.values.new_track_id >= 0)) ||
($scope.object.type === 'person' &&
($scope.values.new_track_id < 60 && $scope.values.new_track_id >= 0))) {
switch ($scope.object.type) {
Expand All @@ -685,6 +687,9 @@ function($scope, $mdDialog, dataset, files, adminDatasetsSrvc) {
case "bbox_head":
check_array(bbox_heads);
break
case "bbox":
check_array(bboxes);
break
case "person":
check_array(persons);
break
Expand Down
2 changes: 1 addition & 1 deletion src/static/javascript/controllers/toolController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2349,14 +2349,14 @@ angular.module('CVGTool')
username: $scope.toolParameters.user.name,
ignoreRegions: $scope.objectManager.objectTypes["ignore_region"].objects,
bbox_heads: $scope.objectManager.objectTypes["bbox_head"].objects,
bboxes: $scope.objectManager.objectTypes["bbox"].objects,
persons: $scope.objectManager.objectTypes["person"].objects,
frame: $scope.timelineManager.slider.value - $scope.toolParameters.frameFrom,
min_frame: $scope.toolParameters.frameFrom,
max_frame: $scope.toolParameters.frameTo
}
}).then(function(data) { // When finished, update the object in the frame
if (data.msg.localeCompare("success") === 0) {
//TODO send frame range and change backend function to iterate
toolSrvc.updateTrackID($scope.canvasesManager.canvases[0].activeCamera.filename,
$scope.toolParameters.activeDataset.name,
$scope.toolParameters.activeDataset.type,
Expand Down
6 changes: 3 additions & 3 deletions src/static/views/dialogs/batchChangeTrackIDDialog.html
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,17 @@ <h2>Confirmation</h2>
<h3>Are you sure?</h3>
</div>
</md-dialog-content>
<md-dialog-content ng-if="object.type === 'bbox_head'">
<md-dialog-content ng-if="object.type === 'bbox_head' || object.type === 'bbox'">
<div ng-if="values.is_id_in_use && !values.invalid_track_id && values.obj_exists" class="alert alert-warning">
<strong>&#9888</strong> The ID: {{values.new_track_id}} is <b>already in use</b> for this frame.<br>
The track IDs will be swapped. Do you still wish to continue?
</div>
<div ng-if="values.is_id_in_use && values.invalid_track_id" class="alert alert-danger">
<strong>&#9888</strong> The ID: {{values.new_track_id}} is <b>invalid.</b> <br>
The track ID for an bbox_head must be <b>lower than 60 and higher than 0</b>.
The track ID for an bbox_head/bbox must be <b>lower than 60 and higher than 0</b>.
</div>
<div ng-if="!values.is_id_in_use && !values.invalid_track_id && !values.obj_exists" class="alert alert-danger">
<strong>&#9888</strong> The bbox_head with track ID {{values.new_track_id}} <b>does not exist.</b> <br>
<strong>&#9888</strong> The bbox_head/bbox with track ID {{values.new_track_id}} <b>does not exist.</b> <br>
Please create a new object before assigning its track ID.
</div>
<div ng-if="!values.is_id_in_use && !values.invalid_track_id && values.obj_exists" class="alert alert-success">
Expand Down

0 comments on commit b3f6337

Please sign in to comment.