You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I wonder the calculate precision method, the function calculatePrecisionPercentages divide three parts.
But distance alwasy larger than 0 I think...
This function is included in www/js/precision_calculation.js
current code :
/* * Calculate percentage accuracy for each prediction based on distance of * the prediction point from the centre point (uses the window height as * lower threshold 0%) */functioncalculatePrecisionPercentages(precisionPercentages,windowHeight,x50,y50,staringPointX,staringPointY){for(x=0;x<50;x++){// Calculate distance between each prediction and staring pointvarxDiff=staringPointX-x50[x];varyDiff=staringPointY-y50[x];vardistance=Math.sqrt((xDiff*xDiff)+(yDiff*yDiff));// Calculate precision percentagevarhalfWindowHeight=windowHeight/2;varprecision=0;if(distance<=halfWindowHeight&&distance>-1){precision=100-(distance/halfWindowHeight*100);}elseif(distance>halfWindowHeight){precision=0;}elseif(distance>-1){precision=100;}// Store the precisionprecisionPercentages[x]=precision;}}
so, I think below code is more correct. is it right ?
/* * Calculate percentage accuracy for each prediction based on distance of * the prediction point from the centre point (uses the window height as * lower threshold 0%) */functioncalculatePrecisionPercentages(precisionPercentages,windowHeight,x50,y50,staringPointX,staringPointY){for(x=0;x<50;x++){// Calculate distance between each prediction and staring pointvarxDiff=staringPointX-x50[x];varyDiff=staringPointY-y50[x];vardistance=Math.sqrt((xDiff*xDiff)+(yDiff*yDiff));// Calculate precision percentagevarhalfWindowHeight=windowHeight/2;varprecision=0;if(distance<=halfWindowHeight){precision=100-(distance/halfWindowHeight*100);}else{precision=0;}// Store the precisionprecisionPercentages[x]=precision;}}
The text was updated successfully, but these errors were encountered:
Yes @haejunejung you are right, it's a slightly simpler but identical bit of code. If you submit a PR and do a quick test to ensure that the result is identical, then I'll merge it. Thanks for finding this.
I wonder the calculate precision method, the function calculatePrecisionPercentages divide three parts.
But distance alwasy larger than 0 I think...
This function is included in www/js/precision_calculation.js
current code :
so, I think below code is more correct. is it right ?
The text was updated successfully, but these errors were encountered: