clarifai / clarifai-go Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED: please use https://github.com/Clarifai/clarifai-go-grpc
License: Other
DEPRECATED: please use https://github.com/Clarifai/clarifai-go-grpc
License: Other
When trying to get metadata about the following image, the API throws errors.
https://data.whicdn.com/images/25997864/large.gif
cannot unmarshal array into Go value of type string
I have some problems with this library when getting tags for videos. The problem is this:
This is an example response from the tag endpoint for a .mp4
video:
{
"results": [
{
"result": {
"classes": [
[
"no person",
"indoors",
And this is a response for an image:
{
"results": [
{
"result": {
"tag": {
"classes": [
"keyboard",
The classes
field is an array of strings for images, but an array of an array of strings for videos.
This is the diff which fixes the video responses:
diff --git a/requests.go b/requests.go
index 22fdb06..96bb70b 100644
--- a/requests.go
+++ b/requests.go
@@ -56,9 +56,9 @@ type TagResult struct {
LocalID string `json:"local_id"`
Result struct {
Tag struct {
- Classes []string `json:"classes"`
+ Classes [][]string `json:"classes"`
CatIDs []string `json:"catids"`
- Probs []float32 `json:"probs"`
+ Probs [][]float32 `json:"probs"`
}
}
DocIDString string `json:"docid_str"`
But this will break the image tag response.
I am trying to add possibility to specify language for each request.
I tried just adding a Language string variable to the TagRequest struct, but that didn't seem to do it.
Any suggestions?
Hello!
Is there any plan to update this lib to work with v2 API?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.