File tree Expand file tree Collapse file tree
src/main/java/com/example/ocrdesktop/control Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -33,8 +33,9 @@ public void updateModelNamesAndVersions() {
3333 }
3434
3535 // Regular expressions for extracting model name and version
36- Pattern detectionPattern = Pattern .compile ("detection-([A-Za-z0-9]+)-(\\ d+\\ .\\ d+)\\ .onnx" );
37- Pattern recognitionPattern = Pattern .compile ("recognition-([A-Za-z0-9]+)-(\\ d+\\ .\\ d+)\\ .onnx" );
36+ Pattern detectionPattern = Pattern .compile ("detection-([A-Za-z0-9-]+)-(\\ d+\\ .\\ d+)\\ .onnx" );
37+ Pattern recognitionPattern = Pattern .compile ("recognition-([A-Za-z0-9-]+)-(\\ d+\\ .\\ d+)\\ .onnx" );
38+
3839
3940 // Get all files in the directory
4041 File [] files = dir .listFiles ((d , name ) -> name .endsWith (".onnx" ));
@@ -48,7 +49,6 @@ public void updateModelNamesAndVersions() {
4849
4950 for (File file : files ) {
5051 String fileName = file .getName ();
51-
5252 // Match detection model
5353 Matcher detectionMatcher = detectionPattern .matcher (fileName );
5454 if (detectionMatcher .matches ()) {
You can’t perform that action at this time.
0 commit comments