clarifai / clarifai-android-starter Goto Github PK
View Code? Open in Web Editor NEWDEPRECATED: please use https://github.com/Clarifai/clarifai-java-grpc
DEPRECATED: please use https://github.com/Clarifai/clarifai-java-grpc
How to change the general model to food items model cant do this?
Hello,
I keep getting the failure "Error while contacting Clarifai API".
Also it says sometimes during the start of Android Studio that the module "clarifai-android-starter-master.iml" cannot be loaded.
I installed the "Java SE Development Kit 8u161", changed the clarifai core number to 2.3.0 and pasted the API-number in strings.xml.
Any idea, why this should not work?
Update the Clarifai Java dependency to 2.3.
Was it intentionally, to have
BitmapFactory.decodeStream(getContentResolver().openInputStream(uri), null, opts);
called twice within the private Bitmap loadBitmapFromUri(Uri uri) method
it is used to return a Bitmap which is why it is returned such as
return BitmapFactory.decodeStream(getContentResolver().openInputStream(uri), null, opts);
but it is also called in the method without returning or assigning it to anything, was this a typo or intentionally?
com.clarifai.android.starter.api.v2 E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.clarifai.android.starter.api.v2, PID: 22534
java.lang.RuntimeException: Unable to create application com.clarifai.android.starter.api.v2.App: clarifai2.exception.ClarifaiException: java.util.concurrent.ExecutionException: clarifai2.exception.ClarifaiException: API call to refresh token unsuccessful
Provided AppID: cc42b10022ba4881a69b84e3bc963992
Provided AppSecret: NhujL3Zy_79qgEeik-XlKNFeS6t-0TR142hUqnd0
Provided BaseURL: https://api.clarifai.com/
Status code: 401
Message: Unauthorized
Details: {"status":{"code":11002,"description":"Invalid credentials","details":"invalid client ID (cc42b10022ba4881a69b84e3bc963992) and secret (NhujL3Zy_79qgEeik-XlKNFeS6t-0TR142hUqnd0)"}}
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4730)
at android.app.ActivityThread.access$1600(ActivityThread.java:157)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1412)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5437)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: clarifai2.exception.ClarifaiException: java.util.concurrent.ExecutionException: clarifai2.exception.ClarifaiException: API call to refresh token unsuccessful
Provided AppID: cc42b10022ba4881a69b84e3bc963992
Provided AppSecret: NhujL3Zy_79qgEeik-XlKNFeS6t-0TR142hUqnd0
Provided BaseURL: https://api.clarifai.com/
Status code: 401
Message: Unauthorized
Details: {"status":{"code":11002,"description":"Invalid credentials","details":"invalid client ID (cc42b10022ba4881a69b84e3bc963992) and secret (NhujL3Zy_79qgEeik-XlKNFeS6t-0TR142hUqnd0)"}}
at clarifai2.api.BaseClarifaiClient.refresh(BaseClarifaiClient.java:120)
at clarifai2.api.BaseClarifaiClient.getCredential(BaseClarifaiClient.java:84)
at clarifai2.api.BaseClarifaiClient.(BaseClarifaiClient.java:77)
at clarifai2.api.ClarifaiClientImpl.(ClarifaiClientImpl.java:51)
at clarifai2.api.ClarifaiBuilder.buildSync(ClarifaiBuilder.java:75)
at com.clarifai.android.starter.api.v2.App.onCreate(App.java:51)
at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1014)
at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4727)
... 8 more
Caused by: java.util.concurrent.ExecutionException: clarifai2.exception.ClarifaiException: API call to refresh token unsuccessful
Provided AppID: cc42b10022ba4881a69b84e3bc963992
Provided AppSecret: NhujL3Zy_79qgEeik-XlKNFeS6t-0TR142hUqnd0
Provided BaseURL: https://api.clarifai.com/
Status code: 401
Message: Unauthorized
Details: {"status":{"code":11002,"description":"Invalid credentials","details":"invalid client ID (cc42b10022ba4881a69b84e3bc963992) and secret (NhujL3Zy_79qgEeik-XlKNFeS6t-0TR142hUqnd0)"}}
at java.util.concurrent.FutureTask.report(FutureTask.java:94)
at java.util.concurrent.FutureTask.get(FutureTask.java:164)
at java.util.concurrent.AbstractExecutorService.doInvokeAny(AbstractExecutorService.java:163)
at java.util.concurrent.AbstractExecutorService.invokeAny(AbstractExecutorService.java:185)
at clarifai2.api.BaseClarifaiClient.refresh(BaseClarifaiClient.java:92)
... 15 more
Caused by: clarifai2.exception.ClarifaiException: API call to refresh token unsuccessful
Provided AppID: cc42b10022ba4881a69b84e3bc963992
Provided AppSecret: NhujL3Zy_79qgEeik-XlKNFeS6t-0TR142hUqnd0
Provided BaseURL: https://api.clarifai.com/
Status code: 401
Message: Unauthorized
Details: {"status":{"code":11002,"description":"Invalid credentials","details":"invalid client ID (cc42b10022ba4881a69b84e3bc963992) and secret (NhujL3Zy_79qgEeik-XlKNFeS6t-0TR142hUqnd0)"}}
at clarifai2.api.BaseClarifaiClient$2.call(BaseClarifaiClient.java:108)
at clarifai2.api.BaseClarifaiClient$2.call(BaseClarifaiClient.java:93)
at java.util.concurrent.FutureTask.run(FutureTa
Please tell me what is happening with my code.
what should i do?
I used this whole code and changed API key with mine but the app is crashing displaying the IllegalStateException("App has not been created yet!"). What should I change? Any possible solution?
Depending on the phone, when the camera is in portrait mode, or if the camera is on the left in landscape mode, or if it's upside down, the app crashes out of the box after taking a picture.
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.