paucarre / tiefvision

End-to-end deep learning image-similarity search engine
Apache License 2.0
765 stars 186 forks source link

Cannot parse parameter left as Int #53

Open zuowang opened 7 years ago

zuowang commented 7 years ago

For request 'GET /save_bounding_box?name=026.jpg&left=150.39996337890625&right=74.39996337890625&top=166.8000030517578&bottom=28.800003051757812&width=218&height=292' [Cannot parse parameter left as Int: For input string: "150.39996337890625"]

plippe commented 7 years ago

Hi Zuo Wang,

You aren't giving much in term of information.

Which script did you try to run ? Would you have the full stack trace and not just the error ?

If I had to make a guess, the script it trying to convert "150.39996337890625" to an int (Cannot parse parameter left as Int). The issue is that it isn't an int, it is a string representation of a decimal.

Would you have more information for us to help you ?

zuowang commented 7 years ago

Yes, I opened http://localhost:9000/bounding_box, then created bounding boxes and clicked save button to store them into the database. It got 4 decimal: left, right, top, bottom, but the bound handler requires Int type. It works when I added parseInt() in BoundingBoxEditor.js.

   $scope.saveButton.addEventListener("click", function(){
       window.location = "/save_bounding_box?" +
        "name=" + $scope.boundingBox.name +
 -      "&left=" + $scope.boundingBox.left +
 -      "&right=" + $scope.boundingBox.right +
 -      "&top=" + $scope.boundingBox.top +
 -      "&bottom=" + $scope.boundingBox.bottom +
 +      "&left=" + parseInt($scope.boundingBox.left) +
 +      "&right=" + parseInt($scope.boundingBox.right) +
 +      "&top=" + parseInt($scope.boundingBox.top) +
 +      "&bottom=" + parseInt($scope.boundingBox.bottom) +
        "&width=" + $scope.width +
        "&height=" + $scope.height;
    });
plippe commented 7 years ago

What you did seems to be a good move to fix this. What browser would you be using, as it seems to work on my chrome ?