parent
b2798b24cc
commit
5d01b02140
@ -0,0 +1,48 @@
|
|||||||
|
package xyz.wbsite.dl4j;
|
||||||
|
|
||||||
|
import cn.hutool.captcha.CaptchaUtil;
|
||||||
|
import cn.hutool.captcha.LineCaptcha;
|
||||||
|
import cn.hutool.captcha.generator.AbstractGenerator;
|
||||||
|
import cn.hutool.captcha.generator.CodeGenerator;
|
||||||
|
import cn.hutool.captcha.generator.RandomGenerator;
|
||||||
|
import cn.hutool.core.io.FileUtil;
|
||||||
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
|
||||||
|
public class CreateCaptcha {
|
||||||
|
|
||||||
|
public static void main(String[] args) {
|
||||||
|
File data = new File("data");
|
||||||
|
|
||||||
|
for (int i = 0; i < 3; i++) {
|
||||||
|
for (int j = 0; j < 3; j++) {
|
||||||
|
for (int k = 0; k < 3; k++) {
|
||||||
|
for (int l = 0; l < 3; l++) {
|
||||||
|
String value = String.valueOf(i) + j + k + l;
|
||||||
|
File file = FileUtil.file(data, value);
|
||||||
|
|
||||||
|
for (int m = 0; m < 10; m++) {
|
||||||
|
File filed = FileUtil.file(file, value + "_" + StrUtil.padPre(String.valueOf(m), 3, '0') + ".png");
|
||||||
|
LineCaptcha lineCaptcha = CaptchaUtil.createLineCaptcha(160, 40);
|
||||||
|
lineCaptcha.setGenerator(new CodeGenerator() {
|
||||||
|
@Override
|
||||||
|
public String generate() {
|
||||||
|
return value;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean verify(String s, String s1) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
lineCaptcha.createImage(value);
|
||||||
|
lineCaptcha.write(filed);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package xyz.wbsite.ai;
|
package xyz.wbsite.dl4j;
|
||||||
|
|
||||||
import org.nd4j.linalg.api.ndarray.INDArray;
|
import org.nd4j.linalg.api.ndarray.INDArray;
|
||||||
import org.nd4j.linalg.factory.Nd4j;
|
import org.nd4j.linalg.factory.Nd4j;
|
@ -1,4 +1,4 @@
|
|||||||
package xyz.wbsite.ai;
|
package xyz.wbsite.dl4j;
|
||||||
|
|
||||||
import org.apache.commons.io.FilenameUtils;
|
import org.apache.commons.io.FilenameUtils;
|
||||||
import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator;
|
import org.deeplearning4j.datasets.iterator.impl.MnistDataSetIterator;
|
Loading…
Reference in new issue