Browse Source

init

master
diven 2 years ago
parent
commit
32d3f1844e
  1. 1
      open-anpr-core/src/test/java/com/visual/open/anpr/core/extract/PlateExtractorTest.java
  2. 4
      open-anpr-core/src/test/java/com/visual/open/anpr/core/models/TorchPlateDetectionTest.java
  3. 3
      open-anpr-core/src/test/java/com/visual/open/anpr/core/models/TorchPlateRecognitionTest.java

1
open-anpr-core/src/test/java/com/visual/open/anpr/core/extract/PlateExtractorTest.java

@ -27,7 +27,6 @@ public class PlateExtractorTest extends BaseTest {
PlateExtractor extractor = new PlateExtractorImpl(torchPlateDetection, torchPlateRecognition); PlateExtractor extractor = new PlateExtractorImpl(torchPlateDetection, torchPlateRecognition);
String imagePath = "open-anpr-core/src/test/resources/images"; String imagePath = "open-anpr-core/src/test/resources/images";
// String imagePath = "/Users/diven/workspace/pycharm/github/Chinese_license_plate_detection_recognition/imgs1/image001.jpg";
Map<String, String> map = getImagePathMap(imagePath); Map<String, String> map = getImagePathMap(imagePath);
for(String fileName : map.keySet()) { for(String fileName : map.keySet()) {
String imageFilePath = map.get(fileName); String imageFilePath = map.get(fileName);

4
open-anpr-core/src/test/java/com/visual/open/anpr/core/models/TorchPlateDetectionTest.java

@ -11,8 +11,8 @@ import java.util.List;
public class TorchPlateDetectionTest { public class TorchPlateDetectionTest {
public static void main(String[] args) { public static void main(String[] args) {
TorchPlateDetection torchPlateDetection = new TorchPlateDetection("open-anpr-core/src/main/resources/models/plate_detect.onnx", 1); TorchPlateDetection torchPlateDetection = new TorchPlateDetection("open-anpr-core/src/main/resources/models/plate_detect.onnx", 1);
// String imagePath = "/Users/diven/workspace/idea/gitee/open-anpr/open-anpr-core/src/test/resources/images/image003.jpg";
String imagePath = "/Users/diven/workspace/pycharm/github/Chinese_license_plate_detection_recognition/imgs3/double_yellow.jpg"; String imagePath = "open-anpr-core/src/test/resources/images";
ImageMat imageMat = ImageMat.fromImage(imagePath); ImageMat imageMat = ImageMat.fromImage(imagePath);
List<PlateInfo> plateInfos = torchPlateDetection.inference(imageMat, 0.3f,0.5f, new HashMap<>()); List<PlateInfo> plateInfos = torchPlateDetection.inference(imageMat, 0.3f,0.5f, new HashMap<>());
System.out.println(plateInfos); System.out.println(plateInfos);

3
open-anpr-core/src/test/java/com/visual/open/anpr/core/models/TorchPlateRecognitionTest.java

@ -14,8 +14,7 @@ public class TorchPlateRecognitionTest {
TorchPlateDetection torchPlateDetection = new TorchPlateDetection("open-anpr-core/src/main/resources/models/plate_detect.onnx", 1); TorchPlateDetection torchPlateDetection = new TorchPlateDetection("open-anpr-core/src/main/resources/models/plate_detect.onnx", 1);
TorchPlateRecognition torchPlateRecognition = new TorchPlateRecognition("open-anpr-core/src/main/resources/models/plate_rec_color.onnx", 1); TorchPlateRecognition torchPlateRecognition = new TorchPlateRecognition("open-anpr-core/src/main/resources/models/plate_rec_color.onnx", 1);
// String imagePath = "/Users/diven/workspace/pycharm/github/Chinese_license_plate_detection_recognition/imgs3/double_yellow.jpg"; String imagePath = "open-anpr-core/src/test/resources/images";
String imagePath = "/Users/diven/workspace/pycharm/github/Chinese_license_plate_detection_recognition/imgs2/image007.jpg";
ImageMat imageMat = ImageMat.fromImage(imagePath); ImageMat imageMat = ImageMat.fromImage(imagePath);
List<PlateInfo> plateInfos = torchPlateDetection.inference(imageMat, 0.3f,0.5f, new HashMap<>()); List<PlateInfo> plateInfos = torchPlateDetection.inference(imageMat, 0.3f,0.5f, new HashMap<>());
System.out.println(plateInfos); System.out.println(plateInfos);

Loading…
Cancel
Save