Skip to content

Commit

Permalink
Merge pull request #461 from bonn-activity-maps/develop
Browse files Browse the repository at this point in the history
Add clickable list of sanity check errors. #399
  • Loading branch information
dari1495 authored May 8, 2021
2 parents 5493278 + a145e10 commit 94d4199
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 6 deletions.
9 changes: 5 additions & 4 deletions src/python/logic/annotationService.py
Original file line number Diff line number Diff line change
Expand Up @@ -652,10 +652,11 @@ def get_sanity_check(self, dataset, scene, user, start_frame, end_frame):
# Search if bbox is inside an ignore region
bbox_in_ir = False
for ir in ir_list:
poly_ir = ptService.transform_to_poly(ir["keypoints"])
if ptService.is_A_in_B(poly_bbox, poly_ir):
bbox_in_ir = True
break
if len(ir["keypoints"]) > 0:
poly_ir = ptService.transform_to_poly(ir["keypoints"])
if ptService.is_A_in_B(poly_bbox, poly_ir):
bbox_in_ir = True
break
# If it's not in an ignore region, check that the pose is inside the bbox
if not bbox_in_ir:
person = ptService.find(person_list, "track_id", bbox["track_id"])
Expand Down
13 changes: 13 additions & 0 deletions src/static/javascript/controllers/toolController.js
Original file line number Diff line number Diff line change
Expand Up @@ -2617,6 +2617,19 @@ angular.module('CVGTool')

_this.moveWholeShape = false;

// When the user clicks on an error of the sanity check error list, mark that object as selected
_this.goToSanityCheckErrorObject = function(object) {
$scope.objectManager.changeSelectedType(object.type);
try{
let selectObject = $scope.objectManager.objectTypes[object.type].objects[object.track_id];
this.openEditor(selectObject, object.number);
} catch (e) {
if(object.number != null) {
$scope.timelineManager.slider.value = object.number;
}
}
}

// Opens the panel to edit keypoints
_this.openEditor = function(object, frame) {
$scope.toolParameters.setMaxVideoFrame(navSrvc.getMaxFrame());
Expand Down
2 changes: 1 addition & 1 deletion src/static/javascript/services/navbarService.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ angular.module('CVGTool')
.factory('navSrvc', ['loginSrvc', '$state', '$rootScope', '$http', '$httpParamSerializer', function(loginSrvc, $state, $rootScope, $http, $httpParamSerializer) {

// Actual version of the tool, THIS IS THE MAIN VARIABLE
var toolVersion = "3.3.2";
var toolVersion = "3.3.3";

// Function to send message to tell the controller to update
var updateSessionData = function() {
Expand Down
2 changes: 1 addition & 1 deletion src/static/views/toolv2.html
Original file line number Diff line number Diff line change
Expand Up @@ -836,7 +836,7 @@ <h2>Errors detected in annotations.</h2>
</tr>
</thead>
<tbody>
<tr ng-repeat="object in commonManager.sanityCheck.results">
<tr ng-repeat="object in commonManager.sanityCheck.results" ng-click="keypointEditor.goToSanityCheckErrorObject(object)" >
<td>{{object.number}}</td>
<td>{{object.track_id}}</td>
<td>{{object.type}}</td>
Expand Down

0 comments on commit 94d4199

Please sign in to comment.