add model type enum and yolov4 network
@@ -9,13 +9,21 @@ public class Model {
AUTOPILOT_F,
DETECTOR_V1_1_0_Q,
DETECTOR_V3_S_Q,
+ YOLO_V4_TINY_F
+ }
+
+ public enum TYPE {
+ AUTOPILOT,
+ DETECTOR
}
public static final Model AUTOPILOT_F = new Model(ID.AUTOPILOT_F);
public static final Model DETECTOR_V1_1_0_Q = new Model(ID.DETECTOR_V1_1_0_Q);
public static final Model DETECTOR_V3_S_Q = new Model(ID.DETECTOR_V3_S_Q);
+ public static final Model YOLO_V4_TINY_F = new Model(ID.YOLO_V4_TINY_F);
public final ID id;
+ public final TYPE type;
public final String filename;
public static Model fromId(String id) {
@@ -26,17 +34,33 @@ public class Model {
return DETECTOR_V1_1_0_Q;
case DETECTOR_V3_S_Q:
return DETECTOR_V3_S_Q;
+ case YOLO_V4_TINY_F:
+ return YOLO_V4_TINY_F;
}
throw new IllegalArgumentException("No model with id " + id);
}
private Model(ID id) {
this.id = id;
+ switch (id) {
+ case AUTOPILOT_F:
+ this.type = TYPE.AUTOPILOT;
+ break;
+ case DETECTOR_V1_1_0_Q:
+ case DETECTOR_V3_S_Q:
+ case YOLO_V4_TINY_F:
+ this.type = TYPE.DETECTOR;
+ break;
+ default:
+ this.type = null;
+ break;
+ }
this.filename = null;
}
public Model(String filename) {
this.id = ID.AUTOPILOT_F;
+ this.type = TYPE.AUTOPILOT;
this.filename = filename;
}
@@ -48,6 +72,8 @@ public class Model {
return new Size(300, 300);
case DETECTOR_V3_S_Q:
return new Size(320, 320);
+ case YOLO_V4_TINY_F:
+ return new Size(416, 416);
}
throw new IllegalArgumentException("No size with id " + id);
}
