deeparsdk / photoedit-android-java Goto Github PK
View Code? Open in Web Editor NEWHow to apply face filter on the photo loaded from gallery using DeepAR SDK
Home Page: https://developer.deepar.ai
License: MIT License
How to apply face filter on the photo loaded from gallery using DeepAR SDK
Home Page: https://developer.deepar.ai
License: MIT License
2022-09-14 11:35:42.001 16382-16467/ai.deepar.photo_edit_example E/AndroidRuntime: FATAL EXCEPTION: ExampleHandlerThread
Process: ai.deepar.photo_edit_example, PID: 16382
java.lang.IllegalStateException: Method called from the thread that DeepAR was not initialized in. You must call this method from the same thread that you initialized DeepAR in (the same thread where you first call DeepAR.setRenderSurface()).
at ai.deepar.ar.DeepAR.checkValidState(DeepAR.java:659)
at ai.deepar.ar.DeepAR.receiveFrame(DeepAR.java:674)
at ai.deepar.photo_edit_example.LoadImageHandlerThread.uploadBitmapToDeepAR(LoadImageHandlerThread.java:148)
at ai.deepar.photo_edit_example.LoadImageHandlerThread.loadDefaultBitmap(LoadImageHandlerThread.java:90)
at ai.deepar.photo_edit_example.LoadImageHandlerThread$1.handleMessage(LoadImageHandlerThread.java:75)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:233)
at android.os.Looper.loop(Looper.java:334)
at android.os.HandlerThread.run(HandlerThread.java:67)
System config
Android Studio 3.6.1
Build #AI-192.7142.36.36.6241897, built on February 27, 2020
Runtime version: 1.8.0_212-release-1586-b04 amd64
VM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
Windows 10 10.0
The project is not compiling
FAILURE: Build failed with an exception.
Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
Could not find :deepar:.
Required by:
project :app
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
Get more help at https://help.gradle.org
BUILD FAILED in 0s
as far as I think it is not able to get the deepar.aar library, how can I resolve this.
In MainActivity.java, add the following:
private static final String API_KEY = "your-api-key-here";
private void initializeDeepAR() {
deepAR = new DeepAR(this);
deepAR.setLicenseKey(API_KEY);
deepAR.initialize(this, this);
}
For README:
The trace:
2020-03-07 19:35:06.155 29123-29123/ai.deepar.photo_edit_example E/AndroidRuntime: FATAL EXCEPTION: main Process: ai.deepar.photo_edit_example, PID: 29123 java.lang.ArrayIndexOutOfBoundsException: length=22; index=-1 at java.util.ArrayList.get(ArrayList.java:439) at ai.deepar.photo_edit_example.MainActivity.gotoPrevious(MainActivity.java:278) at ai.deepar.photo_edit_example.MainActivity.access$200(MainActivity.java:52) at ai.deepar.photo_edit_example.MainActivity$6.onClick(MainActivity.java:210)
It seems like a trivial fix but something I was quickly able to come across during exploratory testing!
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.