486 lines
11 KiB
Java
486 lines
11 KiB
Java
package it.acxent.face;
|
|
|
|
import it.acxent.db.ApplParmFull;
|
|
import it.acxent.db.CRAdapter;
|
|
import javax.servlet.http.HttpServletRequest;
|
|
|
|
public class FotoCR extends CRAdapter implements Cloneable {
|
|
private static final long serialVersionUID = 4318149988984574664L;
|
|
|
|
public static final String ATTR_SESS_SELFIE_FACE_FILENAME = "_SELFIE_FACE_FILENAME";
|
|
|
|
public static final String ATTR_SESS_SELFIE_FACE_ORIG_FILENAME = "_SELFIE_FACE_ORIG_FILENAME";
|
|
|
|
public static final String ATTR_SESS_SELFIE_FOTO = "_SELFIE_FOTO";
|
|
|
|
public static final String ATTR_SESS_SELFIE = "selfie";
|
|
|
|
public static final long FOTO_OR_FACE_FOTO = 0L;
|
|
|
|
public static final long FOTO_OR_FACE_FACE = 1L;
|
|
|
|
public static final long ORDER_BY_CONFIDENCE = 9L;
|
|
|
|
public static final long ORDER_BY_RAND = 99L;
|
|
|
|
public static final String PATH_SELFIE = "_selfie/";
|
|
|
|
private long id_foto;
|
|
|
|
private long id_fotoSelfie;
|
|
|
|
private String fileName;
|
|
|
|
private String pettorale;
|
|
|
|
private String fileNameMd5;
|
|
|
|
private String md5;
|
|
|
|
private FotoFace fotoFace;
|
|
|
|
private FotoI fotoSelfie;
|
|
|
|
private Evento evento;
|
|
|
|
private long id_evento;
|
|
|
|
private long flgIndicizzate = -1L;
|
|
|
|
private long id_puntoFoto;
|
|
|
|
private PuntoFoto puntoFotoFace;
|
|
|
|
private long id_fotoS;
|
|
|
|
private long flgVideo = -1L;
|
|
|
|
private double percIdx1 = 98.0D;
|
|
|
|
private double percIdx2 = 98.0D;
|
|
|
|
private double percIdx3 = 98.0D;
|
|
|
|
private double percIdx4 = 98.0D;
|
|
|
|
private long flgTh;
|
|
|
|
private long flgConPettorali = -1L;
|
|
|
|
private long flgTrainingOk = -1L;
|
|
|
|
private long flgLabelPrincipale = -1L;
|
|
|
|
private long flgHasFace = -1L;
|
|
|
|
private long label = -1L;
|
|
|
|
private long labelSearch = -1L;
|
|
|
|
private long id_faceRecognizer;
|
|
|
|
private FaceRecognizer faceRecognizer;
|
|
|
|
private long flgFotoOrFace = 0L;
|
|
|
|
private double confidence = 0.0D;
|
|
|
|
private long flgWithFaces = -1L;
|
|
|
|
private long flgTrainingInviate = -1L;
|
|
|
|
private long flgLabel0 = -1L;
|
|
|
|
private long flgFaceScoringDone = -1L;
|
|
|
|
private String fileNameFrom;
|
|
|
|
private String md5FotoFace;
|
|
|
|
private Selfie selfie = null;
|
|
|
|
private long id_selfie;
|
|
|
|
private String elencoFoto;
|
|
|
|
public final String getFaceScoringDone() {
|
|
return getFaceScoringDone(getFlgFaceScoringDone());
|
|
}
|
|
|
|
public static final String getFaceScoringDone(long l_flgFaceScoringDone) {
|
|
return Foto.getFaceScoringDone(l_flgFaceScoringDone);
|
|
}
|
|
|
|
public FotoCR(ApplParmFull newApplParmFull) {
|
|
super(newApplParmFull);
|
|
}
|
|
|
|
public FotoCR() {}
|
|
|
|
public static final String getFotoOrFace(long l_flgFotoOrFace) {
|
|
if (l_flgFotoOrFace == 0L)
|
|
return "Foto";
|
|
return "Face";
|
|
}
|
|
|
|
public final String getFotoOrFace() {
|
|
return getFotoOrFace(getFlgFotoOrFace());
|
|
}
|
|
|
|
public void setId_foto(long newId_foto) {
|
|
this.id_foto = newId_foto;
|
|
}
|
|
|
|
public void setFileName(String newFileName) {
|
|
this.fileName = newFileName;
|
|
}
|
|
|
|
public void setPettorale(String newPettorali) {
|
|
this.pettorale = newPettorali;
|
|
}
|
|
|
|
public void setFileNameMd5(String newFileNameMd5) {
|
|
this.fileNameMd5 = newFileNameMd5;
|
|
}
|
|
|
|
public void setMd5(String newMd5) {
|
|
this.md5 = newMd5;
|
|
}
|
|
|
|
public long getId_foto() {
|
|
return this.id_foto;
|
|
}
|
|
|
|
public String getFileName() {
|
|
return (this.fileName == null) ? "" : this.fileName.trim();
|
|
}
|
|
|
|
public String getPettorale() {
|
|
return (this.pettorale == null) ? "" : this.pettorale.trim();
|
|
}
|
|
|
|
public String getFileNameMd5() {
|
|
return (this.fileNameMd5 == null) ? "" : this.fileNameMd5.trim();
|
|
}
|
|
|
|
public String getMd5() {
|
|
return (this.md5 == null) ? "" : this.md5.trim();
|
|
}
|
|
|
|
public String getSessionSelfieImage(HttpServletRequest req) {
|
|
String selfieFileName = (String)req.getSession().getAttribute("_SELFIE_FACE_FILENAME");
|
|
return (selfieFileName == null) ? AB_EMPTY_STRING : selfieFileName;
|
|
}
|
|
|
|
public FotoFace getFotoFace() {
|
|
return this.fotoFace;
|
|
}
|
|
|
|
public void setFotoFace(FotoFace fotoFace) {
|
|
this.fotoFace = fotoFace;
|
|
}
|
|
|
|
public String getSessionSelfieName(HttpServletRequest req) {
|
|
String selfieFileName = (String)req.getSession().getAttribute("_SELFIE_FACE_ORIG_FILENAME");
|
|
return (selfieFileName == null) ? AB_EMPTY_STRING : selfieFileName;
|
|
}
|
|
|
|
public long getId_fotoSelfie() {
|
|
return this.id_fotoSelfie;
|
|
}
|
|
|
|
public void setId_fotoSelfie(long id_fotoSelfie) {
|
|
this.id_fotoSelfie = id_fotoSelfie;
|
|
setFotoSelfie(null);
|
|
}
|
|
|
|
@Deprecated
|
|
public FotoI getFotoSelfie() {
|
|
if (this.fotoSelfie == null && getId_fotoSelfie() > 0L && getApFull() != null) {
|
|
this.fotoSelfie = new Foto(getApFull());
|
|
this.fotoSelfie.findByPrimaryKey(getId_fotoSelfie());
|
|
}
|
|
return this.fotoSelfie;
|
|
}
|
|
|
|
@Deprecated
|
|
public void setFotoSelfie(FotoI fotoSelfie) {
|
|
this.fotoSelfie = fotoSelfie;
|
|
}
|
|
|
|
public FotoI getSessionSelfie(HttpServletRequest req) {
|
|
FotoI selfie = (FotoI)req.getSession().getAttribute("_SELFIE_FOTO");
|
|
return (selfie == null) ? new Foto(getApFull()) : selfie;
|
|
}
|
|
|
|
public Evento getEvento() {
|
|
this.evento = (Evento)getSecondaryObject(this.evento, Evento.class, getId_evento());
|
|
return this.evento;
|
|
}
|
|
|
|
public long getId_evento() {
|
|
return this.id_evento;
|
|
}
|
|
|
|
public void setEvento(Evento evento) {
|
|
this.evento = evento;
|
|
}
|
|
|
|
public void setId_evento(long id_evento) {
|
|
this.id_evento = id_evento;
|
|
setEvento(null);
|
|
}
|
|
|
|
public long getFlgIndicizzate() {
|
|
return this.flgIndicizzate;
|
|
}
|
|
|
|
public void setFlgIndicizzate(long flgIndicizzate) {
|
|
this.flgIndicizzate = flgIndicizzate;
|
|
}
|
|
|
|
public PuntoFoto getPuntoFotoFace() {
|
|
this.puntoFotoFace = (PuntoFoto)getSecondaryObject(this.puntoFotoFace, PuntoFoto.class, getId_puntoFoto());
|
|
return this.puntoFotoFace;
|
|
}
|
|
|
|
public long getId_puntoFoto() {
|
|
return this.id_puntoFoto;
|
|
}
|
|
|
|
public void setId_puntoFoto(long id_puntoFoto) {
|
|
this.id_puntoFoto = id_puntoFoto;
|
|
setPuntoFotoFace(null);
|
|
}
|
|
|
|
public void setPuntoFotoFace(PuntoFoto puntoFoto) {
|
|
this.puntoFotoFace = puntoFoto;
|
|
}
|
|
|
|
public long getId_fotoS() {
|
|
return this.id_fotoS;
|
|
}
|
|
|
|
public void setId_fotoS(long id_fotoS) {
|
|
this.id_fotoS = id_fotoS;
|
|
}
|
|
|
|
public long getFlgVideo() {
|
|
return this.flgVideo;
|
|
}
|
|
|
|
public void setFlgVideo(long flgVideo) {
|
|
this.flgVideo = flgVideo;
|
|
}
|
|
|
|
public double getPercIdx1() {
|
|
return this.percIdx1;
|
|
}
|
|
|
|
public void setPercIdx1(double percIdx1) {
|
|
this.percIdx1 = percIdx1;
|
|
}
|
|
|
|
public double getPercIdx2() {
|
|
return this.percIdx2;
|
|
}
|
|
|
|
public void setPercIdx2(double percIdx2) {
|
|
this.percIdx2 = percIdx2;
|
|
}
|
|
|
|
public double getPercIdx3() {
|
|
return this.percIdx3;
|
|
}
|
|
|
|
public void setPercIdx3(double percIdx3) {
|
|
this.percIdx3 = percIdx3;
|
|
}
|
|
|
|
public double getPercIdx4() {
|
|
return this.percIdx4;
|
|
}
|
|
|
|
public void setPercIdx4(double percIdx4) {
|
|
this.percIdx4 = percIdx4;
|
|
}
|
|
|
|
public long getFlgTh() {
|
|
return this.flgTh;
|
|
}
|
|
|
|
public void setFlgTh(long flgTh) {
|
|
this.flgTh = flgTh;
|
|
}
|
|
|
|
public long getFlgConPettorali() {
|
|
return this.flgConPettorali;
|
|
}
|
|
|
|
public void setFlgConPettorali(long flgConPettorali) {
|
|
this.flgConPettorali = flgConPettorali;
|
|
}
|
|
|
|
public long getFlgTrainingOk() {
|
|
return this.flgTrainingOk;
|
|
}
|
|
|
|
public void setFlgTrainingOk(long flgTrainingOk) {
|
|
this.flgTrainingOk = flgTrainingOk;
|
|
}
|
|
|
|
public long getFlgHasFace() {
|
|
return this.flgHasFace;
|
|
}
|
|
|
|
public void setFlgHasFace(long flgHasVisi) {
|
|
this.flgHasFace = flgHasVisi;
|
|
}
|
|
|
|
public long getLabel() {
|
|
return this.label;
|
|
}
|
|
|
|
public void setLabel(long label) {
|
|
this.label = label;
|
|
}
|
|
|
|
public long getLabelSearch() {
|
|
return this.labelSearch;
|
|
}
|
|
|
|
public void setLabelSearch(long labelSearch) {
|
|
this.labelSearch = labelSearch;
|
|
}
|
|
|
|
public boolean isRicercaFotoFace() {
|
|
if (getFlgFotoOrFace() == 1L || this.label == 0L || this.labelSearch == 0L || getFlgTrainingOk() >= 0L)
|
|
return true;
|
|
return false;
|
|
}
|
|
|
|
public long getId_faceRecognizer() {
|
|
return this.id_faceRecognizer;
|
|
}
|
|
|
|
public void setId_faceRecognizer(long id_faceRecognizer) {
|
|
this.id_faceRecognizer = id_faceRecognizer;
|
|
setFaceRecognizer(null);
|
|
}
|
|
|
|
public FaceRecognizer getFaceRecognizer() {
|
|
this.faceRecognizer = (FaceRecognizer)getSecondaryObject(this.faceRecognizer, FaceRecognizer.class, getId_faceRecognizer());
|
|
return this.faceRecognizer;
|
|
}
|
|
|
|
public void setFaceRecognizer(FaceRecognizer faceRecognizer) {
|
|
this.faceRecognizer = faceRecognizer;
|
|
}
|
|
|
|
public long getFlgFotoOrFace() {
|
|
return this.flgFotoOrFace;
|
|
}
|
|
|
|
public void setFlgFotoOrFace(long flgFotoOrFace) {
|
|
this.flgFotoOrFace = flgFotoOrFace;
|
|
}
|
|
|
|
public double getConfidence() {
|
|
return this.confidence;
|
|
}
|
|
|
|
public void setConfidence(double confidence) {
|
|
this.confidence = confidence;
|
|
}
|
|
|
|
public long getFlgLabelPrincipale() {
|
|
return this.flgLabelPrincipale;
|
|
}
|
|
|
|
public void setFlgLabelPrincipale(long flgLabelPrincipale) {
|
|
this.flgLabelPrincipale = flgLabelPrincipale;
|
|
}
|
|
|
|
public FotoCR getClone() {
|
|
try {
|
|
return (FotoCR)clone();
|
|
} catch (CloneNotSupportedException e) {
|
|
e.printStackTrace();
|
|
return null;
|
|
}
|
|
}
|
|
|
|
public long getFlgWithFaces() {
|
|
return this.flgWithFaces;
|
|
}
|
|
|
|
public void setFlgWithFaces(long flgWithFaces) {
|
|
this.flgWithFaces = flgWithFaces;
|
|
}
|
|
|
|
public long getFlgTrainingInviate() {
|
|
return this.flgTrainingInviate;
|
|
}
|
|
|
|
public void setFlgTrainingInviate(long flgTrainingInviate) {
|
|
this.flgTrainingInviate = flgTrainingInviate;
|
|
}
|
|
|
|
public long getFlgLabel0() {
|
|
return this.flgLabel0;
|
|
}
|
|
|
|
public void setFlgLabel0(long flgLabel0) {
|
|
this.flgLabel0 = flgLabel0;
|
|
}
|
|
|
|
public long getFlgFaceScoringDone() {
|
|
return this.flgFaceScoringDone;
|
|
}
|
|
|
|
public void setFlgFaceScoringDone(long flgFaceScoringDone) {
|
|
this.flgFaceScoringDone = flgFaceScoringDone;
|
|
}
|
|
|
|
public String getFileNameFrom() {
|
|
return (this.fileNameFrom == null) ? AB_EMPTY_STRING : this.fileNameFrom.trim();
|
|
}
|
|
|
|
public void setFileNameFrom(String nomeFileDa) {
|
|
this.fileNameFrom = nomeFileDa;
|
|
}
|
|
|
|
public String getMd5FotoFace() {
|
|
return (this.md5FotoFace == null) ? "" : this.md5FotoFace.trim();
|
|
}
|
|
|
|
public void setMd5FotoFace(String md5FotoFace) {
|
|
this.md5FotoFace = md5FotoFace;
|
|
}
|
|
|
|
public Selfie getSelfie() {
|
|
this.selfie = (Selfie)getSecondaryObject(this.selfie, Selfie.class, getId_selfie());
|
|
return this.selfie;
|
|
}
|
|
|
|
public void setSelfie(Selfie selfie) {
|
|
this.selfie = selfie;
|
|
}
|
|
|
|
public long getId_selfie() {
|
|
return this.id_selfie;
|
|
}
|
|
|
|
public void setId_selfie(long id_selfie) {
|
|
this.id_selfie = id_selfie;
|
|
setSelfie(null);
|
|
}
|
|
|
|
public String getElencoFoto() {
|
|
return (this.elencoFoto == null) ? AB_EMPTY_STRING : this.elencoFoto.trim();
|
|
}
|
|
|
|
public void setElencoFoto(String elencoFoto) {
|
|
this.elencoFoto = elencoFoto;
|
|
}
|
|
}
|