Skip to content

Commit d54c474

Browse files
update
1 parent 7b0fa15 commit d54c474

File tree

4 files changed

+12
-12
lines changed

4 files changed

+12
-12
lines changed

vision-dl4j/README.md

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,17 +5,19 @@ Kindly Execute `/vision-dl4j/com/skymindglobal/face/FaceID` for realtime inferen
55

66
### Face Detection
77
- FaceDetector.OPENCV_DL_FACEDETECTOR (default)
8-
- Description: OpenCV with prebuilt caffe face detection model
8+
- OpenCV with prebuilt caffe face detection model
99
- [Configuration](https://github.com/skymindglobal/Vision/blob/master/vision-dl4j/src/main/java/com/skymindglobal/face/FaceID.java#L145):
1010
- Model inputs: Width and Height
11-
- Confidence
11+
- Threshold
1212
- Resource: `OpenCVDeepLearningFaceDetector\res10_300x300_ssd_iter_140000.caffemodel` and `OpenCVDeepLearningFaceDetector\deploy.prototxt`
13-
1413
- FaceDetector.OPENIMAJ_FKE_FACEDETECTOR
14+
- OpenIMAJ FKEFaceDetector
15+
- Configuration
16+
- Threshold
1517

1618
### Face Identification
17-
- FaceIdentifier.FEATURE_DISTANCE
18-
- Description:
19+
- FaceIdentifier.FEATURE_DISTANCE_VGG16
20+
- Identification based on cosine similarity between images in dictionary and image from webcam.
1921
- [Configuration](https://github.com/skymindglobal/Vision/blob/master/vision-dl4j/src/main/java/com/skymindglobal/face/FaceID.java#L133)
2022
- Embeddings Provider (default: `VGG16FeatureProvider`)
2123
- Dictionary (default: resources `\vgg16_faces_224`)
@@ -26,7 +28,6 @@ Kindly Execute `/vision-dl4j/com/skymindglobal/face/FaceID` for realtime inferen
2628
- numSamples: 3
2729
Average of top 3 per class.
2830

29-
3031
### Dataset Preparation
3132
- Using FaceIdentifier.FEATURE_DISTANCE
3233
May invoke [FaceDatasetPreperation](https://github.com/skymindglobal/Vision/blob/master/vision-dl4j/src/main/java/com/skymindglobal/face/identification/training/FaceDatasetPreperation.java) to generate detection targets face images and load into `\vgg16_faces_224` resource directory.

vision-dl4j/src/main/java/com/skymindglobal/face/FaceID.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public class FaceID {
3737

3838
public static void main(String[] args) throws IOException, ClassNotFoundException, CanvasFrame.Exception, InvalidKerasConfigurationException, UnsupportedKerasConfigurationException {
3939
FaceDetector FaceDetector = getFaceDetector(com.skymindglobal.face.detection.FaceDetector.OPENCV_DL_FACEDETECTOR);
40-
FaceIdentifier FaceIdentifier = getFaceIdentifier(com.skymindglobal.face.identification.FaceIdentifier.FEATURE_DISTANCE);
40+
FaceIdentifier FaceIdentifier = getFaceIdentifier(com.skymindglobal.face.identification.FaceIdentifier.FEATURE_DISTANCE_VGG16);
4141
HeadPoseEstimator HeadPoseEstimator = getHeadPoseEstimator(OPENCV_HEAD_POSE_ESTIMATOR);
4242

4343
VideoCapture capture = new VideoCapture();
@@ -128,10 +128,9 @@ private static FaceIdentifier getFaceIdentifier(String faceIdentifier) throws IO
128128
switch (faceIdentifier){
129129
case FaceIdentifier.CUSTOM_VGG16:
130130
return new VGG16FaceIdentifier(3);
131-
case FaceIdentifier.FEATURE_DISTANCE:
131+
case FaceIdentifier.FEATURE_DISTANCE_VGG16:
132132
File dictionary = new ClassPathResource("vgg16_faces_224").getFile();
133-
return new DistanceFaceIdentifier(
134-
new VGG16FeatureProvider(), dictionary, 1, 0.78, 3, 3);
133+
return new DistanceFaceIdentifier(new VGG16FeatureProvider(), dictionary, 1, 0.78, 3, 3);
135134
case FaceIdentifier.ZHZD:
136135
return new AlexNetFaceIdentifier(5);
137136
default:

vision-dl4j/src/main/java/com/skymindglobal/face/FaceIDVideo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ private static FaceIdentifier getFaceIdentifier(String faceIdentifier) throws IO
101101
switch (faceIdentifier){
102102
case FaceIdentifier.CUSTOM_VGG16:
103103
return new VGG16FaceIdentifier(3);
104-
case FaceIdentifier.FEATURE_DISTANCE:
104+
case FaceIdentifier.FEATURE_DISTANCE_VGG16:
105105
File dictionary = new ClassPathResource("vgg16_faces_224").getFile();
106106
return new DistanceFaceIdentifier(new VGG16FeatureProvider(), dictionary,3, 0.8, 3, 3);
107107
case FaceIdentifier.ZHZD:

vision-dl4j/src/main/java/com/skymindglobal/face/identification/FaceIdentifier.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
public class FaceIdentifier implements IFaceIdentifier{
1010
public static final String CUSTOM_VGG16 = "CUSTOM_VGG16";
11-
public static final String FEATURE_DISTANCE = "FEATURE_DISTANCE";
11+
public static final String FEATURE_DISTANCE_VGG16 = "FEATURE_DISTANCE_VGG16";
1212
public static final String ZHZD = "ZHZD";
1313

1414
public List<List<Prediction>> identify(List<FaceLocalization> faceLocalizations, opencv_core.Mat image) throws IOException {

0 commit comments

Comments
 (0)