www in docker support
This commit is contained in:
parent
539a848e95
commit
c227fce036
2145 changed files with 399596 additions and 58 deletions
|
|
@ -0,0 +1,162 @@
|
|||
package it.acxent.face;
|
||||
|
||||
import it.acxent.db.ApplParmFull;
|
||||
import it.acxent.db.DBAdapter;
|
||||
import it.acxent.db.DBAdapterException;
|
||||
import it.acxent.db.ResParm;
|
||||
import java.io.BufferedReader;
|
||||
import java.io.IOException;
|
||||
import java.io.InputStreamReader;
|
||||
import java.net.HttpURLConnection;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
import java.sql.SQLException;
|
||||
import java.util.Enumeration;
|
||||
import java.util.Properties;
|
||||
|
||||
public class _FaceAdapter extends DBAdapter {
|
||||
private static final long serialVersionUID = -4488728644498299596L;
|
||||
|
||||
public static final String P_PATHFOTO_FACE = "PATHFOTO_FACE";
|
||||
|
||||
public static final String P_PATHFACES = "PATHFACES";
|
||||
|
||||
public static final String P_PATHFACES_REMOTO = "PATHFACES_REMOTO";
|
||||
|
||||
public static final String P_PATHFOTO_SRC = "PATHFOTO_SRC";
|
||||
|
||||
public static final String P_PREVIEW_W = "PREVIEW_W";
|
||||
|
||||
public static final String P_PREVIEW_H = "PREVIEW_H";
|
||||
|
||||
public static final String P_MODGARA = "MODGARA";
|
||||
|
||||
public static final String P_SERVER_CHIAMETE_REMOTO_WWW = "SERVER_CHIAMETE_REMOTO_WWW";
|
||||
|
||||
public static final String P_CONFIDENCE_OK_NEAR = "CONFIDENCE_OK_NEAR";
|
||||
|
||||
public static final String P_CONFIDENCE_OK_LEVEL_1 = "CONFIDENCE_OK_LEVEL_1";
|
||||
|
||||
public static final String P_CONFIDENCE_OK_LEVEL_2 = "CONFIDENCE_OK_LEVEL_2";
|
||||
|
||||
public static final String P_CONFIDENCE_NO_LEVEL_1 = "CONFIDENCE_NO_LEVEL_1";
|
||||
|
||||
public static final String P_CONFIDENCE_FOTO_FACE_SEC_DISTANCE_MAX = "CONFIDENCE_FOTO_FACE_SEC_DISTANCE_MAX";
|
||||
|
||||
public static final String P_CONFIDENCE_MAX_LABEL_X_EVENTO = "CONFIDENCE_MAX_LABEL_X_EVENTO";
|
||||
|
||||
public static final String P_NUM_PROCESSORI_CUDA_EFFETTIVI = "NUM_PROCESSORI_CUDA_EFFETTIVI";
|
||||
|
||||
public static final String P_NUM_QUERY_CALLABLE_MIN = "NUM_QUERY_CALLABLE_MIN";
|
||||
|
||||
public static final String P_NUM_THREAD_X_PROCESSORE_CUDA = "NUM_THREAD_X_PROCESSORE_CUDA";
|
||||
|
||||
public static final String P_NUM_QYERY_CALLABLE = "NUM_QYERY_CALLABLE";
|
||||
|
||||
public static final String P_MAX_NUMBER_OF_THREAD_INDEXING_SCALING = "MAX_NUMBER_OF_THREAD_INDEXING_SCALING";
|
||||
|
||||
public static final String P_STEP_STATUS_MSG_SCORING = "STEP_STATUS_MSG_SCORING";
|
||||
|
||||
public static final String P_MAX_NUMBER_OF_THREAD_SCORING_LVL_2 = "MAX_NUMBER_OF_THREAD_SCORING_LVL_2";
|
||||
|
||||
public static final String P_NUM_QUERY_CALLABLE_LVL_2 = "NUM_QUERY_CALLABLE_LVL_2";
|
||||
|
||||
public static final String P_MAX_NUMBER_OF_THREAD_PF_SCORING_LVL_1 = "MAX_NUMBER_OF_THREAD_PF_SCORING_LVL_1";
|
||||
|
||||
public static final String P_MAX_NUMBER_OF_THREAD_SCORING_LVL_1 = "MAX_NUMBER_OF_THREAD_SCORING_LVL_1";
|
||||
|
||||
public static final String P_NUM_QUERY_CALLABLE_LVL_1 = "NUM_QUERY_CALLABLE_LVL_1";
|
||||
|
||||
public static final String P_FACE_DETECTION_USE_PATH = "FACE_DETECTION_USE_PATH";
|
||||
|
||||
public static final String P_ZOO_YUNET_SCORING_DYS_TYPE = "ZOO_YUNET_SCORING_DYS_TYPE";
|
||||
|
||||
public static final String P_FULL_PATH_SELFIE = "FULL_PATH_SELFIE";
|
||||
|
||||
public static final String PATH_IMG_FACE = "_face/";
|
||||
|
||||
public _FaceAdapter() {}
|
||||
|
||||
public _FaceAdapter(ApplParmFull newApplParmFull) {
|
||||
super(newApplParmFull);
|
||||
}
|
||||
|
||||
protected ResParm checkDeleteCascade() throws DBAdapterException, SQLException {
|
||||
return new ResParm(true);
|
||||
}
|
||||
|
||||
protected void deleteCascade() {}
|
||||
|
||||
public String getPathBaseFoto() {
|
||||
if (getApFull() == null)
|
||||
return "/";
|
||||
return getParm("PATHFOTO_FACE").getTesto();
|
||||
}
|
||||
|
||||
public String getPathBaseFace() {
|
||||
if (getApFull() == null)
|
||||
return "/";
|
||||
return getParm("PATHFACES").getTesto();
|
||||
}
|
||||
|
||||
public String getPathBaseFotoSorgenti() {
|
||||
if (getApFull() == null)
|
||||
return "/";
|
||||
return getParm("PATHFOTO_SRC").getTesto();
|
||||
}
|
||||
|
||||
public boolean isModGara() {
|
||||
long mg = getParm("MODGARA").getNumeroLong();
|
||||
if (mg > 0L)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public boolean isModGara(long l_id_gara) {
|
||||
long mg = getParm("MODGARA").getNumeroLong();
|
||||
if (mg == l_id_gara)
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
|
||||
public static synchronized ResParm startRemoteCmdWWW(ApplParmFull ap, Properties parms) {
|
||||
ResParm rp = new ResParm(true);
|
||||
try {
|
||||
URL urlMugello;
|
||||
String theUrlWww = ap.getParm("SERVER_CHIAMETE_REMOTO_WWW").getTesto();
|
||||
if (parms != null) {
|
||||
StringBuffer p = new StringBuffer("?");
|
||||
Enumeration<Object> e = parms.keys();
|
||||
while (e.hasMoreElements()) {
|
||||
String currentKey = (String)e.nextElement();
|
||||
p.append(currentKey);
|
||||
p.append("=");
|
||||
p.append(parms.getProperty(currentKey));
|
||||
if (e.hasMoreElements())
|
||||
p.append("&");
|
||||
}
|
||||
urlMugello = new URL(theUrlWww + theUrlWww);
|
||||
} else {
|
||||
urlMugello = new URL(theUrlWww);
|
||||
}
|
||||
HttpURLConnection connection = (HttpURLConnection)urlMugello.openConnection();
|
||||
BufferedReader read = new BufferedReader(new InputStreamReader(connection.getInputStream()));
|
||||
String line = read.readLine();
|
||||
String html = "";
|
||||
while (line != null) {
|
||||
html = html + html;
|
||||
line = read.readLine();
|
||||
}
|
||||
rp.setMsg("Chiamata Remota a www eseguita con successo");
|
||||
} catch (MalformedURLException ex) {
|
||||
ex.printStackTrace();
|
||||
rp.setException(ex);
|
||||
rp.setStatus(false);
|
||||
} catch (IOException ioex) {
|
||||
ioex.printStackTrace();
|
||||
rp.setException(ioex);
|
||||
rp.setStatus(false);
|
||||
}
|
||||
return rp;
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue