Is there a dlib library port for java? [closed] - java

Closed. This question needs details or clarity. It is not currently accepting answers.
Want to improve this question? Add details and clarify the problem by editing this post.
Closed 2 years ago.
Improve this question
I'm actually using OpenCV for face detection, but after watching this video : https://www.youtube.com/watch?v=LsK0hzcEyHI , I've noticed that dlib is much more accurate, and even in my tests, gives a lot of fale positives (but doesn't miss any face), does anyone know how to use dlib within a Java web application (not android) ? I've already found a port to Android, but I don't thinkk it's possible to use it with in a java web application.
Thank you

I have used dlib myself, and yes it is a very advanced and precise library. There is no port in Java as far as I know. But you can always have it compiled to a shared library (.so in linux or .dll in Windows), and then use that inside your Java code.
More on using a dll or using an so in java
There is also an option to use the C++ library directly within Java, using proxies. You might want to look into that.
Edit : As per #evgeniy's comment, most of dlib is header-only templates. You will not be able to use those if you export dlib directly as a shared library. What you might want to do instead is to expose whatever APIs you need, see here
Edit 2 : As #davis-king's pointed out, you may want to look into using swig and cmake as is done in the mitie/dlib Java api : See here.

If you are looking for Android: https://github.com/tzutalin/dlib-android
Otherwise, this https://github.com/bytedeco/javacpp-presets/issues/49 looks like the most promising but still opened at the moment.

Related

Identifying the architecture and libraries of an open source app [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 4 years ago.
Improve this question
so here I got an open-source Android app which I must analyze and identify the structure of, things like its libraries, high-level architecture, configuration management, and testing facilities.
Now I understand where and how to look for the last two, but I still rather confused on how can I identify the libraries and architecture.
So what I'm asking is, how do I identify the architecture of an app and the libraries it uses? where do I look for it? what part of the source code? are there any tips to do this?
If there is any other info that I should provide, please do tell me.
Edit1: this is what I meant by high-level architecture, using Firefox as an example, but it doesn't have to be this technical, something more simple is also okay >>>
There are 1000s (maybe even millions) of questions on stack-overflow regarding Android development. The android documentation is itself highly exhaustive. And a simple query like "add library android project" can lead someone to answers like this.
What I am really trying to say is, a lot is already there. You just need to use it.
As for the original question :
Libraries
The dependencies can be found here. These are the external libraries that are used by this app.
-
Architecture
About that, you will mostly have to go through the code. Using Android-studio for that can be really helpful. You can use tools like this, but mostly, you will have to go through the code and understand it.
Furthermore, since its opensource project, there should be good documentation about it.

How to run java code in HTML [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
I have a piece of java code I would like to run in my web browser and publish online. How can I do this without using applets? I have tried java vertx but I am not sure how to use it and there are no good tutorials online.
The short answer is you can't. Browsers don't "speak" Java natively, which is why applets required a plugin. As you probably know, Google is in the process of removing support for the plugin technology used by the Java plugin (NPAPI) and so soon Java won't work in Chrome at all (it already doesn't under Linux).
Your only real options are:
Provide a means of running it server-side, like http://ideone.com and various other "online" compilers do.
Translate it from Java to JavaScript (either manually or using a tool), which the browser can then run. But note that Java and JavaScript are not only markedly different languages despite a superficial similarity in syntax, but the standard environment for each is also quite different from the other.
How you do either of those is much too broad a question for SO.

Making an executable with most Java code, but maybe another language added in [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 9 years ago.
Improve this question
I have been looking everywhere, and being a novice at Java and lacking proper terminology it seems impossible to find this.
I assume the correct term is "wrapping", but looking at other Java applications, such as: Minecraft, and seeing how pretty the launcher is and custom buttons, it seems impossible to accomplish such a feat with JFrame.
Do they code their own sort of frame? I've heard that you can "wrap" Java code in like C++ to make the launcher, and after passing the screen is launches the game (minecraft.jar).
Also, how is the exe file created? That once it is run it checks for a patch from the server, that installs the necessary files in a given directory and checks there for save files?
Is it another language? if so which? Which do You recommend? A resource for learning all of this?
These are the main aspects that I've been struggling to learn as no one seems to ask a similar question as I.
Also, considering Java is cross-platform, my main targets are Windows > Mac, for now I can't be bothered to worry about Linux considering I'm already struggling so much here; so for now, how to create a Exe file, if need be, in C++ or any other language, then perhaps DMG for Mac.
You have a lot of things to consider. I would suggest that for now you use Java WebStart to launch your application. This gives you things like:
Easy distribution - put files on a web server somewhere and a JNLP file describing how to glue your files together.
No messing with EXE-wrappers and multiple distributions - this is in the standard Java installation.
Easy updates - just create a new set of files (don't update jars in place) and a new JNLP and thats it.
A sandbox without any effort. Full access to the machine needs code signing which these days is a moving target. Sandbox should be enough for quite a bit though.
Then when you find you have enough users to warrant platform-specific distributions, you can add these as needed instead of getting everything working up front, where you should be concentrating on your application instead.
If you do not want to go the JNLP route, there a number of tools which can do what you ask for.. my favorite is launch4j, which is easy to use via the launch4j-maven-plugin, see e.g. this launch4j-demo illustrating how to use it.
PS: Alternatives include http://sourceforge.net/projects/jsmooth/ or http://www.ej-technologies.com/products/exe4j/overview.html (.com). Note that similar Qs to this with more have been asked on How can I convert my Java program to an .exe file?, How Can I convert Java To Exe, Best free tool to build an exe from Java code?

How to get a webinterface for a small Java program? [closed]

Closed. This question is opinion-based. It is not currently accepting answers.
Want to improve this question? Update the question so it can be answered with facts and citations by editing this post.
Closed 4 years ago.
Improve this question
Actually I have a Java application running on a Linux server as daemon. Now I'll provide a simple web-based configuration page. I have no clue how to solve this without using big frameworks.
What I fell that I don't want is to use Java EE or sth like this. A "small" free (for commercial use) library is ok.
Any ideas?
I would recommend you to use Jetty(it is probably most Java lightweight server) with pure Servlets and JSP. If you need only one or two pages with few configuration options then any framework seem to me like unnessecary overkill.
I can recommend play framework if you want to stay in the java space or if you are adventurous you might consider any number of microframeworks/environments in other languages.
flask(python)
scalatra(scala)
meteor.js(javascript)
node.js(javascript)
twisted(python)
sinatra(ruby)
All of these offer very lightweight web servers(Often allowing you to create dynamic web content in just a few lines) in conjunction with languages that have os integration that will allow you to manage the configuration and status of your application.
You can use Apache Tomcat or Jetty.
Look into com.sun.net.httpserver if you are using the jre. It's already there any very easy the embed.
For configurations you can also use JMX. The jconsole can easily access your application and there is also a JMX HTTP adapter. This adapter allows you to monitor the setting and also change them. This gives you a web page for free but of course its not a "pretty" page.

How to add any classes to the standard java libraries? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 7 years ago.
Improve this question
As Java is an open source: if we have developed good classes which may help anybody.. Can we add them to standard Java library? If yes: how?
File a JSR.
Most useful classes are maintained and distributed via libraries and not included in the JDK/JRE. The apache commons libraries are a very good example: extremely useful but not part of Java.
If your question is of theoretical nature - JSR's are the way to add something to Java. If your question is practical (iaw, you have something you'd like to contribute), I'd practically say: forget about it, put everything in a library and host it on sourceforge (or something else).
Just for interest's sake: MigLayout is considered by many to be a very useful LayoutManager, and its creators and a lot of its users are lobbying to get it adopted into the standard library. They hope to get it into Java 7. We'll see how that goes.
There are quite a few mailing lists associated with ongoing Java/JDK development. These would be the best places to start for suggesting new classes and utilities to add to the JDK.
Submit patches to the OpenJDK project, via the mailing lists mentioned by jsight and then to make it official go the JSR route mentioned by Ignacio, ideally with some community support.

Categories

Resources