Skip to content

Instantly share code, notes, and snippets.

@honwen
Created June 6, 2017 13:50
Show Gist options
  • Save honwen/81dbfcff871b19273ded5c08f2d6efe3 to your computer and use it in GitHub Desktop.
Save honwen/81dbfcff871b19273ded5c08f2d6efe3 to your computer and use it in GitHub Desktop.
package main
import (
"fmt"
"github.com/Comdex/imgo"
"os"
)
func main() {
if len(os.Args) < 3 {
fmt.Println("Not enough args")
os.Exit(1)
}
cos, err := imgo.CosineSimilarity(os.Args[1], os.Args[2])
if err != nil {
panic(err)
}
fmt.Printf("%2.0f\n",cos*99 +1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment