Fix broken tensorflow test (#107)
* Fix broken tensorflow test * Introduce rounding to fix tests
This commit is contained in:
parent
2e418d6e1e
commit
6267118acf
2 changed files with 4 additions and 2 deletions
|
@ -4,6 +4,7 @@ package photoprism
|
|||
|
||||
import (
|
||||
"io/ioutil"
|
||||
"math"
|
||||
"testing"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/test"
|
||||
|
@ -30,6 +31,6 @@ func TestTensorFlow_GetImageTags(t *testing.T) {
|
|||
assert.Equal(t, "tabby", result[0].Label)
|
||||
assert.Equal(t, "tiger cat", result[1].Label)
|
||||
|
||||
assert.Equal(t, float32(0.1648176), result[1].Probability)
|
||||
assert.Equal(t, float64(0.165), math.Round(float64(result[1].Probability)*1000)/1000)
|
||||
}
|
||||
}
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package photoprism
|
||||
|
||||
import (
|
||||
"math"
|
||||
"testing"
|
||||
|
||||
"github.com/photoprism/photoprism/internal/test"
|
||||
|
@ -24,5 +25,5 @@ func TestTensorFlow_GetImageTagsFromFile(t *testing.T) {
|
|||
assert.Equal(t, "tabby", result[0].Label)
|
||||
assert.Equal(t, "tiger cat", result[1].Label)
|
||||
|
||||
assert.Equal(t, float32(0.1648176), result[1].Probability)
|
||||
assert.Equal(t, float64(0.165), math.Round(float64(result[1].Probability)*1000)/1000)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue