diff --git a/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/AAA.scala b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/AAA.scala new file mode 100644 index 0000000..89f2e4f --- /dev/null +++ b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/AAA.scala @@ -0,0 +1,20 @@ +package com.atguigu.spark.core.rdd.operator.transform + +import org.apache.spark.api.java.function.FilterFunction + +/** + * @ClassName aaa.java + * @author dingjiawen@xiaomi.com + * @version 1.0.0 + * @Description TODO + * @createTime 2023-07-19 18:44:00 + */ +class AAA(bbb: Int) extends FilterFunction[Int] { + + val cc = bbb + + override def call(t: Int): Boolean = { + println(cc) + return true + } +} diff --git a/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/CCC.scala b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/CCC.scala new file mode 100644 index 0000000..0073af1 --- /dev/null +++ b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/CCC.scala @@ -0,0 +1,18 @@ +package com.atguigu.spark.core.rdd.operator.transform + +/** + * @ClassName aaa.java + * @author dingjiawen@xiaomi.com + * @version 1.0.0 + * @Description TODO + * @createTime 2023-07-19 18:44:00 + */ +class CCC(bbb: Int) extends (Int => Boolean) with Serializable { + + val cc = bbb + + override def apply(t: Int): Boolean = { + println(cc) + return true + } +} diff --git a/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/HdfsToHolo_MessageSampler1.scala b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/HdfsToHolo_MessageSampler1.scala new file mode 100644 index 0000000..d080771 --- /dev/null +++ b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/HdfsToHolo_MessageSampler1.scala @@ -0,0 +1,69 @@ +package com.atguigu.spark.core.rdd.operator.transform + +import com.fasterxml.jackson.databind.ObjectMapper +import net.jpountz.xxhash.{XXHash64, XXHashFactory} +import org.apache.log4j.Logger +import org.apache.spark.api.java.function.FilterFunction + +import java.nio.ByteBuffer + +/** + * created by likunyi@xiaomi.com + * at 2022-04-29 15:32:00 + * 该算子会对收到的数据进行抽样, 留下一部分数据, 丢掉另一部分数据 + * + * samplingRate是采样率, 只能是整数 + * 当samplingRate = 10时, 代表采样率是10% + * 当samplingRate = 64时, 代表采样率是64% + */ +class HdfsToHolo_MessageSampler1(samplingRate: Int) extends FilterFunction[String] { + + @transient private var objectMapper: ObjectMapper = new ObjectMapper() + @transient private val greatestCommonDivisor = 100 + @transient private val NUMERATOR: Int = samplingRate / greatestCommonDivisor + @transient private val DENOMINATOR: Int = 100 / greatestCommonDivisor + @transient private val XXHASH_SEED: Long = 0x9747b28c + @transient private val hasher: XXHash64 = XXHashFactory.fastestInstance().hash64() + @transient private val logger: Logger = Logger.getLogger(this.getClass.getName) + + //初始化各项参数 + // def open(): Tuple5[ObjectMapper, Int, Int, Long, XXHash64] = { + // + // objectMapper = new ObjectMapper() + // + // val numerator = samplingRate // 分子就是采样率 + // val denominator = 100 // 分母永远是100 + // val greatestCommonDivisor = MathUtils.getGCD(numerator, denominator) + // + // NUMERATOR = numerator / greatestCommonDivisor + // DENOMINATOR = denominator / greatestCommonDivisor + // XXHASH_SEED = 0x9747b28c + // hasher = XXHashFactory.fastestInstance().hash64() + // (objectMapper,NUMERATOR,DENOMINATOR,XXHASH_SEED,hasher) + // } // open + + override def call(input: String): Boolean = { + logger.info(s"所有参数:【objectMapper:${objectMapper}】,【NUMERATOR:${NUMERATOR}】,【DENOMINATOR:${DENOMINATOR}】,【hasher:${hasher}】") + logger.info(s"${input}") + + + // 如果不抽样(即抽样率是100%), 则直接将数据传递给下游, 不做任何处理 + if (samplingRate == 100) { + return true + } + + val currentMessage = objectMapper.readTree(input) + + // 如需抽样(即抽样率不是100%), 则使用distinct_id的哈希值去做抽样 + if (hash(currentMessage.get("distinct_id").asText()) % DENOMINATOR < NUMERATOR) { // 粗略地讲: 若采样率是64%, 则就将distinct_id的哈希值对100取余, 余数为0到63的都留下, 余数为64到99的都扔掉 + return true + } else { + return false + } + } + + private def hash(distinct_id: String): Long = { + Math.abs(hasher.hash(ByteBuffer.wrap(distinct_id.getBytes("UTF-8")), XXHASH_SEED)) + } // hash + +} diff --git a/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/Spark01_RDD_Operator_Transform.scala b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/Spark01_RDD_Operator_Transform.scala index a2259d4..6853d0c 100644 --- a/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/Spark01_RDD_Operator_Transform.scala +++ b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/Spark01_RDD_Operator_Transform.scala @@ -1,5 +1,6 @@ package com.atguigu.spark.core.rdd.operator.transform +import org.apache.spark.rdd.RDD import org.apache.spark.{SparkConf, SparkContext} object Spark01_RDD_Operator_Transform { @@ -11,7 +12,7 @@ object Spark01_RDD_Operator_Transform { val sc =new SparkContext(sparkConf) //TODO 算子 - map - val rdd = sc.makeRDD( + val rdd: RDD[Int] = sc.makeRDD( List(1,2,3,4) ) diff --git a/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/Spark08_RDD_Operator_Transform.scala b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/Spark08_RDD_Operator_Transform.scala index 82c0f10..14a7204 100644 --- a/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/Spark08_RDD_Operator_Transform.scala +++ b/Big_data_example/Spark/src/main/java/com/atguigu/spark/core/rdd/operator/transform/Spark08_RDD_Operator_Transform.scala @@ -1,9 +1,5 @@ package com.atguigu.spark.core.rdd.operator.transform -import java.text.SimpleDateFormat -import java.util.Date - -import org.apache.spark.rdd.RDD import org.apache.spark.{SparkConf, SparkContext} /** @@ -11,21 +7,25 @@ import org.apache.spark.{SparkConf, SparkContext} */ object Spark08_RDD_Operator_Transform { - def main(args: Array[String]): Unit = { + def main(args: Array[String]): Unit = { - val sparkConf = new SparkConf().setMaster("local[*]").setAppName("Operator") - //创建上下文环境对象 - val sc =new SparkContext(sparkConf) + val sparkConf = new SparkConf().setMaster("local[*]").setAppName("Operator") + //创建上下文环境对象 + val sc = new SparkContext(sparkConf) - //TODO 算子 - filter - val rdd = sc.makeRDD( - List(1,2,3,4) - ) + //TODO 算子 - filter + val rdd = sc.makeRDD( + List(1, 2, 3, 4) + ) - val filterRDD = rdd.filter(_ % 2 == 0) + val filterRDD = rdd.filter( + new CCC(10) + ) - filterRDD.collect().foreach(println(_)) + // val filterRDD = rdd.filter(_ % 2 == 0) - sc.stop() - } + filterRDD.collect().foreach(println(_)) + + sc.stop() + } } diff --git a/Big_data_example/Spark/src/main/java/com/atguigu/spark/streaming/SparkStreaming02_Queue.scala b/Big_data_example/Spark/src/main/java/com/atguigu/spark/streaming/SparkStreaming02_Queue.scala index bc0005f..8d04cbd 100644 --- a/Big_data_example/Spark/src/main/java/com/atguigu/spark/streaming/SparkStreaming02_Queue.scala +++ b/Big_data_example/Spark/src/main/java/com/atguigu/spark/streaming/SparkStreaming02_Queue.scala @@ -2,7 +2,7 @@ package com.atguigu.spark.streaming import org.apache.spark.SparkConf import org.apache.spark.rdd.RDD -import org.apache.spark.streaming.dstream.ReceiverInputDStream +import org.apache.spark.streaming.dstream.{InputDStream, ReceiverInputDStream} import org.apache.spark.streaming.{Seconds, StreamingContext} import scala.collection.mutable @@ -27,7 +27,7 @@ object SparkStreaming02_Queue { val rddQueue = new mutable.Queue[RDD[Int]]() //4.创建QueueInputDStream - val inputStream = ssc.queueStream(rddQueue,oneAtATime = false) + val inputStream: InputDStream[Int] = ssc.queueStream(rddQueue,oneAtATime = false) //5.处理队列中的RDD数据 diff --git a/Big_data_example/Spark/src/main/java/com/atguigu/spark/streaming/SparkStreaming06_state_transform.scala b/Big_data_example/Spark/src/main/java/com/atguigu/spark/streaming/SparkStreaming06_state_transform.scala index a23692d..0d0ac2b 100644 --- a/Big_data_example/Spark/src/main/java/com/atguigu/spark/streaming/SparkStreaming06_state_transform.scala +++ b/Big_data_example/Spark/src/main/java/com/atguigu/spark/streaming/SparkStreaming06_state_transform.scala @@ -29,10 +29,10 @@ object SparkStreaming06_state_transform { //和直接map的区别:写code的位置 //Driver端 val newDS: DStream[String] = lines.transform( - rdd =>{ + rdd => { //code:Driver端,(周期性执行) rdd.map( - str =>{ + str => { //code:Executor端 str } @@ -42,7 +42,7 @@ object SparkStreaming06_state_transform { //code:Driver端 val newDS1: DStream[String] = lines.map( - str =>{ + str => { //code:executor端,无周期性执行 str } diff --git a/Big_data_example/rt-gmall-parent/gmall-realtime/src/main/java/com/atguigu/gmall/realtime/app/dwm/GenerateRPN.scala b/Big_data_example/rt-gmall-parent/gmall-realtime/src/main/java/com/atguigu/gmall/realtime/app/dwm/GenerateRPN.scala new file mode 100644 index 0000000..b622dc9 --- /dev/null +++ b/Big_data_example/rt-gmall-parent/gmall-realtime/src/main/java/com/atguigu/gmall/realtime/app/dwm/GenerateRPN.scala @@ -0,0 +1,102 @@ +package com.atguigu.gmall.realtime.app.dwm + +import scala.collection.mutable + +/** + * @ClassName GenerateRPN.java + * @author dingjiawen@xiaomi.com + * @version 1.0.0 + * @Description TODO + * @createTime 2023-06-30 17:27:00 + */ +object GenerateRPN { + + def main(args: Array[String]): Unit = { + //测试用例 + //String str = "1+2*3-4*5-6+7*8-9"; //123*+45*-6-78*+9- +// var str = "1 + 2 * 3 - 4 * 5 - (6 + 7 * 8 - 9)"; //123*+45*-6-78*+9- +// var str = "5 + 2 * 3"; //123*+45*-6-78*+9- + var str = "6 * ( 5 + ( 2 + 3 ) * 8 + 3 )"; //6523+8*+3+* + var RPNStack: Array[String] = generateRPN(str) + println(RPNStack.mkString(",")) + println(evalRPN(RPNStack)) + } + + def generateRPN(expression: String): Array[String] = { + val precedence = Map("+" -> 1, "-" -> 1, "*" -> 2, "/" -> 2) + val output = mutable.Stack[String]() + val stack = mutable.Stack[String]() + + def isOperator(token: String): Boolean = { + precedence.contains(token) } + + def hasHigherPrecedence(op1: String, op2: String): Boolean = { + precedence(op1) >= precedence(op2) + } + + def processOperator(op: String): Unit = { + while (stack.nonEmpty && isOperator(stack.top) && hasHigherPrecedence(stack.top, op)) { + output.push(stack.pop()) + } + stack.push(op) + } + + def processOperand(operand: String): Unit = { + output.push(operand) + } + + def processParenthesis(): Unit = { + while (stack.nonEmpty && stack.top != "(") { + output.push(stack.pop()) + } + stack.pop() // 弹出左括号 + } + + for (token <- expression.split("\\s+")) { + token match { + case "(" => stack.push(token) + case ")" => processParenthesis() + case t if isOperator(t) => processOperator(t) + case _ => processOperand(token) + } + } + + while (stack.nonEmpty) { + output.push(stack.pop()) + } + + output.toArray.reverse + } + + def evalRPN(tokens: Array[String]): Int = { + val stack = mutable.Stack[Int]() + + for (token <- tokens) { + if (isOperator(token)) { + val operand2 = stack.pop() + val operand1 = stack.pop() + val result = performOperation(token, operand1, operand2) + stack.push(result) + } else { + stack.push(token.toInt) + } + } + + stack.pop() + } + + def isOperator(token: String): Boolean = { + token == "+" || token == "-" || token == "*" || token == "/" + } + + def performOperation(operator: String, operand1: Int, operand2: Int): Int = { + operator match { + case "+" => operand1 + operand2 + case "-" => operand1 - operand2 + case "*" => operand1 * operand2 + case "/" => operand1 / operand2 + } + } + + +} diff --git a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/AAA.scala b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/AAA.scala new file mode 100644 index 0000000..8411e68 --- /dev/null +++ b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/AAA.scala @@ -0,0 +1,10 @@ +package com.atguigu.scala + +class AAA(bbb:BBB) { + + def open(): Unit = { + bbb.open() + println("aaaOpen") + } + +} diff --git a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/BBB.scala b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/BBB.scala new file mode 100644 index 0000000..416d02d --- /dev/null +++ b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/BBB.scala @@ -0,0 +1,15 @@ +package com.atguigu.scala + +class BBB { + + def this(a:Int,b:Int) { + this() + println(a) + println(b) + } + + def open() ={ + println("open") + } + +} diff --git a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter03/Scala02_Oper.scala b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter03/Scala02_Oper.scala index ab3f12f..7b028e2 100644 --- a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter03/Scala02_Oper.scala +++ b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter03/Scala02_Oper.scala @@ -1,6 +1,6 @@ package com.atguigu.scala.chapter03 -import com.atguigu.scala.test.User +import com.atguigu.scala.test1.User object Scala02_Oper { diff --git a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter06/Scala09_Object_Instance_4.scala b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter06/Scala09_Object_Instance_4.scala index 9e8a9f5..a9dc5bd 100644 --- a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter06/Scala09_Object_Instance_4.scala +++ b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter06/Scala09_Object_Instance_4.scala @@ -1,6 +1,6 @@ package com.atguigu.scala.chapter06 -import com.atguigu.scala.test.ScalaUser +import com.atguigu.scala.test1.ScalaUser object Scala09_Object_Instance_4 { diff --git a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter06/Scala09_Object_Instance_5.scala b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter06/Scala09_Object_Instance_5.scala index 55f6f31..098ec2e 100644 --- a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter06/Scala09_Object_Instance_5.scala +++ b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter06/Scala09_Object_Instance_5.scala @@ -1,6 +1,6 @@ package com.atguigu.scala.chapter06 -import com.atguigu.scala.test.ScalaUser +import com.atguigu.scala.test1.ScalaUser object Scala09_Object_Instance_5 { diff --git a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter10/Scala05_Transform.scala b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter10/Scala05_Transform.scala index 829b6e6..cebf9c8 100644 --- a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter10/Scala05_Transform.scala +++ b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/chapter10/Scala05_Transform.scala @@ -14,7 +14,7 @@ object Scala05_Transform extends Parent with MyTrait { //TODO 3.特征或伴生对象 //TODO 4.其他地方声明(包对象) //TODO 5.直接导入 - import com.atguigu.scala.test.TestTransform._ + import com.atguigu.scala.test1.TestTransform._ val user=new User() user.insertUser() user.updateUser() diff --git a/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/test111.scala b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/test111.scala new file mode 100644 index 0000000..78db09f --- /dev/null +++ b/Big_data_example/scala/scala0224/src/main/java/com/atguigu/scala/test111.scala @@ -0,0 +1,9 @@ +package com.atguigu.scala + +object test111 { + + def main(args: Array[String]): Unit = { + new AAA(new BBB(1,2)).open() + } + +} diff --git a/GE_Migrating_data/src/main/java/com/cqu/ge/DataServiceImplTest.java b/GE_Migrating_data/src/main/java/com/cqu/ge/DataServiceImplTest.java index 54cef0b..db482e0 100644 --- a/GE_Migrating_data/src/main/java/com/cqu/ge/DataServiceImplTest.java +++ b/GE_Migrating_data/src/main/java/com/cqu/ge/DataServiceImplTest.java @@ -185,6 +185,7 @@ public class DataServiceImplTest { assertEquals(tagName1, result.get(0).getTagName()); assertEquals(tagName2, result.get(1).getTagName()); + // if (result.get(0).getTagName().equals(tagName1) && result.get(1).getTagName().equals(tagName2)) { // DataSample[] datasamples1 = result.get(0).getSamples(); // DataSample[] datasamples2 = result.get(1).getSamples(); diff --git a/Leecode/hs_err_pid12532.log b/Leecode/hs_err_pid12532.log deleted file mode 100644 index 4d200d7..0000000 --- a/Leecode/hs_err_pid12532.log +++ /dev/null @@ -1,264 +0,0 @@ -# -# A fatal error has been detected by the Java Runtime Environment: -# -# EXCEPTION_ACCESS_VIOLATION (0xc0000005) at pc=0x000000006abea148, pid=12532, tid=0x0000000000004e18 -# -# JRE version: Java(TM) SE Runtime Environment (8.0_311-b11) (build 1.8.0_311-b11) -# Java VM: Java HotSpot(TM) 64-Bit Server VM (25.311-b11 mixed mode windows-amd64 compressed oops) -# Problematic frame: -# V [jvm.dll+0x19a148] -# -# Failed to write core dump. Minidumps are not enabled by default on client versions of Windows -# -# If you would like to submit a bug report, please visit: -# http://bugreport.java.com/bugreport/crash.jsp -# - ---------------- T H R E A D --------------- - -Current thread (0x000002d51ddc9000): JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=19992, stack(0x000000ec02500000,0x000000ec02600000)] - -siginfo: ExceptionCode=0xc0000005, reading address 0x000002d51d8e2018 - -Registers: -RAX=0x000002d51d7786d0, RBX=0x0000000000000003, RCX=0x000002d51d8e2008, RDX=0x000002d51d779200 -RSP=0x000000ec025ff7b0, RBP=0x000000ec025ff829, RSI=0x00000000000000b6, RDI=0x000002d51d779268 -R8 =0x000002d51d779aa8, R9 =0x00007ffedf820000, R10=0x000002d51d779211, R11=0x000002d51fea87d9 -R12=0x000002d51fea87d8, R13=0x000000ec025ff8b0, R14=0x000000000000005b, R15=0x00000000000000b6 -RIP=0x000000006abea148, EFLAGS=0x0000000000010202 - -Top of Stack: (sp=0x000000ec025ff7b0) -0x000000ec025ff7b0: 000002d51ddc9000 00000000000000b6 -0x000000ec025ff7c0: 0000000000000003 000002d51ddc9000 -0x000000ec025ff7d0: 000002d51d779268 000002d51d779268 -0x000000ec025ff7e0: 000002d51d779268 000002d51d779268 -0x000000ec025ff7f0: 000002d51ddc9000 000002d51d779268 -0x000000ec025ff800: 000002d51ddc9000 000002d51d779268 -0x000000ec025ff810: 000002d51ddc9000 0000005b00000058 -0x000000ec025ff820: 000000b600000072 000000006ac50000 -0x000000ec025ff830: 00000000000000b6 0000000000000000 -0x000000ec025ff840: 0000000000000000 0000000000000072 -0x000000ec025ff850: 000000ec025ff9c0 0000000000000000 -0x000000ec025ff860: 0000000000000000 000000ec025ff9c8 -0x000000ec025ff870: 000002d51ddc9000 000002d51d779268 -0x000000ec025ff880: 0000000000000000 000000006abef64f -0x000000ec025ff890: 000000ec025ff8b0 000002d51fea87d8 -0x000000ec025ff8a0: 000002d507c50a01 000002d51d779268 - -Instructions: (pc=0x000000006abea148) -0x000000006abea128: 10 84 d2 74 0b 41 8b 45 31 f7 d0 48 63 c8 eb 05 -0x000000006abea138: 41 0f b7 4d 31 4c 8b 6d 67 48 c1 e1 05 49 03 c8 -0x000000006abea148: 48 8b 49 10 44 8b 75 f3 0f b6 c1 66 c1 e0 08 66 -0x000000006abea158: c1 e9 08 66 0b c1 66 41 89 44 24 01 84 d2 0f 84 - - -Register to memory mapping: - -RAX=0x000002d51d7786d0 is pointing into metadata -RBX=0x0000000000000003 is an unknown value -RCX=0x000002d51d8e2008 is an unknown value -RDX=0x000002d51d779200 is pointing into metadata -RSP=0x000000ec025ff7b0 is pointing into the stack for thread: 0x000002d51ddc9000 -RBP=0x000000ec025ff829 is pointing into the stack for thread: 0x000002d51ddc9000 -RSI=0x00000000000000b6 is an unknown value -RDI={method} {0x000002d51d779270} 'test' '()V' in 'com/markilue/leecode/listnode/MyLinkedList' -R8 =0x000002d51d779aa8 is pointing into metadata -R9 =0x00007ffedf820000 is an unknown value -R10=0x000002d51d779211 is pointing into metadata -R11=0x000002d51fea87d9 is an unknown value -R12=0x000002d51fea87d8 is an unknown value -R13=0x000000ec025ff8b0 is pointing into the stack for thread: 0x000002d51ddc9000 -R14=0x000000000000005b is an unknown value -R15=0x00000000000000b6 is an unknown value - - -Stack: [0x000000ec02500000,0x000000ec02600000], sp=0x000000ec025ff7b0, free space=1021k -Native frames: (J=compiled Java code, j=interpreted, Vv=VM code, C=native code) -V [jvm.dll+0x19a148] -V [jvm.dll+0x19f64f] -V [jvm.dll+0x3408eb] -C [jdwp.dll+0x4296] -C [jdwp.dll+0xef91] -C [jdwp.dll+0x1f4f5] -C [jdwp.dll+0x1f45e] -V [jvm.dll+0x1ba3aa] -V [jvm.dll+0x23df22] -V [jvm.dll+0x29253c] -C [ucrtbase.dll+0x21bb2] -C [KERNEL32.DLL+0x17034] -C [ntdll.dll+0x52651] - - ---------------- P R O C E S S --------------- - -Java Threads: ( => current thread ) - 0x000002d51fc40800 JavaThread "Service Thread" daemon [_thread_blocked, id=21716, stack(0x000000ec02c00000,0x000000ec02d00000)] - 0x000002d51fba9000 JavaThread "C1 CompilerThread3" daemon [_thread_blocked, id=14316, stack(0x000000ec02b00000,0x000000ec02c00000)] - 0x000002d51fb9e800 JavaThread "C2 CompilerThread2" daemon [_thread_blocked, id=19840, stack(0x000000ec02a00000,0x000000ec02b00000)] - 0x000002d51fb9d800 JavaThread "C2 CompilerThread1" daemon [_thread_blocked, id=16824, stack(0x000000ec02900000,0x000000ec02a00000)] - 0x000002d51fb9b000 JavaThread "C2 CompilerThread0" daemon [_thread_blocked, id=12300, stack(0x000000ec02800000,0x000000ec02900000)] - 0x000002d51faf3800 JavaThread "JDWP Command Reader" daemon [_thread_in_native, id=2456, stack(0x000000ec02700000,0x000000ec02800000)] - 0x000002d51faf0800 JavaThread "JDWP Event Helper Thread" daemon [_thread_blocked, id=9096, stack(0x000000ec02600000,0x000000ec02700000)] -=>0x000002d51ddc9000 JavaThread "JDWP Transport Listener: dt_socket" daemon [_thread_in_vm, id=19992, stack(0x000000ec02500000,0x000000ec02600000)] - 0x000002d51ddbc000 JavaThread "Attach Listener" daemon [_thread_blocked, id=18836, stack(0x000000ec02400000,0x000000ec02500000)] - 0x000002d51dd67800 JavaThread "Signal Dispatcher" daemon [_thread_blocked, id=21684, stack(0x000000ec02300000,0x000000ec02400000)] - 0x000002d51dd39000 JavaThread "Finalizer" daemon [_thread_blocked, id=10800, stack(0x000000ec02200000,0x000000ec02300000)] - 0x000002d51dd30800 JavaThread "Reference Handler" daemon [_thread_blocked, id=21884, stack(0x000000ec02100000,0x000000ec02200000)] - 0x000002d507b9a800 JavaThread "main" [_thread_blocked, id=16780, stack(0x000000ec01700000,0x000000ec01800000)] - -Other Threads: - 0x000002d51dd06800 VMThread [stack: 0x000000ec02000000,0x000000ec02100000] [id=3664] - 0x000002d51fc59000 WatcherThread [stack: 0x000000ec02d00000,0x000000ec02e00000] [id=15732] - -VM state:not at safepoint (normal execution) - -VM Mutex/Monitor currently owned by a thread: None - -heap address: 0x0000000081c00000, size: 2020 MB, Compressed Oops mode: 32-bit -Narrow klass base: 0x0000000000000000, Narrow klass shift: 3 -Compressed class space size: 1073741824 Address: 0x0000000100000000 - -Heap: - PSYoungGen total 38400K, used 10018K [0x00000000d5f00000, 0x00000000d8980000, 0x0000000100000000) - eden space 33280K, 30% used [0x00000000d5f00000,0x00000000d68c8bd8,0x00000000d7f80000) - from space 5120K, 0% used [0x00000000d8480000,0x00000000d8480000,0x00000000d8980000) - to space 5120K, 0% used [0x00000000d7f80000,0x00000000d7f80000,0x00000000d8480000) - ParOldGen total 87552K, used 0K [0x0000000081c00000, 0x0000000087180000, 0x00000000d5f00000) - object space 87552K, 0% used [0x0000000081c00000,0x0000000081c00000,0x0000000087180000) - Metaspace used 5032K, capacity 5348K, committed 5504K, reserved 1056768K - class space used 579K, capacity 595K, committed 640K, reserved 1048576K - -Card table byte_map: [0x000002d518910000,0x000002d518d10000] byte_map_base: 0x000002d518502000 - -Marking Bits: (ParMarkBitMap*) 0x000000006b238030 - Begin Bits: [0x000002d518fc0000, 0x000002d51af50000) - End Bits: [0x000002d51af50000, 0x000002d51cee0000) - -Polling page: 0x000002d507cf0000 - -CodeCache: size=245760Kb used=1754Kb max_used=1771Kb free=244005Kb - bounds [0x000002d509550000, 0x000002d5097c0000, 0x000002d518550000] - total_blobs=523 nmethods=259 adapters=185 - compilation: enabled - -Compilation events (10 events): -Event: 0.989 Thread 0x000002d51fba9000 256 3 java.io.File::isInvalid (47 bytes) -Event: 0.989 Thread 0x000002d51fba9000 nmethod 256 0x000002d5096ffdd0 code [0x000002d5096fff40, 0x000002d509700390] -Event: 0.989 Thread 0x000002d51fb9e800 257 4 sun.misc.MetaIndex::mayContain (51 bytes) -Event: 0.991 Thread 0x000002d51fb9b000 nmethod 243 0x000002d509704390 code [0x000002d5097045c0, 0x000002d509705850] -Event: 0.994 Thread 0x000002d51fba9000 258 3 java.lang.Character::charCount (12 bytes) -Event: 0.994 Thread 0x000002d51fba9000 nmethod 258 0x000002d509704010 code [0x000002d509704160, 0x000002d5097042f8] -Event: 0.997 Thread 0x000002d51fb9e800 nmethod 257 0x000002d509706e10 code [0x000002d509706f60, 0x000002d509707498] -Event: 1.000 Thread 0x000002d51fba9000 259 1 java.nio.Buffer::limit (5 bytes) -Event: 1.000 Thread 0x000002d51fba9000 nmethod 259 0x000002d509703d50 code [0x000002d509703ea0, 0x000002d509703fb8] -Event: 1.017 Thread 0x000002d51fb9d800 nmethod 253 0x000002d50970a7d0 code [0x000002d50970aa80, 0x000002d50970c1a8] - -GC Heap History (0 events): -No events - -Deoptimization events (0 events): -No events - -Classes redefined (6 events): -Event: 120.821 Thread 0x000002d51dd06800 redefined class name=com.markilue.leecode.listnode.MyLinkedList, count=1 -Event: 120.822 Thread 0x000002d51dd06800 redefined class name=com.markilue.leecode.listnode.ListNode, count=1 -Event: 164.527 Thread 0x000002d51dd06800 redefined class name=com.markilue.leecode.listnode.MyLinkedList, count=2 -Event: 164.528 Thread 0x000002d51dd06800 redefined class name=com.markilue.leecode.listnode.ListNode, count=2 -Event: 308.152 Thread 0x000002d51dd06800 redefined class name=com.markilue.leecode.listnode.MyLinkedList, count=3 -Event: 308.152 Thread 0x000002d51dd06800 redefined class name=com.markilue.leecode.listnode.ListNode, count=3 - -Internal exceptions (7 events): -Event: 0.110 Thread 0x000002d507b9a800 Exception (0x00000000d5f07cc0) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u311\1894\hot -Event: 0.110 Thread 0x000002d507b9a800 Exception (0x00000000d5f07fa8) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u311\1894\hotspot\src\share\vm\ -Event: 0.817 Thread 0x000002d507b9a800 Exception (0x00000000d62ad468) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u311\1894\hotspot\src\share\vm\prims\jni.cpp, line 710] -Event: 0.848 Thread 0x000002d507b9a800 Exception (0x00000000d638d038) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u311\1894\hotspot\src\share\vm\prims\jvm.cpp, line 1523] -Event: 0.848 Thread 0x000002d507b9a800 Exception (0x00000000d638d430) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u311\1894\hotspot\src\share\vm\prims\jvm.cpp, line 1523] -Event: 0.849 Thread 0x000002d507b9a800 Exception (0x00000000d638fb28) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u311\1894\hotspot\src\share\vm\prims\jvm.cpp, line 1523] -Event: 0.849 Thread 0x000002d507b9a800 Exception (0x00000000d638ff20) thrown at [C:\jenkins\workspace\8-2-build-windows-amd64-cygwin\jdk8u311\1894\hotspot\src\share\vm\prims\jvm.cpp, line 1523] - -Events (10 events): -Event: 1527.523 Executing VM operation: GetOrSetLocal -Event: 1527.523 Executing VM operation: GetOrSetLocal done -Event: 1559.202 Executing VM operation: ChangeBreakpoints -Event: 1559.202 Executing VM operation: ChangeBreakpoints done -Event: 1559.805 Executing VM operation: ChangeBreakpoints -Event: 1559.805 Executing VM operation: ChangeBreakpoints done -Event: 1573.008 Executing VM operation: ChangeBreakpoints -Event: 1573.008 Executing VM operation: ChangeBreakpoints done -Event: 1581.175 Executing VM operation: ChangeBreakpoints -Event: 1581.176 Executing VM operation: ChangeBreakpoints done - - -Dynamic libraries: -0x00007ff61b6b0000 - 0x00007ff61b6f7000 E:\Java\JDK8\bin\java.exe -0x00007ffee8f90000 - 0x00007ffee9188000 C:\WINDOWS\SYSTEM32\ntdll.dll -0x00007ffee7cf0000 - 0x00007ffee7dad000 C:\WINDOWS\System32\KERNEL32.DLL -0x00007ffee6a20000 - 0x00007ffee6cee000 C:\WINDOWS\System32\KERNELBASE.dll -0x00007ffee8050000 - 0x00007ffee80fe000 C:\WINDOWS\System32\ADVAPI32.dll -0x00007ffee7560000 - 0x00007ffee75fe000 C:\WINDOWS\System32\msvcrt.dll -0x00007ffee8dd0000 - 0x00007ffee8e6c000 C:\WINDOWS\System32\sechost.dll -0x00007ffee8990000 - 0x00007ffee8ab5000 C:\WINDOWS\System32\RPCRT4.dll -0x00007ffee7eb0000 - 0x00007ffee8050000 C:\WINDOWS\System32\USER32.dll -0x00007ffee6880000 - 0x00007ffee68a2000 C:\WINDOWS\System32\win32u.dll -0x00007ffee8170000 - 0x00007ffee819a000 C:\WINDOWS\System32\GDI32.dll -0x00007ffee6e40000 - 0x00007ffee6f4b000 C:\WINDOWS\System32\gdi32full.dll -0x00007ffee6f50000 - 0x00007ffee6fed000 C:\WINDOWS\System32\msvcp_win.dll -0x00007ffee6cf0000 - 0x00007ffee6df0000 C:\WINDOWS\System32\ucrtbase.dll -0x00007ffed59c0000 - 0x00007ffed5c5a000 C:\WINDOWS\WinSxS\amd64_microsoft.windows.common-controls_6595b64144ccf1df_6.0.19041.1110_none_60b5254171f9507e\COMCTL32.dll -0x00007ffee88f0000 - 0x00007ffee8920000 C:\WINDOWS\System32\IMM32.DLL -0x00007ffedf820000 - 0x00007ffedf835000 E:\Java\JDK8\jre\bin\vcruntime140.dll -0x00007ffebd920000 - 0x00007ffebd9bb000 E:\Java\JDK8\jre\bin\msvcp140.dll -0x000000006aa50000 - 0x000000006b2b0000 E:\Java\JDK8\jre\bin\server\jvm.dll -0x00007ffee7ce0000 - 0x00007ffee7ce8000 C:\WINDOWS\System32\PSAPI.DLL -0x00007ffed2a20000 - 0x00007ffed2a29000 C:\WINDOWS\SYSTEM32\WSOCK32.dll -0x00007ffed5e10000 - 0x00007ffed5e37000 C:\WINDOWS\SYSTEM32\WINMM.dll -0x00007ffedfb10000 - 0x00007ffedfb1a000 C:\WINDOWS\SYSTEM32\VERSION.dll -0x00007ffee8100000 - 0x00007ffee816b000 C:\WINDOWS\System32\WS2_32.dll -0x00007ffee4f90000 - 0x00007ffee4fa2000 C:\WINDOWS\SYSTEM32\kernel.appcore.dll -0x00007ffee0460000 - 0x00007ffee0470000 E:\Java\JDK8\jre\bin\verify.dll -0x00007ffedf7f0000 - 0x00007ffedf81b000 E:\Java\JDK8\jre\bin\java.dll -0x00007ffedb7d0000 - 0x00007ffedb806000 E:\Java\JDK8\jre\bin\jdwp.dll -0x00007ffee1c90000 - 0x00007ffee1c99000 E:\Java\JDK8\jre\bin\npt.dll -0x00007ffedf8f0000 - 0x00007ffedf920000 E:\Java\JDK8\jre\bin\instrument.dll -0x00007ffedef10000 - 0x00007ffedef28000 E:\Java\JDK8\jre\bin\zip.dll -0x00007ffee81a0000 - 0x00007ffee88e4000 C:\WINDOWS\System32\SHELL32.dll -0x00007ffee4790000 - 0x00007ffee4f24000 C:\WINDOWS\SYSTEM32\windows.storage.dll -0x00007ffee6ff0000 - 0x00007ffee7344000 C:\WINDOWS\System32\combase.dll -0x00007ffee6110000 - 0x00007ffee6140000 C:\WINDOWS\SYSTEM32\Wldp.dll -0x00007ffee7a70000 - 0x00007ffee7b1d000 C:\WINDOWS\System32\SHCORE.dll -0x00007ffee7e30000 - 0x00007ffee7e85000 C:\WINDOWS\System32\shlwapi.dll -0x00007ffee65f0000 - 0x00007ffee660f000 C:\WINDOWS\SYSTEM32\profapi.dll -0x00007ffedf850000 - 0x00007ffedf85a000 E:\Java\JDK8\jre\bin\dt_socket.dll -0x00007ffee5e70000 - 0x00007ffee5eda000 C:\WINDOWS\system32\mswsock.dll -0x00007ffee44a0000 - 0x00007ffee4684000 C:\WINDOWS\SYSTEM32\dbghelp.dll -0x00007ffee68e0000 - 0x00007ffee6962000 C:\WINDOWS\System32\bcryptPrimitives.dll - -VM Arguments: -jvm_args: -agentlib:jdwp=transport=dt_socket,address=127.0.0.1:5541,suspend=y,server=n -ea -Didea.test.cyclic.buffer.size=1048576 -javaagent:C:\Users\marklue\AppData\Local\JetBrains\IntelliJIdea2021.1\captureAgent\debugger-agent.jar -Dfile.encoding=UTF-8 -java_command: com.intellij.rt.junit.JUnitStarter -ideVersion5 -junit4 com.markilue.leecode.listnode.MyLinkedList,test -java_class_path (initial): D:\software\JetBrains\IntelliJ IDEA 2021.1\lib\idea_rt.jar;D:\software\JetBrains\IntelliJ IDEA 2021.1\plugins\junit\lib\junit5-rt.jar;D:\software\JetBrains\IntelliJ IDEA 2021.1\plugins\junit\lib\junit-rt.jar;E:\Java\JDK8\jre\lib\charsets.jar;E:\Java\JDK8\jre\lib\deploy.jar;E:\Java\JDK8\jre\lib\ext\access-bridge-64.jar;E:\Java\JDK8\jre\lib\ext\cldrdata.jar;E:\Java\JDK8\jre\lib\ext\dnsns.jar;E:\Java\JDK8\jre\lib\ext\jaccess.jar;E:\Java\JDK8\jre\lib\ext\jfxrt.jar;E:\Java\JDK8\jre\lib\ext\localedata.jar;E:\Java\JDK8\jre\lib\ext\nashorn.jar;E:\Java\JDK8\jre\lib\ext\sunec.jar;E:\Java\JDK8\jre\lib\ext\sunjce_provider.jar;E:\Java\JDK8\jre\lib\ext\sunmscapi.jar;E:\Java\JDK8\jre\lib\ext\sunpkcs11.jar;E:\Java\JDK8\jre\lib\ext\zipfs.jar;E:\Java\JDK8\jre\lib\javaws.jar;E:\Java\JDK8\jre\lib\jce.jar;E:\Java\JDK8\jre\lib\jfr.jar;E:\Java\JDK8\jre\lib\jfxswt.jar;E:\Java\JDK8\jre\lib\jsse.jar;E:\Java\JDK8\jre\lib\management-agent.jar;E:\Java\JDK8\jre\lib\plugin.jar;E:\Java\JDK8\jre\lib\resources.jar;E:\Java\JDK8\jre\lib\rt.jar;D:\example\self_example\Leecode\target\classes;E:\maven\apache-maven-3.5.4-bin\RepMaven\org\projectlombok\lombok\1.18.24\lombok-1.18.24.jar;E:\maven\apache-maven-3.5.4-bin\RepMaven\junit\junit\4.13.2\junit-4.13.2.jar;E:\maven\apache-maven-3.5.4-bin\RepMaven\org\hamcrest\hamcrest-core\1.3\hamcrest-core-1.3.jar;C:\Users\marklue\AppData\Local\JetBrains\IntelliJIdea2021.1\captureAgent\debugger-agent.jar -Launcher Type: SUN_STANDARD - -Environment Variables: -JAVA_HOME=E:\Java\JDK8 -PATH=C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;D:\software\RARѹ\Bandizip\;D:\;oftware\nodejs\;E:\Java\JDK8\bin;E:\maven\apache-maven-3.5.4-bin\apache-maven-3.5.4\bin;E:\scala\scala-2.12.11\bin;D:\software\anaconda\pkgs\python-3.7.11-h6244533_0;D:\software\anaconda\Scripts;D:\software\Git\Git\cmd;D:\software\nodejs;C:\Users\marklue\AppData\Local\Microsoft\WindowsApps;C:\Users\marklue\AppData\Roaming\npm;D:\software\JetBrains\PyCharm 2020.1\bin; -USERNAME=marklue -OS=Windows_NT -PROCESSOR_IDENTIFIER=Intel64 Family 6 Model 142 Stepping 10, GenuineIntel - - - ---------------- S Y S T E M --------------- - -OS: Windows 10.0 , 64 bit Build 19041 (10.0.19041.1806) - -CPU:total 8 (initial active 8) (4 cores per cpu, 2 threads per core) family 6 model 142 stepping 10, cmov, cx8, fxsr, mmx, sse, sse2, sse3, ssse3, sse4.1, sse4.2, popcnt, avx, avx2, aes, clmul, erms, 3dnowpref, lzcnt, ht, tsc, tscinvbit, bmi1, bmi2, adx - -Memory: 4k page, physical 8272104k(2053676k free), swap 11902816k(1707060k free) - -vm_info: Java HotSpot(TM) 64-Bit Server VM (25.311-b11) for windows-amd64 JRE (1.8.0_311-b11), built on Sep 27 2021 05:15:14 by "java_re" with MS VC++ 15.9 (VS2017) - -time: Mon Sep 5 12:31:48 2022 -timezone: й׼ʱ -elapsed time: 1581.277238 seconds (0d 0h 26m 21s) - diff --git a/Leecode/src/main/java/com/markilue/leecode/Test1.java b/Leecode/src/main/java/com/markilue/leecode/Test1.java deleted file mode 100644 index 7f5c3bd..0000000 --- a/Leecode/src/main/java/com/markilue/leecode/Test1.java +++ /dev/null @@ -1,18 +0,0 @@ -package com.markilue.leecode; - -import cn.hutool.json.JSONObject; -import cn.hutool.json.JSONUtil; - - -/** - *@BelongsProject: Leecode - *@BelongsPackage: com.markilue.leecode - *@Author: markilue - *@CreateTime: 2023-06-01 17:36 - *@Description: TODO - *@Version: 1.0 - */ -public class Test1 { - - -} diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/dfs/LC_1254_ClosedIsland.java b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/dfs/LC_1254_ClosedIsland.java index 88a663b..f89ba15 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/dfs/LC_1254_ClosedIsland.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/dfs/LC_1254_ClosedIsland.java @@ -137,4 +137,62 @@ public class LC_1254_ClosedIsland { return dfs(grid, i - 1, j) & dfs(grid, i + 1, j) & dfs(grid, i, j - 1) & dfs(grid, i, j + 1); } + + //如何为封闭岛屿:有边界 + public int closedIsland3(int[][] grid) { + + int result = 0; + for (int i = 0; i < grid.length; i++) { + for (int j = 0; j < grid[0].length; j++) { + if (grid[i][j] == 0) { + if (find(grid, i, j)) { + result++; + } + } + } + } + return result; + } + + public boolean find(int[][] grid, int i, int j) { + if (i < 0 || j < 0 || i >= grid.length || j >= grid[0].length) { + return false;//碰到了边界还没有返回,则不是封闭岛屿 + } + if (grid[i][j] == 1 || grid[i][j] == 2) { + //遇到了边界 + return true; + } + grid[i][j] = 2; + return find(grid, i + 1, j) & find(grid, i - 1, j) & find(grid, i, j + 1) & find(grid, i, j - 1); + } + + + public int closedIsland4(int[][] grid) { + int result = 0; + for (int i = 0; i < grid.length; i++) { + for (int j = 0; j < grid[0].length; j++) { + if (grid[i][j] == 0 && dfs2(grid, i, j)) { + result++; + } + } + } + + return result; + + } + + private boolean dfs2(int[][] grid, int i, int j) { + //碰到1则为封闭岛屿;超出边界则为非封闭岛屿 + if (i < 0 || j < 0 || i >= grid.length || j >= grid[0].length) { + return false; + } + if (grid[i][j] == 1) { + return true; + } + grid[i][j] = 1; + + + return dfs2(grid, i + 1, j) & dfs2(grid, i, j + 1) & dfs2(grid, i - 1, j) & dfs2(grid, i, j - 1); + } + } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/graph/LC_127_LadderLength.java b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/graph/LC_127_LadderLength.java index ab4ec90..39298f9 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/graph/LC_127_LadderLength.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/graph/LC_127_LadderLength.java @@ -143,6 +143,7 @@ public class LC_127_LadderLength { adjacent.add(new ArrayList<>()); for (int i = 0; i < wordList.size(); ++i) { String s = wordList.get(i); + //构建图 for (int j = i + 1; j < wordList.size(); ++j) { if (judge(s, wordList.get(j))) { adjacent.get(i).add(j); @@ -153,6 +154,7 @@ public class LC_127_LadderLength { return bfs(wordList.size() - 1, endIndex, adjacent, new boolean[wordList.size()]); } + //i为开始寻找的单词的index;j为结束的单词的index private int bfs(int i, int j, List> adjacent, boolean[] visited) { int distance = 0; ArrayDeque queue = new ArrayDeque<>(); @@ -163,8 +165,8 @@ public class LC_127_LadderLength { for (int k = 0; k < size; ++k) { int v = queue.pollFirst(); visited[v] = true; - if (v == j) return distance; - List edges = adjacent.get(v); + if (v == j) return distance;//找到了 + List edges = adjacent.get(v);//获取他的子矩阵挨个遍历 for (int e : edges) { if (!visited[e]) { queue.addLast(e); diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/listnode/LC_82_DeleteDuplicatesII.java b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/listnode/LC_82_DeleteDuplicatesII.java index 88a4760..c7037fb 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/listnode/LC_82_DeleteDuplicatesII.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/listnode/LC_82_DeleteDuplicatesII.java @@ -78,4 +78,26 @@ public class LC_82_DeleteDuplicatesII { } + public ListNode deleteDuplicates3(ListNode head) { + if (head == null) return null; + ListNode fake = new ListNode(); + fake.next = head; + ListNode temp = fake; + + while (temp.next != null && temp.next.next != null) { + //只有这样,才能有重复的,才需要删除 + if (temp.next.val == temp.next.next.val) { + ListNode tempNext = temp.next; + while (tempNext.next != null && tempNext.val == tempNext.next.val) { + tempNext = tempNext.next; + } + temp.next = tempNext.next; + } else { + temp = temp.next; + } + } + return fake.next; + + } + } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/singlestack/LC_503_NextGreaterElements.java b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/singlestack/LC_503_NextGreaterElements.java index fe96130..9db9d39 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/singlestack/LC_503_NextGreaterElements.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/singlestack/LC_503_NextGreaterElements.java @@ -91,7 +91,7 @@ public class LC_503_NextGreaterElements { stack.pop(); } if (i < n) result[i] = stack.isEmpty() ? -1 : stack.peek(); - stack.push(nums[i%n]); + stack.push(nums[i % n]); } return result; @@ -114,4 +114,25 @@ public class LC_503_NextGreaterElements { return result; } + + + public int[] nextGreaterElements3(int[] nums) { + + int n = nums.length; + ArrayDeque stack = new ArrayDeque<>(); + + int[] result = new int[n]; + + for (int i = n * 2 - 2; i >= 0; i--) { + while (!stack.isEmpty() && stack.peek() <= nums[i % n]) {//寻找第一个比当前数大的数 + stack.pop(); + } + if (i < n) result[i] = stack.isEmpty() ? -1 : stack.peek(); + stack.push(nums[i % n]); + } + + return result; + + + } } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/union_find/second/LC_685_FindRedundantConnection.java b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/union_find/second/LC_685_FindRedundantConnection.java index 20e0c32..c847826 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/union_find/second/LC_685_FindRedundantConnection.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/union_find/second/LC_685_FindRedundantConnection.java @@ -1,5 +1,7 @@ package com.markilue.leecode.hot100.interviewHot.union_find.second; +import org.junit.Test; + import java.util.ArrayList; /** @@ -12,6 +14,12 @@ import java.util.ArrayList; */ public class LC_685_FindRedundantConnection { + @Test + public void test() { + int[][] edges = {{1, 2}, {1, 3}, {2, 3}}; + System.out.println(findRedundantDirectedConnection(edges)); + } + int[] father;//父节点 int n;//父节点个数 @@ -84,7 +92,7 @@ public class LC_685_FindRedundantConnection { ArrayList twoDegree = new ArrayList<>(); //判断入度为2的节点,该节点一定有子节点需要删除;反向遍历,因为后面的删除优先级更高 - for (int i = edges.length-1; i >=0; i--) { + for (int i = edges.length - 1; i >= 0; i--) { if (inDegree[edges[i][1]] == 2) { twoDegree.add(i);//这个节点需要删除 } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/union_find/second/LC_685_FindRedundantConnection1.java b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/union_find/second/LC_685_FindRedundantConnection1.java new file mode 100644 index 0000000..a79e837 --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/interviewHot/union_find/second/LC_685_FindRedundantConnection1.java @@ -0,0 +1,109 @@ +package com.markilue.leecode.hot100.interviewHot.union_find.second; + +import org.junit.Test; + +import java.util.ArrayList; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.hot100.interviewHot.union_find.second + *@Author: markilue + *@CreateTime: 2023-06-12 09:58 + *@Description: TODO + *@Version: 1.0 + */ +public class LC_685_FindRedundantConnection1 { + + @Test + public void test() { + int[][] edges = {{1, 2}, {1, 3}, {2, 3}}; + System.out.println(findRedundantDirectedConnection(edges)); + } + + int[] father; + + private void init(int[] father) { + for (int i = 0; i < father.length; i++) { + father[i] = i; + } + } + + private int find(int u) { + if (father[u] == u) return u; + father[u] = find(father[u]); + return father[u]; + } + + private void union(int u, int v) { + u = find(u); + v = find(v); + if (u == v) return; + father[v] = u; + } + + private boolean same(int u, int v) { + u = find(u); + v = find(v); + return u == v; + } + + private int[] removeOne(int[][] edges) { + init(father); + for (int[] edge : edges) { + if (same(edge[0], edge[1])) { + return edge; + } + union(edge[0], edge[1]); + + } + return null; + } + + private boolean removeIfCan(int[][] edges, int i) { + init(father); + //遇上i就跳过 + for (int i1 = 0; i1 < edges.length; i1++) { + if (i1 == i) continue; + if (same(edges[i1][0], edges[i1][1])) { + return false; + } + + union(edges[i1][0], edges[i1][1]); + + } + return true; + } + + + //虽然是有向图,但是一共就三种情况,两种入度为2的情况可以直接判断出来,最后可以转为无向图的情况 + public int[] findRedundantDirectedConnection(int[][] edges) { + father = new int[1010]; + //判断入度为2的情况 + int[] countDegree = new int[1010]; + + for (int[] edge : edges) { + countDegree[edge[1]]++; + } + + ArrayList twoDegree = new ArrayList<>();//入度为2的节点 + + for (int i = edges.length - 1; i >= 0; i--) { + if (countDegree[edges[i][1]] > 1) twoDegree.add(i); + } + + if (!twoDegree.isEmpty()) { + if (removeIfCan(edges, twoDegree.get(0))) { + return edges[twoDegree.get(0)]; + } else { + return edges[twoDegree.get(1)]; + } + } + + //只用删除一个 + return removeOne(edges); + + + } + + +} diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T34_75_SortColors.java b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T34_75_SortColors.java index 77c29d1..f68b4d9 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T34_75_SortColors.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T34_75_SortColors.java @@ -21,7 +21,7 @@ public class T34_75_SortColors { @Test public void test() { int[] nums = {2, 0, 2, 1, 1, 0}; - sortColors1(nums); + sortColors3(nums); System.out.println(Arrays.toString(nums)); } @@ -99,4 +99,28 @@ public class T34_75_SortColors { } + + + //三刷 + public void sortColors3(int[] nums) { + + int index0 = 0; + int index1 = 0; + + for (int i = 0; i < nums.length; i++) { + if (nums[i] == 0) { + swap(nums, index0, i); + if (index0 < index1) {//交换到1了,交换回来 + swap(nums, index1, i); + } + index1++; + index0++; + } else if (nums[i] == 1) { + swap(nums, index1, i); + index1++; + } + + } + + } } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T49_124_MaxPathSum.java b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T49_124_MaxPathSum.java index 2f7e356..73dd7aa 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T49_124_MaxPathSum.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T49_124_MaxPathSum.java @@ -99,4 +99,22 @@ public class T49_124_MaxPathSum { return Math.max(left, right) + root.val; } + + + public int maxPathSum3(TreeNode root) { + findCurMax(root); + return maxSum; + } + + //返回要当前节点的最大值;不要的情况已经在子节点中讨论过了 + public int findCurMax(TreeNode node) { + if (node == null) { + return 0; + } + int left = Math.max(findCurMax(node.left), 0); + int right = Math.max(findCurMax(node.right), 0); + + maxSum = Math.max(maxSum, left + right + node.val); + return Math.max(left, right) + node.val; + } } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T55_146_LRUCache.java b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T55_146_LRUCache.java index 873a1bd..2fad969 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T55_146_LRUCache.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T55_146_LRUCache.java @@ -203,3 +203,106 @@ class LRUCache { } } + + +class LRUCache1 { + + public static void main(String[] args) { + LRUCache1 lRUCache = new LRUCache1(2); + lRUCache.put(1, 1); // 缓存是 {1=1} + lRUCache.put(2, 2); // 缓存是 {1=1, 2=2} + System.out.println(lRUCache.get(1)); // 返回 1 + lRUCache.put(3, 3); // 该操作会使得关键字 2 作废,缓存是 {1=1, 3=3} + System.out.println(lRUCache.get(2)); // 返回 -1 (未找到) + lRUCache.put(4, 4); // 该操作会使得关键字 1 作废,缓存是 {4=4, 3=3} + System.out.println(lRUCache.get(1)); // 返回 -1 (未找到) + System.out.println(lRUCache.get(3)); // 返回 3 + System.out.println(lRUCache.get(4)); // 返回 4 + } + + + Map cache; + int capacity; + int size; + Node head; + Node tail; + + + public LRUCache1(int capacity){ + this.capacity=capacity; + cache =new HashMap<>(); + size=0; + head =new Node(); + tail=new Node(); + head.next=tail; + tail.pre=head; + } + + + public int get(int key) { + Node node = cache.get(key); + if(node==null){ + return -1; + }else{ + //将该节点挪到头部 + deleteNode(node); + removeToHead(node); + return node.value; + } + + } + + public void put(int key, int value) { + Node node = cache.get(key); + if(node==null){ + //没有,则添加 + if(size==capacity){ + //满了,删除 + cache.remove(tail.pre.key); + deleteNode(tail.pre); + size--; + } + Node newNode = new Node(key,value); + removeToHead(newNode); + cache.put(key,newNode); + size++; + }else{ + //更新,将该节点挪到头部 + node.value=value; + deleteNode(node); + removeToHead(node); + } + } + + private void deleteNode(Node node){ + node.pre.next=node.next; + node.next.pre=node.pre; + } + + private void removeToHead(Node node){ + node.next=head.next; + head.next.pre=node; + head.next=node; + node.pre=head; + } + + + class Node { + + int key; + int value; + Node pre; + Node next; + + public Node() { + } + + public Node(int key, int value) { + this.key = key; + this.value = value; + } + + + } +} + diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T67_221_MaximalSquare.java b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T67_221_MaximalSquare.java index 33dc639..90f2c81 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T67_221_MaximalSquare.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T67_221_MaximalSquare.java @@ -20,7 +20,7 @@ public class T67_221_MaximalSquare { {'1', '1', '1', '1', '1'}, {'1', '0', '0', '1', '0'} }; - System.out.println(maximalSquare1(matrix)); + System.out.println(maximalSquare2(matrix)); } @Test @@ -100,4 +100,34 @@ public class T67_221_MaximalSquare { return result * result; } + + + public int maximalSquare2(char[][] matrix) { + int m = matrix.length; + int n = matrix[0].length; + int[][] dp = new int[m][n]; + int result = Integer.MIN_VALUE; + for (int i = 0; i < n; i++) { + dp[0][i] = matrix[0][i] == '1' ? 1 : 0; + result = Math.max(result,dp[0][i]); + } + + for (int i = 0; i < m; i++) { + dp[i][0] = matrix[i][0] == '1' ? 1 : 0; + result = Math.max(result,dp[0][i]); + } + + for (int i = 1; i < m; i++) { + for (int j = 1; j < n; j++) { + if (matrix[i][j] == '1') { + dp[i][j] = Math.min(Math.min(dp[i - 1][j], dp[i][j - 1]), dp[i - 1][j - 1]) + 1; + } + if (result < dp[i][j]) result = dp[i][j]; + } + } + return result * result; + + } + + } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T69_234_IsPalindrome.java b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T69_234_IsPalindrome.java index aa75929..2a82a54 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T69_234_IsPalindrome.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T69_234_IsPalindrome.java @@ -33,4 +33,22 @@ public class T69_234_IsPalindrome { return false; } + + public boolean isPalindrome1(ListNode head) { + root = head; + return find(head); + } + + public boolean find(ListNode node) { + if (node == null) { + return true; + } + + if (find(node.next) && node.val == root.val) { + root = root.next; + return true; + } + + return false; + } } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T72_239_MaxSlidingWindow.java b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T72_239_MaxSlidingWindow.java index a879646..668fa54 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T72_239_MaxSlidingWindow.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T72_239_MaxSlidingWindow.java @@ -19,7 +19,7 @@ public class T72_239_MaxSlidingWindow { public void test() { int[] nums = {1, 3, -1, -3, 5, 3, 6, 7}; int k = 3; - System.out.println(Arrays.toString(maxSlidingWindow1(nums, k))); + System.out.println(Arrays.toString(maxSlidingWindow2(nums, k))); } @Test @@ -110,4 +110,37 @@ public class T72_239_MaxSlidingWindow { } + //构造一个单调栈,只有后面的值比前面的值小,前面的值就是无用的 + public int[] maxSlidingWindow2(int[] nums, int k) { + + ArrayDeque stack = new ArrayDeque<>(); + + int[] result = new int[nums.length - k + 1]; + + //构造第一个窗口 + for (int i = 0; i < k; i++) { + while (!stack.isEmpty() && nums[stack.peekLast()] <= nums[i]) { + stack.pollLast(); + } + stack.offerLast(i); + } + result[0] = nums[stack.peekFirst()]; + + for (int i = k; i < nums.length; i++) { + //先排除过期元素 + while (!stack.isEmpty() && i - stack.peekFirst() >= k) { + stack.pollFirst(); + } + //添加在合适的位置 + while (!stack.isEmpty() && nums[stack.peekLast()] <= nums[i]) { + stack.pollLast(); + } + stack.offerLast(i); + result[i - k + 1] = stack.isEmpty() ? -1 : nums[stack.peekFirst()]; + } + return result; + + } + + } diff --git a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T79_301_RemoveInvalidParentheses.java b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T79_301_RemoveInvalidParentheses.java index 00f3860..1e13f6c 100644 --- a/Leecode/src/main/java/com/markilue/leecode/hot100/second/T79_301_RemoveInvalidParentheses.java +++ b/Leecode/src/main/java/com/markilue/leecode/hot100/second/T79_301_RemoveInvalidParentheses.java @@ -103,11 +103,11 @@ public class T79_301_RemoveInvalidParentheses { } //判断完之后就需要进行删除;同时,不可能存在left,right都大于0的情况 List result = new ArrayList<>(); - remove(s, left, right, result,0); + remove(s, left, right, result, 0); return result; } - public void remove(String s, int left, int right, List res,int start) { + public void remove(String s, int left, int right, List res, int start) { if (left == 0 && right == 0) { if (isValid(s)) { res.add(s); @@ -118,17 +118,62 @@ public class T79_301_RemoveInvalidParentheses { //必须在删除的后面继续删才可以 for (int i = start; i < s.length(); i++) { //去重 - if(i>start&&s.charAt(i)==s.charAt(i-1))continue; + if (i > start && s.charAt(i) == s.charAt(i - 1)) continue; //不够了 if (left + right > s.length() - i) return; if (left > 0 && s.charAt(i) == '(') { //可以移除左边 - remove(s.substring(0, i) + s.substring(i + 1), left - 1, right, res,i); + remove(s.substring(0, i) + s.substring(i + 1), left - 1, right, res, i); } if (right > 0 && s.charAt(i) == ')') { //可以移除左边 - remove(s.substring(0, i) + s.substring(i + 1), left, right - 1, res,i); + remove(s.substring(0, i) + s.substring(i + 1), left, right - 1, res, i); + } + } + } + + + //判断左括号右括号哪边多,哪边多就把哪边的删了 + public List removeInvalidParentheses2(String s) { + + int left = 0; + int right = 0; + for (int i = 0; i < s.length(); i++) { + char cur = s.charAt(i); + if (cur == '(') { + left++; + } else if (cur == ')') { + if (left > 0) { + left--; + } else { + right++; + } + } + } + List result = new ArrayList<>(); + remove(left, right, s, result, 0); + return result; + } + + public void remove(int left, int right, String s, List result, int start) { + if (left == 0 && right == 0) { + if (isValid(s)) { + result.add(new String(s)); + } + return; + } + + for (int i = start; i < s.length(); i++) { + char cur = s.charAt(i); + if (i > start && cur == s.charAt(i - 1)) { + continue; + } + if (left > 0 && cur == '(') { + remove(left - 1, right, s.substring(0, i) + s.substring(i + 1), result, i); + } + if (right > 0 && cur == ')') { + remove(left, right - 1, s.substring(0, i) + s.substring(i + 1), result, i); } } } diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/OPPO/T0411/Question1.java b/Leecode/src/main/java/com/markilue/leecode/interview/OPPO/T0411/Question1.java new file mode 100644 index 0000000..57faf38 --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/OPPO/T0411/Question1.java @@ -0,0 +1,41 @@ +package com.markilue.leecode.interview.OPPO.T0411; + +import java.util.Scanner; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.OPPO.T0411 + *@Author: markilue + *@CreateTime: 2023-06-14 10:41 + *@Description: TODO + *@Version: 1.0 + */ +public class Question1 { + + public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + String s = sc.next(); + solve(s); + } + + private static void solve(String s) { + int left = 0; + int right = 0; + int xiaochu = 0; + for (int i = 0; i < s.length(); i++) { + char cur = s.charAt(i); + if (cur == '(') { + left++; + } else if (cur == ')') { + if (left > 0) { + left--; + xiaochu++; + } else { + right++; + } + } + } + System.out.println(s.length() - xiaochu); + } +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/OPPO/T0411/Question2.java b/Leecode/src/main/java/com/markilue/leecode/interview/OPPO/T0411/Question2.java new file mode 100644 index 0000000..b8be0ad --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/OPPO/T0411/Question2.java @@ -0,0 +1,47 @@ +package com.markilue.leecode.interview.OPPO.T0411; + +import java.util.Arrays; +import java.util.Scanner; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.OPPO.T0411 + *@Author: markilue + *@CreateTime: 2023-06-14 11:02 + *@Description: TODO + *@Version: 1.0 + */ +public class Question2 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int n = sc.nextInt(); + solve(n); + } + + private static void solve(int n) { + if (n % 2 == 0) { + if (n == 2) { + System.out.println(2); + return; + } + System.out.println(cal(n / 2) * 2 * 2 % mod); + } else { + System.out.println(cal(n / 2 + 1) * cal(n / 2) % mod); + } + } + + static long[] memo = new long[(int) 1e5]; + static long mod = (long) (1e9 + 7); + + public static long cal(int n) { + if (memo[n] != 0) { + return memo[n]; + } else if (n == 1) { + return 1; + } + memo[n] = n * cal(n - 1) % mod; + return memo[n]; + } + +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/baidu/T0410/Question1.java b/Leecode/src/main/java/com/markilue/leecode/interview/baidu/T0410/Question1.java new file mode 100644 index 0000000..7756bf2 --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/baidu/T0410/Question1.java @@ -0,0 +1,44 @@ +package com.markilue.leecode.interview.baidu.T0410; + +import java.util.Arrays; +import java.util.Scanner; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.baidu.T0410 + *@Author: markilue + *@CreateTime: 2023-06-14 11:32 + *@Description: TODO + *@Version: 1.0 + */ +public class Question1 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int n = sc.nextInt(); + int k = sc.nextInt(); + int[] nums = new int[n]; + for (int i = 0; i < n; i++) { + nums[i] = sc.nextInt(); + } + solve(nums, k); + } + + //猜测:前k-1个单独分最小的前k-1个数;后面全在一起 + private static void solve(int[] nums, int k) { + Arrays.sort(nums); + + double result = 0; + //前k-1个单独是一个 + for (int i = 0; i < k - 1; i++) { + result += nums[i]; + } + //后面全在一起 + double temp = 0; + for (int i = k - 1; i < nums.length; i++) { + temp += nums[i]; + } + double avg = temp / (nums.length - k + 1); + System.out.println((result+avg)); + } +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0412/Question1.java b/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0412/Question1.java new file mode 100644 index 0000000..f527fef --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0412/Question1.java @@ -0,0 +1,54 @@ +package com.markilue.leecode.interview.huawei.T0412; + +import java.util.Arrays; +import java.util.Scanner; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.huawei.T0412 + *@Author: markilue + *@CreateTime: 2023-06-12 11:38 + *@Description: + * TODO 交易系统的降级策略: + * 有一个核心交易系统接口被N个上游系统调用,每个上游系统的调用量R=[R1,R2.....,RN]. + * 由于核心交易系统集群故障,需要暂时系统降级限制调用,核心交易系统能接受的最大调用量为cnt。 + * 设置降级规则如下: + * 如果sum(R1.R2..RN)小于等于cnt,则全部可以正常调用,返回-1; + * 如果sum(R1.R2....RN)大于cnt,设置一个阈值limit, + * 如果某个上游系统发起的调用量超过limit,就将该上游系统的调用量限制为limit, + * 其余未达到limit的系统可以正常发起调用。 + * 求出这个最大的limit (limit可以为0) + * 此题目对效率有要求,请选择高效的方式。 + *@Version: 1.0 + */ +public class Question1 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int[] nums = Arrays.stream(sc.nextLine().split(" ")).mapToInt(Integer::parseInt).toArray(); + int threshold = Integer.parseInt(sc.nextLine()); + + solve(nums, threshold); + } + + //二分寻找最大值 + private static void solve(int[] nums, int threshold) { + int max = Math.min(threshold,(int) 1e5); + int min = threshold / nums.length; + while (min < max) { + int mid = min + ((max - min + 1) >> 1); + if (check(nums, mid, threshold)) min = mid; + else max = mid - 1; + } + System.out.println(min); + } + + private static boolean check(int[] nums, int max, int threshold) { + int result = 0; + for (int i = 0; i < nums.length; i++) { + if (nums[i] < max) result += nums[i]; + else result += max; + } + return result <= threshold; + } +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0412/Question2.java b/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0412/Question2.java new file mode 100644 index 0000000..bbbce6e --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0412/Question2.java @@ -0,0 +1,72 @@ +package com.markilue.leecode.interview.huawei.T0412; + +import java.util.*; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.huawei.T0412 + *@Author: markilue + *@CreateTime: 2023-06-13 11:24 + *@Description: + * TODO 获取最多的食物: + * 主办方设计了一个获取食物的游戏。 + * 游戏的地图由N个方格组成,每个方格上至多2个传送门,通过传送门可将参与者传送至指定的其它方格。 + * 同时,每个方格上标注了三个数字: + * (1) 第一个数字id:代表方格的编号,从0到N-1,每个方格各不相同 + * (2)第二个数字parent-id:代表从编号为parent-id的方格可以通过传送门传送到当前方格(-1则表示没有任何方格可以通过传送门传送到此方格,这样的方格在地图中有且仅有一个) + * (3)第三个数字value: 取值在[100,100]的整数值,正整数代表参与者得到相队取值单位的食物,负整数代表失去相应数值单位的食物(参与者可能存在临时持有食物为负数的情况),0则代表无变化。 + *@Version: 1.0 + */ +public class Question2 { + + static int max = Integer.MIN_VALUE; + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int num = sc.nextInt(); + List> edges = new ArrayList<>(); + HashMap map = new HashMap<>();// + for (int i = 0; i < num; i++) { + edges.add(new ArrayList<>()); + } + for (int i = 0; i < num; i++) { + int id = sc.nextInt(); + int parentId = sc.nextInt(); + int value = sc.nextInt(); + map.put(id, value); + if (parentId != -1) { + edges.get(parentId).add(new Node(id, value)); + } + } + + for (int i = 0; i < num; i++) { + solve(edges, map, 0, i); + } + System.out.println(max); + } + + public static void solve(List> edges, Map map, int curValue, int curIndex) { + + curValue += map.get(curIndex); + max = Math.max(max, curValue); + List children = edges.get(curIndex); + + for (Node child : children) { + solve(edges, map, curValue, child.id); + } + } + + static class Node { + int value; + int id; + + + public Node() { + } + + public Node(int id, int value) { + this.id = id; + this.value = value; + } + } +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0531/Question3.java b/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0531/Question3.java index 3caadd7..11cc9bf 100644 --- a/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0531/Question3.java +++ b/Leecode/src/main/java/com/markilue/leecode/interview/huawei/T0531/Question3.java @@ -1,5 +1,6 @@ package com.markilue.leecode.interview.huawei.T0531; +import com.markilue.leecode.tree.TreeNode; import org.junit.Test; import java.util.Scanner; @@ -38,7 +39,7 @@ public class Question3 { {-2, -3, 4}, }; // calculateMaxRectangleSum(2, 3, income); - calculate(2, 3, income); + calculate1(2, 3, income); } private static void calculateMaxRectangleSum(int m, int n, int[][] matrix) { @@ -104,4 +105,40 @@ public class Question3 { } + + //二刷尝试:由于需要计算那一块的面积,但是不知道那一块的具体大小,所以考虑使用前缀和进行计算 + private static void calculate1(int m, int n, int[][] matrix) { + int[][] prefix = new int[m + 1][n + 1]; + + //构造前缀和数组 + for (int i = 1; i < m + 1; i++) { + for (int j = 1; j < n + 1; j++) { + prefix[i][j] = prefix[i - 1][j] + prefix[i][j - 1] - prefix[i - 1][j - 1] + matrix[i - 1][j - 1]; + } + } + + //挨个遍历寻找面积最大值 + int result = Integer.MIN_VALUE; + int edge = 0; + + for (int i = 1; i < m + 1; i++) { + for (int j = 1; j < n + 1; j++) {//左上角 + for (int k = i; k < m + 1; k++) { + for (int l = j; l < n + 1; l++) {//右下角 + int cur = prefix[k][l] - prefix[i - 1][l] - prefix[k][j - 1] + prefix[i - 1][j - 1]; + if (cur > result) { + result = cur; + edge = (k - i + 1) * (l - j + 1); + } + } + } + } + } + + System.out.println(edge + " " + result); + + + } + + } diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/NestingDolls.java b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/NestingDolls.java new file mode 100644 index 0000000..a98baf8 --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/NestingDolls.java @@ -0,0 +1,90 @@ +package com.markilue.leecode.interview.meituan.T0415; + +import java.util.Arrays; +import java.util.Scanner; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.meituan.T0415 + *@Author: markilue + *@CreateTime: 2023-06-09 18:41 + *@Description: TODO + *@Version: 1.0 + */ +public class NestingDolls { + + + static int n; + static Doll[] dolls; + + public static void main(String[] args) { + Scanner in = new Scanner(System.in); + n = in.nextInt(); + dolls = new Doll[n]; + for (int i = 0; i < n; ++i) { + int a = in.nextInt(), b = in.nextInt(), c = in.nextInt(); + dolls[i] = new Doll(a, b, c); + } + Arrays.sort(dolls);//按最大空间有小到大排序 + + int minCost = 0; + for (int i = 0; i < n; ++i) { + if (!dolls[i].used) { + int cost = insertDoll(i, dolls[i].b); + minCost += cost; + } + } + System.out.println(minCost); + + in.close(); + } + + // 将第 i 个套娃插入内部大小为 size 的套娃中 + static int insertDoll(int i, int size) { + dolls[i].used = true; + + int j = findSmallest(size); + if (j == -1) {//没有找到能够放在里面的,需要重新开辟 + dolls[i].minSize = size; + dolls[i].minCost = dolls[i].c * size;//由于都放不进,所以最小值就是全部的 + return dolls[i].minCost; + } else { + int cost = insertDoll(j, dolls[i].a) + dolls[i].c * (size - dolls[j].a); + if (cost < dolls[i].minCost) { + dolls[i].minSize = size- dolls[j].a; + dolls[i].minCost = cost; + } + return cost; + } + } + + // 寻找最小的被 size 占据的空间能够容纳的套娃 + static int findSmallest(int size) { + int j = -1; + for (int i = 0; i < n; ++i) { + if (!dolls[i].used && dolls[i].a <= size) + if (j == -1 || dolls[i].minSize < dolls[j].minSize) j = i; + } + return j; + } + + static class Doll implements Comparable { + int a; + int b; + int c; + boolean used = false; // 是否已经被放置 + int minSize; // 占据的最小内部空间 + int minCost; // 最小花费 + + Doll(int a, int b, int c) { + this.a = a; + this.b = b; + this.c = c; + } + + @Override + public int compareTo(Doll other) { + return Integer.compare(a, other.a); + } + } +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question1.java b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question1.java new file mode 100644 index 0000000..cba4bcb --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question1.java @@ -0,0 +1,51 @@ +package com.markilue.leecode.interview.meituan.T0415; + +import java.util.Scanner; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.meituan.T0415 + *@Author: markilue + *@CreateTime: 2023-06-06 11:38 + *@Description: + * TODO 字符串前缀: + * 现在有两个字符串S和T,你需要对S进行若干次操作,使得S是T的一个前缀(空串也是一个前缀)。 + * 每次操作可以修改S的一个字符,或者删除一个S末尾的字符。小团需要写一段程序,输出最少需要操作的次数。 + * + *@Version: 1.0 + */ +public class Question1 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int count = sc.nextInt(); + + for (int i = 0; i < count; i++) { + String S = sc.next(); + String T = sc.next(); + solve(S, T); + } + } + + + //为什么不是动态规划?因为题目要求,删只能删除S的末尾 + private static void solve(String s, String t) { + + int result = 0; + int pos = s.length() - 1; + //如果S是T的前缀,则S一定要比T短 + if (s.length() > t.length()) { + result += s.length() - t.length(); + pos = t.length() - 1; + } + //能修改就修改;不能修改再删除 + for (int i = pos; i >= 0; i--) { + if (t.charAt(i) != s.charAt(i)) { + result++; + } + } + + + System.out.println(result); + } +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question2.java b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question2.java new file mode 100644 index 0000000..1619641 --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question2.java @@ -0,0 +1,49 @@ +package com.markilue.leecode.interview.meituan.T0415; + +import java.util.Scanner; + + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.meituan.T0415 + *@Author: markilue + *@CreateTime: 2023-06-07 10:28 + *@Description: + * TODO 小美分糖: + * 某一天,小美从商店买了两种糖果,分别买了a个和b个,要分给班上n个小朋友。为了不浪费,每块糖果都得恰好分到一个小朋友。 + * 另外,两种糖果一起吃的话味道其实并不好,所以每一个小朋友都只能得到其中一种糖果。 + * 小美希望分得最少糖果的那个小朋友能得到尽量多的糖果。小美的任务是求得这个数量是多少。 + *@Version: 1.0 + */ +public class Question2 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int count = sc.nextInt(); + + for (int i = 0; i < count; i++) { + int n = sc.nextInt(); + int a = sc.nextInt(); + int b = sc.nextInt(); + solve(n, a, b); + } + } + + //挨个遍历均分,看看谁的最小更大 + private static void solve(int n, int a, int b) { + if (a > b) { + solve(n, b, a); + return; + } + int min = Integer.MIN_VALUE; + for (int i = 1; i < n; i++) { + int curMin = Math.min(a / i, b / (n - i)); + if (min > curMin) { + break;//在递减了,直接break + } else { + min = curMin; + } + } + System.out.println(min); + } +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question3.java b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question3.java new file mode 100644 index 0000000..98bcd89 --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question3.java @@ -0,0 +1,142 @@ +package com.markilue.leecode.interview.meituan.T0415; + +import org.junit.Test; + +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.meituan.T0415 + *@Author: markilue + *@CreateTime: 2023-06-07 11:00 + *@Description: + * TODO 交通规划: + * A国有n个城市,这n个城市排成一列,依次编号为1,2,3,...,n。 + * 一开始,这n座城市之间都没有任何交通路线,于是政府打算修建一些铁路来进行交通规划。 + * 接下来T天,每一天会进行如下操作的其中一种: + * - “L x”:表示编号为 x 的城市与其左边的城市之间修建一条铁路。如果 x 左边没有城市或者已经修建了铁路,则无视该操作; + * - “R x”:表示编号为 x 的城市与其右边的城市之间修建一条铁路。如果 x 右边没有城市或者已经修建了铁路,则无视该操作; + * - “Q x”:表示查询 x 往左边和往右边最远能到达的城市编号。 + * 你的任务是模拟以上操作,并对于每一条“Q x”操作,输出对应的答案。 + *@Version: 1.0 + */ +public class Question3 { + + public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + int total = sc.nextInt(); + //构建图 + List edge = new ArrayList<>(); + for (int i = 0; i < total; i++) { + edge.add(new Node(i)); + } + + int count = sc.nextInt(); + + for (int i = 0; i < count; i++) { + String action = sc.next(); + int node = sc.nextInt() - 1;//num => index + if (action.equals("L") && node - 1 >= 0) { + edge.get(node).left = edge.get(node - 1); + } else if (action.equals("R") && node + 1 < edge.size()) { + edge.get(node).right = edge.get(node + 1); + } else if (action.equals("Q")) { + //查询 + Node cur = edge.get(node); + Node tempLeft = cur; + while (tempLeft.left != null) { + tempLeft = tempLeft.left; + } + Node tempRight = cur; + while (tempRight.right != null) { + tempRight = tempRight.right; + } + System.out.println((tempLeft.val + 1) + " " + (tempRight.val + 1)); + } + } + + } + + static class Node { + Node left; + Node right; + int val; + + public Node() { + } + + public Node(int val) { + this.val = val; + } + } + + + int[] father; + + public void init(int[] father) { + for (int i = 0; i < father.length; i++) { + father[i] = i; + } + } + + public int find(int x) { + if (x == father[x]) return x; + father[x] = find(father[x]); + return father[x]; + } + + public void union(int u, int v) { + u = find(u); + v = find(v); + if (u == v) return; + father[v] = u; + } + + + //并查集:这题本质上就是一个无向图,考察连通性,因此可以使用并查集简化计算 + public void solve1() { + Scanner sc = new Scanner(System.in); + int total = sc.nextInt(); + //构建图 + father = new int[total + 2]; + init(father); + + + int count = sc.nextInt(); + + for (int i = 0; i < count; i++) { + String action = sc.next(); + int node = sc.nextInt();//num => index + if (action.equals("L")) { + union(node, node - 1); + } else if (action.equals("R")) { + union(node, node + 1); + } else { + //查询 左边二分找到连通的最小值 + int l = 1; + int r = node; + while (l < r) { + int mid = l + ((r - l) >> 1); + if (find(node) == find(mid)) r = mid;//父亲是一样的,我们认为是联通的,所以缩小范围找更小的 + else l = mid + 1; + } + int res1 = r; + //查询 右边二分找到连通的最大值 + l = node; + r = total; + while (l < r) { + int mid = l + ((r - l) >> 1); + if (find(node) == find(mid)) l = mid;//父亲是一样的,我们认为是联通的,所以缩小范围找更大的 + else r = mid - 1; + } + System.out.println(res1 + " " + r); + + } + } + } + + +} diff --git a/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question4.java b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question4.java new file mode 100644 index 0000000..3590667 --- /dev/null +++ b/Leecode/src/main/java/com/markilue/leecode/interview/meituan/T0415/Question4.java @@ -0,0 +1,92 @@ +package com.markilue.leecode.interview.meituan.T0415; + +import org.junit.Test; + +import java.util.*; + +/** + *@BelongsProject: Leecode + *@BelongsPackage: com.markilue.leecode.interview.meituan.T0415 + *@Author: markilue + *@CreateTime: 2023-06-09 13:11 + *@Description: + * TODO 小美玩套娃: + * 小美最近喜欢上了玩套娃。 + * 具体的,小美有 n 个套娃,第 i 个套娃的大小为 ai,内部空间为 bi(bi≤ai)。 + * 对于两个套娃x,y, x能放入y中当且仅当ax≤by ,且放入后会占据 y 大小为 ax 的内部空间,即 y 的内部空间剩下 by-ax, + * 每个套娃只能放在另外的一个套娃内,每个套娃内部也只能放一个套娃(当然内部放的这个套娃可以内部还有套娃)。 + * 显然套娃是套的越多越好,于是小美给每个套娃定义了一个价值 ci, + * 如果套完之后套娃 i 还剩 k 的内部空间,小美需要付出ci*k 的花费,总花费为所有套娃的花费之和,现在小美想知道最小的花费为多少 + *@Version: 1.0 + */ +public class Question4 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int n = sc.nextInt(); + int[] out = new int[n]; + int[] in = new int[n]; + int[] payment = new int[n]; + + for (int i = 0; i < n; i++) { + out[i] = sc.nextInt(); + } + for (int i = 0; i < n; i++) { + in[i] = sc.nextInt(); + } + for (int i = 0; i < n; i++) { + payment[i] = sc.nextInt(); + } + solve(out, in, payment); + } + + @Test + public void test() { + int[] out = {5, 4, 3}; + int[] in = {4, 2, 2}; + int[] payment = {3, 2, 1}; + solve(out, in, payment); + } + + //官方思路:可能是错的,贪心的思路:尽可能将花费大的先填满 + public static void solve(int[] out, int[] in, int[] payment) { + //构造按大小排序的套娃 + List taoS1 = new ArrayList<>(); + List taoS2 = new ArrayList<>(); + for (int i = 0; i < out.length; i++) { + taoS1.add(new int[]{out[i], in[i], payment[i], i}); + taoS2.add(new int[]{out[i], in[i], payment[i], i}); + } + + Collections.sort(taoS1, ((o1, o2) -> o1[0] - o2[0]));//按空间有小到大排序 + Collections.sort(taoS2, ((o1, o2) -> o1[2] - o2[2]));//按花费排序 + + //按照空间大小遍历,找到最大的未使用的最大的套娃 + int n = out.length; + int rightThreshold = n - 1; + for (int i = n - 1; i >= 0; i--) { + int left = 0; + int right = rightThreshold; + int mid = (left + right + 1) >> 1;//四舍五入 + while (left < right) { + mid = (left + right + 1) >> 1; + if (taoS2.get(i)[1] >= taoS1.get(mid)[0]) left = mid;//当前花费最大的能被放入;寻找更大能放入的 + else left = mid + 1;//为了快速收敛? + } + + if (taoS1.get(mid)[3] == taoS2.get(i)[3]) right--;//使用的自己,那不行 + if (taoS2.get(i)[1] < taoS1.get(right)[0]) break;//当前位置不可能被其他的点放入了 + + taoS2.get(i)[1] -= taoS1.get(right)[0]; + rightThreshold = right - 1; + } + + int result = 0; + for (int[] total : taoS2) { + result += total[1] * total[2]; + } + System.out.println(result); + + + } +} diff --git a/Leecode/src/main/java/com/markilue/leecode/test/Fibonaqi.java b/Leecode/src/main/java/com/markilue/leecode/test/Fibonaqi.java index e9cfa0e..32e0640 100644 --- a/Leecode/src/main/java/com/markilue/leecode/test/Fibonaqi.java +++ b/Leecode/src/main/java/com/markilue/leecode/test/Fibonaqi.java @@ -1,38 +1,35 @@ package com.markilue.leecode.test; import java.text.SimpleDateFormat; +import java.util.Arrays; +import java.util.Scanner; public class Fibonaqi { - /** * 测试使用时间复杂度为n的斐波那契数列递归法 - * */ // @Test // public static void testFibonaqi(){ // // } - public static void main(String[] args) { - int n=5; - System.out.println(fibonacci(1,1,10)); + int n = 5; + System.out.println(fibonacci(1, 1, 10)); + } - public static int fibonacci(int first,int second,int n){ - if(n<=0){ + public static int fibonacci(int first, int second, int n) { + if (n <= 0) { return 0; } - if(n <3){ + if (n < 3) { return 1; - }else if(n==3){ - return first+second; - } - else { - return fibonacci(second,first+second,n-1); + } else if (n == 3) { + return first + second; + } else { + return fibonacci(second, first + second, n - 1); } } - - } diff --git a/Spider/BaseInformation.txt b/Spider/BaseInformation.txt new file mode 100644 index 0000000..7f97e59 --- /dev/null +++ b/Spider/BaseInformation.txt @@ -0,0 +1,5 @@ +这个文件夹存放了 +1)爬虫学习的一些案例,实际案例操作 https://github.com/Python3WebSpider +2)实际爬取的一些网站等 +等 +爬虫学习中心:https://setup.scrape.center/ \ No newline at end of file diff --git a/Spider/Chapter03_网页数据的提取/BeautifulSoup库/BeautifulSoupLearning.py b/Spider/Chapter03_网页数据的提取/BeautifulSoup库/BeautifulSoupLearning.py new file mode 100644 index 0000000..6890cb5 --- /dev/null +++ b/Spider/Chapter03_网页数据的提取/BeautifulSoup库/BeautifulSoupLearning.py @@ -0,0 +1,244 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/8 16:08 +@Usage : +@Desc :参考 https://github.com/Python3WebSpider/BeautifulSoupTest +''' + +html = """ +The Dormouse's story + +

The Dormouse's story

+

Once upon a time there were three little sisters; and their names were +, +Lacie and +Tillie; +and they lived at the bottom of a well.

+

...

+""" +from bs4 import BeautifulSoup + + + +def baseUse(): + soup = BeautifulSoup(html, 'lxml') + print(soup.title) # The Dormouse's story + print(type(soup.title)) # + print(soup.title.string) # The Dormouse's story + print(soup.head) # The Dormouse's story + print(soup.p) #

The Dormouse's story

+ print(soup.p.name) # 获取节点名称 p + print(soup.p.attrs) # 获取属性 {'class': ['title'], 'name': 'dromouse'} + print(soup.p.attrs['name']) # 获取属性值 dromouse + print(soup.p['name']) # 获取属性值 dromouse + print(soup.body.p['name']) # 嵌套选择 dromouse + + print("==========================") + + +def child(): + html = """ + + + The Dormouse's story + + +

+ Once upon a time there were three little sisters; and their names were + + Elsie + + Lacie + and + Tillie + and they lived at the bottom of a well. +

+

...

+ """ + soup = BeautifulSoup(html, 'lxml') + # 子结点 + for i, child in enumerate(soup.p.children): + print(i, child) + print("===============================") + # 子孙节点 + for i, child in enumerate(soup.p.descendants): + print(i, child) + print("===============================") + + +def parent(): + soup = BeautifulSoup(html, 'lxml') + # 父节点 + print(soup.a.parent) + print("===============================") + # 祖父节点 + print(type(soup.a.parents)) + print(list(enumerate(soup.a.parents))) + print("=============================") + + +def brother(): + html = """ + + +

+ Once upon a time there were three little sisters; and their names were + + Elsie + + Hello + Lacie + and + Tillie + and they lived at the bottom of a well. +

+ """ + # 兄弟节点 + soup = BeautifulSoup(html, 'lxml') + print('Next Sibling', soup.a.next_sibling) + print('Prev Sibling', soup.a.previous_sibling) + print('Next Siblings', list(enumerate(soup.a.next_siblings))) + print('Prev Siblings', list(enumerate(soup.a.previous_siblings))) + +# 找到所有满足条件的 +def findAll(): + + html = ''' +
+
+

Hello

+
+
+
    +
  • Foo
  • +
  • Bar
  • +
  • Jay
  • +
+
    +
  • Foo
  • +
  • Bar
  • +
+
+
+ ''' + soup = BeautifulSoup(html, 'lxml') + print(soup.find_all(name='ul')) + print(type(soup.find_all(name='ul')[0])) + + for ul in soup.find_all(name='ul'): + print(ul.find_all(name='li')) + + for ul in soup.find_all(name='ul'): + print(ul.find_all(name='li')) + for li in ul.find_all(name='li'): + print(li.string) + + +# 找属性满足匹配得到 +def attrs(): + html = ''' +
+
+

Hello

+
+
+
    +
  • Foo
  • +
  • Bar
  • +
  • Jay
  • +
+
    +
  • Foo
  • +
  • Bar
  • +
+
+
+ ''' + + soup = BeautifulSoup(html, 'lxml') + print(soup.find_all(attrs={'id': 'list-1'})) + print(soup.find_all(attrs={'name': 'elements'})) + + # 常用的属性可以不用attrs传递 + soup = BeautifulSoup(html, 'lxml') + print(soup.find_all(id='list-1')) + print(soup.find_all(class_='element')) + import re + print(soup.find_all(string=re.compile('Foo')))# string等同于text,即里面的具体内容 + + +# 返回匹配到的第一个元素 +def find(): + html = ''' +
+
+

Hello

+
+
+
    +
  • Foo
  • +
  • Bar
  • +
  • Jay
  • +
+
    +
  • Foo
  • +
  • Bar
  • +
+
+
+ ''' + soup = BeautifulSoup(html, 'lxml') + print(soup.find(name='ul')) + print(type(soup.find(name='ul'))) + print(soup.find(class_='list')) + +# css选择器 +def cssSelect(): + html = ''' +
+
+

Hello

+
+
+
    +
  • Foo
  • +
  • Bar
  • +
  • Jay
  • +
+
    +
  • Foo
  • +
  • Bar
  • +
+
+
+ ''' + + soup = BeautifulSoup(html, 'lxml') + print(soup.select('.panel .panel-heading')) + print(soup.select('ul li')) + print(soup.select('#list-2 .element')) + print(type(soup.select('ul')[0])) + + # 嵌套选择 + soup = BeautifulSoup(html, 'lxml') + for ul in soup.select('ul'): + print(ul.select('li')) + + # 获取属性 + soup = BeautifulSoup(html, 'lxml') + for ul in soup.select('ul'): + print(ul['id']) + print(ul.attrs['id']) + + # 获取文本 + soup = BeautifulSoup(html, 'lxml') + for li in soup.select('li'): + print('Get Text:', li.get_text()) + print('String:', li.string) + + + +if __name__ == '__main__': + cssSelect() \ No newline at end of file diff --git a/Spider/Chapter03_网页数据的提取/BeautifulSoup库/__init__.py b/Spider/Chapter03_网页数据的提取/BeautifulSoup库/__init__.py new file mode 100644 index 0000000..4cced9b --- /dev/null +++ b/Spider/Chapter03_网页数据的提取/BeautifulSoup库/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/8 16:07 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter03_网页数据的提取/Pyquery库/__init__.py b/Spider/Chapter03_网页数据的提取/Pyquery库/__init__.py new file mode 100644 index 0000000..2460833 --- /dev/null +++ b/Spider/Chapter03_网页数据的提取/Pyquery库/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/8 16:54 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter03_网页数据的提取/Pyquery库/pyqueryLearning.py b/Spider/Chapter03_网页数据的提取/Pyquery库/pyqueryLearning.py new file mode 100644 index 0000000..af946f6 --- /dev/null +++ b/Spider/Chapter03_网页数据的提取/Pyquery库/pyqueryLearning.py @@ -0,0 +1,329 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/8 16:54 +@Usage : +@Desc :Pyquery学习 参考: https://github.com/Python3WebSpider/PyQueryTest +''' +from pyquery import PyQuery as pq + + +# 字符串初始化 +def stringBase(): + html = ''' +
+ +
+ ''' + + doc = pq(html) + print(doc('li')) + + +# URL初始化 +def URLBase(): + doc = pq(url='https://cuiqingcai.com') + print(doc('title')) + + # 上述代码等同于下面 + # doc = pq(requests.get('https://cuiqingcai.com').text) + # print(doc('title')) + + +# 文件初始化 +def fileBase(): + doc = pq(filename='demo.html') + print(doc('li')) + +# 基本的css选择器 +def cssSelect(): + html = ''' +
+ +
+ ''' + doc = pq(html) + print(doc('#container .list li')) + print(type(doc('#container .list li'))) + + # + for item in doc('#container .list li').items(): + print(item.text()) + +# 寻找子节点 +def child(): + html = ''' +
+ +
+ ''' + doc = pq(html) + items = doc('.list') + print(type(items)) + print(items) + lis = items.find('li') + print(type(lis)) + print(lis) + # + # + lis = items.children() + print(type(lis)) + print(lis) + + # + lis = items.children('.active') + print(lis) + + +def parent(): + html = ''' +
+
+ +
+
+ ''' + from pyquery import PyQuery as pq + doc = pq(html) + items = doc('.list') + container = items.parent() + print(type(container)) + print(container) + + from pyquery import PyQuery as pq + doc = pq(html) + items = doc('.list') + parents = items.parents() + print(type(parents)) + print(parents) + + parent = items.parents('.wrap') + print(parent) + + from pyquery import PyQuery as pq + doc = pq(html) + li = doc('.list .item-0.active') + print(li.siblings()) + +def brother(): + html = ''' +
+
+ +
+
+ ''' + from pyquery import PyQuery as pq + doc = pq(html) + li = doc('.list .item-0.active') + print(li.siblings('.active')) + + from pyquery import PyQuery as pq + doc = pq(html) + li = doc('.item-0.active') + print(li) + print(str(li)) + + from pyquery import PyQuery as pq + doc = pq(html) + # 可能是多个节点 + lis = doc('li').items() + print(type(lis)) + for li in lis: + print(li, type(li)) + +def attrs(): + html = ''' +
+
+ +
+
+ ''' + from pyquery import PyQuery as pq + doc = pq(html) + a = doc('.item-0.active a') + print(a, type(a)) + print(a.attr('href')) + + a = doc('a') + print(a, type(a)) + print(a.attr('href')) + print(a.attr.href) + + from pyquery import PyQuery as pq + doc = pq(html) + a = doc('a') + for item in a.items(): + # 获取属性和文本 + print(item.attr('href'),item.text()) + +def getHTML(): + html = ''' +
+ +
+ ''' + from pyquery import PyQuery as pq + doc = pq(html) + li = doc('li') + print(li.html()) # 第一个节点对应的html second item + print(li.text()) # 所有匹配的节点的文本 second item third item fourth item fifth item + print(type(li.text())) + +# 增加或者删除节点的class +def operateNode(): + html = ''' +
+
+ +
+
+ ''' + from pyquery import PyQuery as pq + doc = pq(html) + li = doc('.item-0.active') + print(li) + li.removeClass('active') + print(li) + li.addClass('active') + print(li) + + ''' +
  • third item
  • + +
  • third item
  • + +
  • third item
  • + ''' + + + +def operateNodeInformation(): + html = ''' + + ''' + from pyquery import PyQuery as pq + doc = pq(html) + li = doc('.item-0.active') + print(li) + li.attr('name', 'link') + print(li) + li.text('changed item') + print(li) + li.html('changed item') + print(li) + ''' +
  • third item
  • +
  • changed item
  • +
  • changed item
  • + ''' + + +def removeInformation(): + html = ''' +
    + Hello, World +

    This is a paragraph.

    +
    + ''' + from pyquery import PyQuery as pq + doc = pq(html) + wrap = doc('.wrap') + print(wrap.text()) + ''' + Hello, World + This is a paragraph. + ''' + wrap.find('p').remove() + print(wrap.text()) + ''' + Hello, World + ''' + +# 伪类选择器 +def fakeCSSSelect(): + html = ''' +
    +
    + +
    +
    + ''' + from pyquery import PyQuery as pq + doc = pq(html) + li = doc('li:first-child') + print(li) + li = doc('li:last-child') + print(li) + li = doc('li:nth-child(2)') + print(li) + li = doc('li:gt(2)') + print(li) + li = doc('li:nth-child(2n)') + print(li) + li = doc('li:contains(second)') + print(li) + + + +if __name__ == '__main__': + fakeCSSSelect() diff --git a/Spider/Chapter03_网页数据的提取/XPath库/XpathLearning.py b/Spider/Chapter03_网页数据的提取/XPath库/XpathLearning.py new file mode 100644 index 0000000..fc4c031 --- /dev/null +++ b/Spider/Chapter03_网页数据的提取/XPath库/XpathLearning.py @@ -0,0 +1,195 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/8 15:15 +@Usage : +@Desc : +''' + +from lxml import etree + +''' +XPath基本规则: + + 1) nodename:选择此节点的所有子节点 + 2) /:从当前节点选取直接子节点 + 3) //:从当前阶段选择子孙节点 + 4) .:选取当前节点 + 5) ..:选取当前节点的父节点 + 6) @:选取属性 + +举例: +//title[@lang='eng]代表选择所有名称为title,同时属性lang的值为eng的节点 +''' + + +def htmlByString(): + text = ''' +
    + +
    + ''' + html = etree.HTML(text) + result = etree.tostring(html) + print(result.decode('utf-8')) + + +def htmlByFile(): + html = etree.parse('./test.html', etree.HTMLParser()) + result = etree.tostring(html) + print(result.decode('utf-8')) + + +def allNode(): + html = etree.parse('./test.html', etree.HTMLParser()) + # 从头开始匹配所有的 + result = html.xpath('//*') + print(result) + print(result[0]) + + # 匹配所有li的 + result = html.xpath('//li') + print(result) + print(result[0]) + + +# 子节点匹配 +def childNode(): + html = etree.parse('./test.html', etree.HTMLParser()) + + # 匹配所有li的子节点a + result = html.xpath('//li/a') + print(result) + print(result[0]) + + # 匹配所有li的子孙节点a 相当于只要是子节点下面的就可以匹配上 + result = html.xpath('//ul//a') + print(result) + print(result[0]) + + +# 父节点匹配 +def fatherNode(): + html = etree.parse('./test.html', etree.HTMLParser()) + + # 匹配a节点属性href是link4.html的父节点的class属性 + result = html.xpath('//a[@href="link4.html"]/../@class') + print(result) + # 也可以通过parent::来获取 + result = html.xpath('//a[@href="link4.html"]/parent::*/@class') + print(result) + + +# 文本获取 +def textGet(): + html = etree.parse('./test.html', etree.HTMLParser()) + + # 匹配li节点属性class是item-0的节点的子节点a的text + result = html.xpath('//li[@class="item-0"]/a/text()') + print(result) # ['first item', 'fifth item'] + + # 匹配li节点属性class是item-0的节点的子孙节点的text + result = html.xpath('//li[@class="item-0"]//text()') + print(result) # ['first item', 'fifth item', '\r\n '] + + +# 属性获取 +def fieldGet(): + html = etree.parse('./test.html', etree.HTMLParser()) + + # 匹配li节点属性class是item-0的节点的子节点a的href属性 + result = html.xpath('//li/a/@href') + print(result) # ['link1.html', 'link2.html', 'link3.html', 'link4.html', 'link5.html'] + + +# 属性多值匹配 +def fieldsGet(): + text = ''' +
  • first item
  • + ''' + html = etree.HTML(text) + result = html.xpath('//li[@class="li"]/a/text()') + print(result) # [] 匹配不到 + + result = html.xpath('//li[contains(@class, "li")]/a/text()') + print(result) # ['first item'] contains匹配到了 + + +# 多属性匹配 +def fieldssGet(): + text = ''' +
  • first item
  • + ''' + html = etree.HTML(text) + # 多属性用and连接 + result = html.xpath('//li[contains(@class, "li") and @name="item"]/a/text()') + print(result) + + +# 按序选择 +def orderGet(): + text = ''' +
    + +
    + ''' + html = etree.HTML(text) + result = html.xpath('//li[1]/a/text()') + print(result) # ['first item'] + result = html.xpath('//li[last()]/a/text()') + print(result) # ['fifth item'] + result = html.xpath('//li[position()<3]/a/text()') + print(result) # ['first item', 'second item'] + result = html.xpath('//li[last()-2]/a/text()') + print(result) # ['third item'] + + +def nodeSelect(): + text = ''' +
    + +
    + ''' + html = etree.HTML(text) + result = html.xpath('//li[1]/ancestor::*') + print(result) + # ancestor获取祖先 + result = html.xpath('//li[1]/ancestor::div') + print(result) + # attribute获取所有属性 + result = html.xpath('//li[1]/attribute::*') + print(result) + # child获取子节点 + result = html.xpath('//li[1]/child::a[@href="link1.html"]') + print(result) + # descendant获取子孙结点 + result = html.xpath('//li[1]/descendant::span') + print(result) + # following获取当前节点之后的所有节点 + result = html.xpath('//li[1]/following::*[2]') + print(result) + # following-sibling获取当前节点之后的同级节点 + result = html.xpath('//li[1]/following-sibling::*') + print(result) + +if __name__ == '__main__': + nodeSelect() diff --git a/Spider/Chapter03_网页数据的提取/XPath库/__init__.py b/Spider/Chapter03_网页数据的提取/XPath库/__init__.py new file mode 100644 index 0000000..d92f042 --- /dev/null +++ b/Spider/Chapter03_网页数据的提取/XPath库/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/8 15:15 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter03_网页数据的提取/XPath库/test.html b/Spider/Chapter03_网页数据的提取/XPath库/test.html new file mode 100644 index 0000000..cb77f50 --- /dev/null +++ b/Spider/Chapter03_网页数据的提取/XPath库/test.html @@ -0,0 +1,9 @@ +
    + +
    \ No newline at end of file diff --git a/Spider/Chapter03_网页数据的提取/__init__.py b/Spider/Chapter03_网页数据的提取/__init__.py new file mode 100644 index 0000000..2e0ad3a --- /dev/null +++ b/Spider/Chapter03_网页数据的提取/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/8 15:12 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter04_数据存储/__init__.py b/Spider/Chapter04_数据存储/__init__.py new file mode 100644 index 0000000..d8993d5 --- /dev/null +++ b/Spider/Chapter04_数据存储/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 14:03 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter04_数据存储/saveJson.py b/Spider/Chapter04_数据存储/saveJson.py new file mode 100644 index 0000000..078669a --- /dev/null +++ b/Spider/Chapter04_数据存储/saveJson.py @@ -0,0 +1,50 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 14:39 +@Usage : +@Desc : 保存成Json +''' + +import json + +str = ''' +[{ + "name": "Bob", + "gender": "male", + "birthday": "1992-10-18" +}, { + "name": "Selina", + "gender": "female", + "birthday": "1995-10-18" +}] +''' +print(type(str)) +data = json.loads(str) +print(data) +print(type(data)) + +import json + +data = [{ + 'name': 'Bob', + 'gender': 'male', + 'birthday': '1992-10-18' +}] +with open('data.json', 'w', encoding='utf-8') as file: + file.write(json.dumps(data)) + +with open('data.json', 'w', encoding='utf-8') as file: + # indent就是有缩进的 + file.write(json.dumps(data, indent=2)) + +data = [{ + 'name': '张三', + 'gender': 'male', + 'birthday': '1992-10-18' +}] + +with open('data.json', 'w', encoding='utf-8') as file: + # indent就是有缩进的,ensure_ascii规定编码格式(输出中文) + file.write(json.dumps(data, indent=2, ensure_ascii=False)) diff --git a/Spider/Chapter04_数据存储/saveMySQL.py b/Spider/Chapter04_数据存储/saveMySQL.py new file mode 100644 index 0000000..877f8ce --- /dev/null +++ b/Spider/Chapter04_数据存储/saveMySQL.py @@ -0,0 +1,33 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 15:03 +@Usage : +@Desc : +''' + +import pymysql + +data = { + 'id': '20120001', + 'name': 'Bob', + 'age': 20 +} +# 通过字典动态构建插入语句 +table = 'students' +keys = ', '.join(data.keys()) +values = ', '.join(['%s'] * len(data)) +db = pymysql.connect(host='localhost', user='root', + password=None, port=3306, db='spiders') +cursor = db.cursor() +sql = 'INSERT INTO {table}({keys}) VALUES ({values})'.format( + table=table, keys=keys, values=values) +try: + if cursor.execute(sql, tuple(data.values())): + print('Successful') + db.commit() +except Exception as e: + print('Failed', e) + db.rollback() +db.close() diff --git a/Spider/Chapter04_数据存储/saveText.py b/Spider/Chapter04_数据存储/saveText.py new file mode 100644 index 0000000..abf0d8c --- /dev/null +++ b/Spider/Chapter04_数据存储/saveText.py @@ -0,0 +1,38 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 14:08 +@Usage : +@Desc :保存为Text +''' + +import requests +from pyquery import PyQuery as pq +import re + +url = 'https://ssr1.scrape.center/' +html = requests.get(url).text +doc = pq(html) +items = doc('.el-card').items() + +file = open('movies.txt', 'w', encoding='utf-8') +for item in items: + # 名称 + name = item.find('a > h2').text() + file.write(f'名称: {name}\n') + # 类别 + categories = [item.text() for item in item.find('.categories button span').items()] + file.write(f'类别: {categories}\n') + # 上映时间 + published_at = item.find('.info:contains(上映)').text() + published_at = re.search('(\d{4}-\d{2}-\d{2})', published_at).group(1) \ + if published_at and re.search('\d{4}-\d{2}-\d{2}', published_at) else None + file.write(f'上映时间: {published_at}\n') + # 评分 + score = item.find('p.score').text() + file.write(f'评分: {score}\n') + file.write(f'{"=" * 50}\n') +file.close() + + diff --git a/Spider/Chapter05_Ajax数据爬取/AjaxAnalyze.py b/Spider/Chapter05_Ajax数据爬取/AjaxAnalyze.py new file mode 100644 index 0000000..ff0cca5 --- /dev/null +++ b/Spider/Chapter05_Ajax数据爬取/AjaxAnalyze.py @@ -0,0 +1,67 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:01 +@Usage : +@Desc : +''' + +import requests +import logging +import json +from os import makedirs +from os.path import exists + +logging.basicConfig(level=logging.INFO, + format='%(asctime)s - %(levelname)s: %(message)s') + +INDEX_URL = 'https://spa1.scrape.center/api/movie/?limit={limit}&offset={offset}' +DETAIL_URL = 'https://spa1.scrape.center/api/movie/{id}' +LIMIT = 10 +TOTAL_PAGE = 10 +RESULTS_DIR = 'results' +exists(RESULTS_DIR) or makedirs(RESULTS_DIR) + + +def scrape_api(url): + logging.info('scraping %s...', url) + try: + response = requests.get(url) + if response.status_code == 200: + return response.json() + logging.error('get invalid status code %s while scraping %s', + response.status_code, url) + except requests.RequestException: + logging.error('error occurred while scraping %s', url, exc_info=True) + + +def scrape_index(page): + url = INDEX_URL.format(limit=LIMIT, offset=LIMIT * (page - 1)) + return scrape_api(url) + + +def scrape_detail(id): + url = DETAIL_URL.format(id=id) + return scrape_api(url) + + +def save_data(data): + name = data.get('name') + data_path = f'{RESULTS_DIR}/{name}.json' + json.dump(data, open(data_path, 'w', encoding='utf-8'), + ensure_ascii=False, indent=2) + + +def main(): + for page in range(1, TOTAL_PAGE + 1): + index_data = scrape_index(page) + for item in index_data.get('results'): + id = item.get('id') + detail_data = scrape_detail(id) + logging.info('detail data %s', detail_data) + save_data(detail_data) + + +if __name__ == '__main__': + main() diff --git a/Spider/Chapter05_Ajax数据爬取/__init__.py b/Spider/Chapter05_Ajax数据爬取/__init__.py new file mode 100644 index 0000000..9d340a4 --- /dev/null +++ b/Spider/Chapter05_Ajax数据爬取/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 15:58 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter06_异步爬虫/__init__.py b/Spider/Chapter06_异步爬虫/__init__.py new file mode 100644 index 0000000..493467f --- /dev/null +++ b/Spider/Chapter06_异步爬虫/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:19 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter06_异步爬虫/aiohttpTest.py b/Spider/Chapter06_异步爬虫/aiohttpTest.py new file mode 100644 index 0000000..34976cd --- /dev/null +++ b/Spider/Chapter06_异步爬虫/aiohttpTest.py @@ -0,0 +1,28 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:57 +@Usage : aiohttp库的使用 +@Desc : +@参考:https://github.dev/Python3WebSpider/AsyncTest demo12 +''' + +import aiohttp +import asyncio + + +async def fetch(session, url): + async with session.get(url) as response: + return await response.text(), response.status + + +async def main(): + async with aiohttp.ClientSession() as session: + html, status = await fetch(session, 'https://cuiqingcai.com') + print(f'html: {html[:100]}...') + print(f'status: {status}') + + +if __name__ == '__main__': + asyncio.run(main()) diff --git a/Spider/Chapter06_异步爬虫/asynchttp/__init__.py b/Spider/Chapter06_异步爬虫/asynchttp/__init__.py new file mode 100644 index 0000000..e1b7fd4 --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asynchttp/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 17:02 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter06_异步爬虫/asynchttp/aiohttpPractice.py b/Spider/Chapter06_异步爬虫/asynchttp/aiohttpPractice.py new file mode 100644 index 0000000..33945b7 --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asynchttp/aiohttpPractice.py @@ -0,0 +1,86 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 19:14 +@Usage : +@Desc : +''' +import asyncio +import aiohttp +import logging +from motor.motor_asyncio import AsyncIOMotorClient + +logging.basicConfig(level=logging.INFO, + format='%(asctime)s - %(levelname)s: %(message)s') + +INDEX_URL = 'https://spa5.scrape.center/api/book/?limit=18&offset={offset}' +DETAIL_URL = 'https://spa5.scrape.center/api/book/{id}' +PAGE_SIZE = 18 +PAGE_NUMBER = 1 +CONCURRENCY = 5 + +session = None + +MONGO_CONNECTION_STRING = 'mongodb://localhost:27017' +MONGO_DB_NAME = 'books' +MONGO_COLLECTION_NAME = 'books' + +client = AsyncIOMotorClient(MONGO_CONNECTION_STRING) +db = client[MONGO_DB_NAME] +collection = db[MONGO_COLLECTION_NAME] + +semaphore = asyncio.Semaphore(CONCURRENCY) + + +async def scrape_api(url): + async with semaphore: + try: + logging.info('scraping %s', url) + async with session.get(url) as response: + return await response.json() + except aiohttp.ClientError: + logging.error('error occurred while scraping %s', url, exc_info=True) + + +async def scrape_index(page): + url = INDEX_URL.format(offset=PAGE_SIZE * (page - 1)) + return await scrape_api(url) + + +async def scrape_detail(id): + url = DETAIL_URL.format(id=id) + data = await scrape_api(url) + await save_data(data) + + +async def save_data(data): + logging.info('saving data %s', data) + if data: + return await collection.update_one({ + 'id': data.get('id') + }, { + '$set': data + }, upsert=True) + + +async def main(): + # index tasks + global session + session = aiohttp.ClientSession() + scrape_index_tasks = [asyncio.ensure_future(scrape_index(page)) for page in range(1, PAGE_NUMBER + 1)] + results = await asyncio.gather(*scrape_index_tasks) + # detail tasks + print('results', results) + ids = [] + for index_data in results: + if not index_data: continue + for item in index_data.get('results'): + ids.append(item.get('id')) + scrape_detail_tasks = [asyncio.ensure_future(scrape_detail(id)) for id in ids] + await asyncio.wait(scrape_detail_tasks) + await session.close() + + +if __name__ == '__main__': + asyncio.run(main()) diff --git a/Spider/Chapter06_异步爬虫/asynchttp/aiohttpTest.py b/Spider/Chapter06_异步爬虫/asynchttp/aiohttpTest.py new file mode 100644 index 0000000..b337865 --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asynchttp/aiohttpTest.py @@ -0,0 +1,64 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:57 +@Usage : aiohttp库的使用 +@Desc : +@参考:https://github.dev/Python3WebSpider/AsyncTest demo12 +''' + +import aiohttp +import asyncio + + +async def fetch(session, url): + async with session.get(url) as response: + return await response.text(), response.status + + +async def main(): + async with aiohttp.ClientSession() as session: + html, status = await fetch(session, 'https://cuiqingcai.com') + print(f'html: {html[:100]}...') + print(f'status: {status}') + + +# 给url参数 +async def main1(): + params = {'name': 'germey', 'age': 25} + async with aiohttp.ClientSession() as session: + async with session.get('https://httpbin.org/get', params=params) as response: + print(await response.text()) + ''' + session还支持其他请求类型: + session.post('https://httpbin.org/post', data=b'data') + session.put('https://httpbin.org/put', data=b'data') + session.delete('https://httpbin.org/delete') + session.head('https://httpbin.org/get') + session.options('https://httpbin.org/get') + session.patch('https://httpbin.org/patch', data=b'data') + ''' + +# 返回的response对象 +async def main2(): + data = {'name': 'germey', 'age': 25} + # 有些返回字段前面需要加await有些则不需要,原则是,如果返回的是一个协程对象(如async修饰的方法), + # 那么前面就要加await,具体可以看aiohttp的API,其链接为 https://docs.aiohttp.org/en/stable/client_reference.html + async with aiohttp.ClientSession() as session: + async with session.post('https://httpbin.org/post', data=data) as response: + print('status:', response.status) + print('headers:', response.headers) + print('body:', await response.text()) + print('bytes:', await response.read()) + print('json:', await response.json()) + +# 超时设置 +async def main3(): + timeout = aiohttp.ClientTimeout(total=0.1) + async with aiohttp.ClientSession(timeout=timeout) as session: + async with session.get('https://httpbin.org/get') as response: + print('status:', response.status) + +if __name__ == '__main__': + asyncio.run(main2()) diff --git a/Spider/Chapter06_异步爬虫/asynchttp/aiohttpTest2.py b/Spider/Chapter06_异步爬虫/asynchttp/aiohttpTest2.py new file mode 100644 index 0000000..565a856 --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asynchttp/aiohttpTest2.py @@ -0,0 +1,42 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:57 +@Usage : 并发限制 防止一次太多爬崩网站 semaphore +@Desc : +@参考:https://github.dev/Python3WebSpider/AsyncTest +''' + +import aiohttp +import asyncio + +CONCURRENCY = 5 +URL = 'https://www.baidu.com/' + +semaphore = asyncio.Semaphore(CONCURRENCY) +session = None + + +async def scrape_api(): + async with semaphore: + print('scraping', URL) + async with session.get(URL) as response: + # await asyncio.sleep(1) + return await response.text() + + +async def main(): + global session + + session = aiohttp.ClientSession() + scrape_index_tasks = [asyncio.ensure_future(scrape_api()) for _ in range(10000)] + await asyncio.gather(*scrape_index_tasks) + await asyncio.wait(scrape_index_tasks) + await session.close() + + + +if __name__ == '__main__': + # asyncio.run(main()) + asyncio.get_event_loop().run_until_complete(main()) diff --git a/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync.py b/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync.py new file mode 100644 index 0000000..e0a3f57 --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync.py @@ -0,0 +1,27 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:34 +@Usage : 多任务协程 +@Desc : +@参考: https://github.dev/Python3WebSpider/AsyncTest +''' + +import asyncio +import requests + +async def request(): + url = 'https://www.baidu.com' + status = requests.get(url) + return status + +tasks = [asyncio.ensure_future(request()) for _ in range(5)] +print('Tasks:', tasks) + +loop = asyncio.get_event_loop() +# 五个任务被顺序执行 +loop.run_until_complete(asyncio.wait(tasks)) + +for task in tasks: + print('Task Result:', task.result()) \ No newline at end of file diff --git a/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync2.py b/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync2.py new file mode 100644 index 0000000..ca0d04b --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync2.py @@ -0,0 +1,33 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:34 +@Usage : 多任务协程展示协程的优势 +@Desc : +@参考: https://github.dev/Python3WebSpider/AsyncTest demo8_1和demo9_1 demo10 + +''' + + +import asyncio +import requests +import time + +start = time.time() + + +# 单个执行每个都至少要5秒 +async def request(): + url = 'https://httpbin.org/delay/5' + print('Waiting for', url) + # 这里无论是加await还是不加await都无法实现真正意义上的异步 需要使用aiohttp + response = requests.get(url) + print('Get response from', url, 'response', response) + +tasks = [asyncio.ensure_future(request()) for _ in range(10)] +loop = asyncio.get_event_loop() +loop.run_until_complete(asyncio.wait(tasks)) + +end = time.time() +print('Cost time:', end - start) \ No newline at end of file diff --git a/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync3.py b/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync3.py new file mode 100644 index 0000000..d60feda --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asyncio/MultiTaskAsync3.py @@ -0,0 +1,40 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:34 +@Usage : 多任务协程展示协程的优势 +@Desc : +@参考: https://github.dev/Python3WebSpider/AsyncTest demo11 + +''' + +import asyncio +import aiohttp +import time + +start = time.time() + + +async def get(url): + session = aiohttp.ClientSession() + response = await session.get(url) + await response.text() + await session.close() + return response + + +async def request(): + url = 'https://httpbin.org/delay/5' + print('Waiting for', url) + response = await get(url) + print('Get response from', url, 'response', response) + + +tasks = [asyncio.ensure_future(request()) for _ in range(100)] +loop = asyncio.get_event_loop() +loop.run_until_complete(asyncio.wait(tasks)) + +end = time.time() +print('Cost time:', end - start) +# Cost time: 7.670234203338623 diff --git a/Spider/Chapter06_异步爬虫/asyncio/__init__.py b/Spider/Chapter06_异步爬虫/asyncio/__init__.py new file mode 100644 index 0000000..e1b7fd4 --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asyncio/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 17:02 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter06_异步爬虫/asyncio/asyncTest1.py b/Spider/Chapter06_异步爬虫/asyncio/asyncTest1.py new file mode 100644 index 0000000..7f3ba74 --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asyncio/asyncTest1.py @@ -0,0 +1,29 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:20 +@Usage : asyncio库 可以使用async和await关键字 +@Desc :异步爬虫测试 定义协程 +@参考:https://github.dev/Python3WebSpider/AsyncTest +''' +import asyncio + + +async def execute(x): + print('Number:', x) + return x + +# 创建一个协程对象 coroutine +coroutine = execute(1) + +print('Coroutine:', coroutine) +print('After calling execute') + +loop = asyncio.get_event_loop() + +task = loop.create_task(coroutine) +print('Task:', task) +loop.run_until_complete(task) +print('Task:', task) +print('After calling loop') diff --git a/Spider/Chapter06_异步爬虫/asyncio/asyncTest2.py b/Spider/Chapter06_异步爬虫/asyncio/asyncTest2.py new file mode 100644 index 0000000..d02416b --- /dev/null +++ b/Spider/Chapter06_异步爬虫/asyncio/asyncTest2.py @@ -0,0 +1,38 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 16:20 +@Usage : asyncio库 可以使用async和await关键字 +@Desc :异步爬虫测试 定义协程 为某一个task绑定回调方法 +@参考:https://github.dev/Python3WebSpider/AsyncTest +''' +import asyncio +import requests + + +async def request(): + url = 'https://www.baidu.com' + status = requests.get(url) + return status + + +def callback(task): + print('Status:', task.result()) + + +coroutine = request() +task = asyncio.ensure_future(coroutine) +# 绑定回调,来保证顺序 +task.add_done_callback(callback) +print('Task:', task) + +loop = asyncio.get_event_loop() +loop.run_until_complete(task) +print('Task:', task) + +# 直接通过task.result()也可以直接获取结果达到类似的效果 +loop = asyncio.get_event_loop() +loop.run_until_complete(task) +print('Task:', task) +print('Task Result:', task.result()) diff --git a/Spider/Chapter07_动态渲染页面爬取/PyppeteerPractice.py b/Spider/Chapter07_动态渲染页面爬取/PyppeteerPractice.py new file mode 100644 index 0000000..7654840 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/PyppeteerPractice.py @@ -0,0 +1,104 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 19:15 +@Usage : +@Desc : +''' + +import logging +from os.path import exists +from os import makedirs +import json +import asyncio +from pyppeteer import launch +from pyppeteer.errors import TimeoutError + +logging.basicConfig(level=logging.INFO, + format='%(asctime)s - %(levelname)s: %(message)s') + +INDEX_URL = 'https://spa2.scrape.center/page/{page}' +TIMEOUT = 10 +TOTAL_PAGE = 10 +RESULTS_DIR = 'results' +WINDOW_WIDTH, WINDOW_HEIGHT = 1366, 768 + +exists(RESULTS_DIR) or makedirs(RESULTS_DIR) + +browser, tab = None, None +HEADLESS = True + + +async def init(): + global browser, tab + browser = await launch(headless=HEADLESS, + args=['--disable-infobars', f'--window-size={WINDOW_WIDTH},{WINDOW_HEIGHT}']) + tab = await browser.newPage() + await tab.setViewport({'width': WINDOW_WIDTH, 'height': WINDOW_HEIGHT}) + + +async def scrape_page(url, selector): + logging.info('scraping %s', url) + try: + await tab.goto(url) + await tab.waitForSelector(selector, options={ + 'timeout': TIMEOUT * 1000 + }) + except TimeoutError: + logging.error('error occurred while scraping %s', url, exc_info=True) + + +async def scrape_index(page): + url = INDEX_URL.format(page=page) + await scrape_page(url, '.item .name') + + +async def parse_index(): + return await tab.querySelectorAllEval('.item .name', 'nodes => nodes.map(node => node.href)') + + +async def scrape_detail(url): + await scrape_page(url, 'h2') + + +async def parse_detail(): + url = tab.url + name = await tab.querySelectorEval('h2', 'node => node.innerText') + categories = await tab.querySelectorAllEval('.categories button span', 'nodes => nodes.map(node => node.innerText)') + cover = await tab.querySelectorEval('.cover', 'node => node.src') + score = await tab.querySelectorEval('.score', 'node => node.innerText') + drama = await tab.querySelectorEval('.drama p', 'node => node.innerText') + return { + 'url': url, + 'name': name, + 'categories': categories, + 'cover': cover, + 'score': score, + 'drama': drama + } + + +async def save_data(data): + name = data.get('name') + data_path = f'{RESULTS_DIR}/{name}.json' + json.dump(data, open(data_path, 'w', encoding='utf-8'), ensure_ascii=False, indent=2) + + +async def main(): + await init() + try: + for page in range(1, TOTAL_PAGE + 1): + await scrape_index(page) + detail_urls = await parse_index() + for detail_url in detail_urls: + await scrape_detail(detail_url) + detail_data = await parse_detail() + logging.info('data %s', detail_data) + await save_data(detail_data) + finally: + await browser.close() + + +if __name__ == '__main__': + asyncio.get_event_loop().run_until_complete(main()) diff --git a/Spider/Chapter07_动态渲染页面爬取/SeleniumPractice.py b/Spider/Chapter07_动态渲染页面爬取/SeleniumPractice.py new file mode 100644 index 0000000..608fe7c --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/SeleniumPractice.py @@ -0,0 +1,111 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 15:58 +@Usage : 使用Selenium实战爬取 https://spa2.scrape.center/ +@Desc : 该网站爬取详情页时存在一个token,这个token的实现逻辑可能不确定,并且随事件发生变化, +因此需要使用Selenium模拟浏览器操作跳过这段逻辑 +''' +from selenium import webdriver +from selenium.common.exceptions import TimeoutException +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.common.by import By +from selenium.webdriver.support.wait import WebDriverWait +from os import makedirs +from os.path import exists +import logging +from urllib.parse import urljoin +import json + +logging.basicConfig(level=logging.INFO, + format='%(asctime)s - %(levelname)s: %(message)s') + +INDEX_URL = 'https://spa2.scrape.center/page/{page}' +Timeout = 10 +Total_page = 10 +RESULTS_DIR = 'result' + +exists(RESULTS_DIR) or makedirs(RESULTS_DIR) + +# 防止有一些网站设置反屏蔽手段 +options = webdriver.ChromeOptions() +options.add_experimental_option('excludeSwitches', ['enable-automation']) +options.add_experimental_option('useAutomationExtension', False) + +# 显示设置超时时间 +browser = webdriver.Chrome(options=options) +wait = WebDriverWait(browser, Timeout) + + +# 爬取网页 +def scrape_page(url, condition, locator): + logging.info('scraping %s', url) + try: + browser.get(url) + # 设置等待 + wait.until(condition(locator)) + except TimeoutException: + logging.error('error occurred while scraping %s', url, exc_info=True) + + +def scrape_index(page): + url = INDEX_URL.format(page=page) + # 设置等待条件为当所有的index下面的子item都出来之后 + scrape_page(url, EC.visibility_of_all_elements_located, locator=(By.CSS_SELECTOR, '#index .item')) + + +def parse_index(): + titles = browser.find_elements(By.CSS_SELECTOR, '#index .item .name') + for title in titles: + href = title.get_attribute("href") + yield urljoin(INDEX_URL, href) + + +def scrape_detail(url): + return scrape_page(url, EC.visibility_of_element_located, (By.TAG_NAME, 'h2')) + + +def parse_detail(): + url = browser.current_url + name = browser.find_element(By.TAG_NAME, 'h2').text + category = [element.text for element in browser.find_elements(By.CSS_SELECTOR, '.categories button span')] + cover = browser.find_element(By.CLASS_NAME, 'cover').get_attribute("src") + score = browser.find_element(By.CLASS_NAME, 'score').text + drama = browser.find_element(By.CSS_SELECTOR, '.drama p').text + return { + "url": url, + "name": name, + "category": category, + "cover": cover, + "score": score, + "drama": drama + } + + +def save_data(data): + name = data.get('name') + data_path = f'{RESULTS_DIR}/{name}.json' + json.dump(data, open(data_path, 'w', encoding='utf-8'), ensure_ascii=False, indent=2) + +def main(): + try: + + for page in range(1, Total_page + 1): + scrape_index(page) + # 页面加载完毕之后,获取对应的url + detail_urls=list(parse_index()) + # logging.info('detail data %s', list(detail_urls)) + # 遍历所有的detail_urls,获取详情页信息 + for detail_url in detail_urls: + scrape_detail(detail_url) + detail_info = parse_detail() + logging.info('detail info %s', detail_info) + save_data(detail_info) + + finally: + browser.close() + + +if __name__ == '__main__': + main() diff --git a/Spider/Chapter07_动态渲染页面爬取/__init__.py b/Spider/Chapter07_动态渲染页面爬取/__init__.py new file mode 100644 index 0000000..6eaa040 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 19:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/css位置偏移反爬样式分析/__init__.py b/Spider/Chapter07_动态渲染页面爬取/css位置偏移反爬样式分析/__init__.py new file mode 100644 index 0000000..edd8101 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/css位置偏移反爬样式分析/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 19:32 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/css位置偏移反爬样式分析/main1.py b/Spider/Chapter07_动态渲染页面爬取/css位置偏移反爬样式分析/main1.py new file mode 100644 index 0000000..c4189d0 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/css位置偏移反爬样式分析/main1.py @@ -0,0 +1,59 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 19:32 +@Usage : +@Desc : +''' + +from selenium import webdriver +from pyquery import PyQuery as pq +from selenium.webdriver.common.by import By +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.wait import WebDriverWait +import re + + +# 解析名字,排序获得正确的顺序 +def parse_name(name_html): + chars = name_html('.char') + items = [] + for char in chars.items(): + items.append({ + 'text': char.text().strip(), + 'left': int(re.search('(\d+)px', char.attr('style')).group(1)) + }) + items = sorted(items, key=lambda x: x['left'], reverse=False) + return ''.join([item.get('text') for item in items]) + + +# 判断如果是完整的就不进行下述操作 +def parse_name_whole(name_html): + has_whole = name_html('.whole') + if has_whole: + return name_html.text() + else: + chars = name_html('.char') + items = [] + for char in chars.items(): + items.append({ + 'text': char.text().strip(), + 'left': int(re.search('(\d+)px', char.attr('style')).group(1)) + }) + items = sorted(items, key=lambda x: x['left'], reverse=False) + return ''.join([item.get('text') for item in items]) + + +browser = webdriver.Chrome() +browser.get('https://antispider3.scrape.center/') +WebDriverWait(browser, 10) \ + .until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, '.item'))) +html = browser.page_source +doc = pq(html) +names = doc('.item .name') + +for name_html in names.items(): + name = parse_name_whole(name_html) + print(name) +browser.close() diff --git a/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/__init__.py b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/__init__.py new file mode 100644 index 0000000..98d663a --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 13:27 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo1基本使用.py b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo1基本使用.py new file mode 100644 index 0000000..fcfde1c --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo1基本使用.py @@ -0,0 +1,40 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 13:34 +@Usage : playwright基本使用 +@Desc : +@参考:https://github.dev/Python3WebSpider/PlaywrightTest +''' + +# playwright既支持Pyppetter的异步模式,又支持selenium的同步模式 +import asyncio +# 同步模式 +from playwright.sync_api import sync_playwright + +with sync_playwright() as p: + for browser_type in [p.chromium, p.firefox, p.webkit]: + browser = browser_type.launch(headless=False) + page = browser.new_page() + page.goto('https://www.baidu.com') + page.screenshot(path=f'screenshot-{browser_type.name}.png') + print(page.title()) + browser.close() + + +# 异步模式 +from playwright.async_api import async_playwright + + +async def main(): + async with async_playwright() as p: + for browser_type in [p.chromium, p.firefox, p.webkit]: + browser = await browser_type.launch(headless=False) + page = await browser.new_page() + await page.goto('https://www.baidu.com') + await page.screenshot(path=f'screenshot-{browser_type.name}.png') + print(await page.title()) + await browser.close() + +asyncio.run(main()) \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo2代码生成.py b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo2代码生成.py new file mode 100644 index 0000000..d03f4a8 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo2代码生成.py @@ -0,0 +1,34 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 14:00 +@Usage : +@Desc :playWright有一个强大的功能,是可以录制我们在浏览器中的操作并自动生成代码 +''' + +from playwright.sync_api import Playwright, sync_playwright, expect + + +def run(playwright: Playwright) -> None: + browser = playwright.firefox.launch(headless=False) + # 这里使用context而不是browser,可以让每个context都是一个独立的上下文环境,资源隔离 + context = browser.new_context() + page = context.new_page() + page.goto("https://www.baidu.com/") + page.locator("#kw").click() + page.locator("#kw").fill("python") + page.get_by_role("button", name="百度一下").click() + page.get_by_role("button", name="百度一下").click() + page.locator("#kw").click() + page.locator("#kw").fill("nba") + page.get_by_role("button", name="百度一下").click() + page.close() + + # --------------------- + context.close() + browser.close() + + +with sync_playwright() as playwright: + run(playwright) \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo3移动端浏览器.py b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo3移动端浏览器.py new file mode 100644 index 0000000..9549a92 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo3移动端浏览器.py @@ -0,0 +1,44 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 14:40 +@Usage : +@Desc :playwright还支持移动端浏览器 +''' + +import time +from playwright.sync_api import sync_playwright + +# 模拟打开iPhone 12 Pro Max的safari浏览器 +with sync_playwright() as p: + iphone_12_pro_max = p.devices['iPhone 12 Pro Max'] + browser = p.webkit.launch(headless=False) + context = browser.new_context( + **iphone_12_pro_max, + locale='zh-CN', + ) + page = context.new_page() + page.goto('https://www.whatismybrowser.com/') + # 等待页面的某个状态完成,这里传入的state是networkidle,表示网络空闲状态 + page.wait_for_load_state(state='networkidle') + page.screenshot(path='browser-info.png') + time.sleep(10) + browser.close() + + +with sync_playwright() as p: + iphone_12_pro_max = p.devices['iPhone 12 Pro Max'] + browser = p.webkit.launch(headless=False) + context = browser.new_context( + **iphone_12_pro_max, + locale='zh-CN', + geolocation={'longitude': 116.39014, 'latitude': 39.913904}, + permissions=['geolocation'] + ) + page = context.new_page() + page.goto('https://amap.com') + page.wait_for_load_state(state='networkidle') + page.screenshot(path='location-iphone.png') + time.sleep(10) + browser.close() diff --git a/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo4常用操作.py b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo4常用操作.py new file mode 100644 index 0000000..e638d84 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/demo4常用操作.py @@ -0,0 +1,100 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 15:12 +@Usage : +@Desc : playwright常用操作 +''' + +from playwright.sync_api import sync_playwright + + +# 事件监听 +def on_response(response): + print(f'Statue {response.status}: {response.url}') + + +# 截获ajax命令 +def on_response1(response): + if '/api/movie/' in response.url and response.status == 200: + print(response.json()) + + +with sync_playwright() as p: + browser = p.chromium.launch(headless=False) + page = browser.new_page() + # 监听response时间,每次网络请求得到响应的时候会触发这个事件 + # page.on('response', on_response) + page.on('response', on_response1) + page.goto('https://spa6.scrape.center/') + page.wait_for_load_state('networkidle') + browser.close() + +获取页面源代码 +with sync_playwright() as p: + browser = p.chromium.launch(headless=False) + page = browser.new_page() + page.goto('https://spa6.scrape.center/') + page.wait_for_load_state('networkidle') + html = page.content() + print(html) + browser.close() + +# 获取节点内容 +with sync_playwright() as p: + browser = p.chromium.launch(headless=False) + page = browser.new_page() + page.goto('https://spa6.scrape.center/') + page.wait_for_load_state('networkidle') + # 代表查找class为name的a节点,第二个参数传href表示获取超链接的内容 + href = page.get_attribute('a.name', 'href') + print(href) + browser.close() + +# 获取多个节点 +with sync_playwright() as p: + browser = p.chromium.launch(headless=False) + page = browser.new_page() + page.goto('https://spa6.scrape.center/') + page.wait_for_load_state('networkidle') + elements = page.query_selector_all('a.name') + for element in elements: + print(element.get_attribute('href')) + print(element.text_content()) + browser.close() + +# 网络拦截 +import re + +with sync_playwright() as p: + browser = p.chromium.launch(headless=False) + page = browser.new_page() + + + def canel_request(route, request): + route.abort() + + + page.route(re.compile(r"(\.png)|(\.jpg)"), canel_request) + page.goto("https://spa6.scrape.center/") + page.wait_for_load_state("networkidle") + page.screenshot(path='no_picture.png') + browser.close() + +# 拦截之后填充自己的 +import time + +with sync_playwright() as p: + browser = p.chromium.launch(headless=False) + page = browser.new_page() + + + def modify_response(route, request): + route.fulfill(path="./custom_response.html") + + + page.route('/', modify_response) + page.goto("https://spa6.scrape.center/") + time.sleep(10) + browser.close() diff --git a/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/script.py b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/script.py new file mode 100644 index 0000000..ce7e7e7 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/playwrightLearning/script.py @@ -0,0 +1,24 @@ +from playwright.sync_api import Playwright, sync_playwright, expect + + +def run(playwright: Playwright) -> None: + browser = playwright.firefox.launch(headless=False) + context = browser.new_context() + page = context.new_page() + page.goto("https://www.baidu.com/") + page.locator("#kw").click() + page.locator("#kw").fill("python") + page.get_by_role("button", name="百度一下").click() + page.get_by_role("button", name="百度一下").click() + page.locator("#kw").click() + page.locator("#kw").fill("nba") + page.get_by_role("button", name="百度一下").click() + page.close() + + # --------------------- + context.close() + browser.close() + + +with sync_playwright() as playwright: + run(playwright) diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/__init__.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/__init__.py new file mode 100644 index 0000000..763ab1f --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 19:53 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo1.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo1.py new file mode 100644 index 0000000..70db6fc --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo1.py @@ -0,0 +1,30 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 19:53 +@Usage : +@Desc : selenium基本用法 +@参考: https://github.dev/Python3WebSpider/SeleniumTest +''' + +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.common.keys import Keys +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.wait import WebDriverWait + +browser = webdriver.Chrome() +try: + browser.get('https://www.baidu.com') + # input = browser.find_element_by_id('kw') 旧版写法,selenium4.0以上使用下面的写法 + input = browser.find_element(By.ID, 'kw') + input.send_keys('Python') + input.send_keys(Keys.ENTER) + wait = WebDriverWait(browser, 10) + wait.until(EC.presence_of_element_located((By.ID, 'content_left'))) + print(browser.current_url) + print(browser.get_cookies()) + print(browser.page_source) +finally: + browser.close() diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo10Cookie.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo10Cookie.py new file mode 100644 index 0000000..5a6c888 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo10Cookie.py @@ -0,0 +1,18 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 21:11 +@Usage : 对Cookie进行操作 +@Desc :获取,添加,删除cookie +''' + +from selenium import webdriver + +browser = webdriver.Chrome() +browser.get('https://www.zhihu.com/explore') +print(browser.get_cookies()) +browser.add_cookie({'name': 'name', 'domain': 'www.zhihu.com', 'value': 'germey'}) +print(browser.get_cookies()) +browser.delete_all_cookies() +print(browser.get_cookies()) \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo11选项卡管理.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo11选项卡管理.py new file mode 100644 index 0000000..e4d535a --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo11选项卡管理.py @@ -0,0 +1,22 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 21:14 +@Usage : 选项卡管理 +@Desc : 访问页面的时候会开起一个个选项卡 +''' + +import time +from selenium import webdriver + +browser = webdriver.Chrome() +browser.get('https://www.baidu.com') +# 开启一个新的选项卡 +browser.execute_script('window.open()') +print(browser.window_handles) +browser.switch_to.window(browser.window_handles[1]) +browser.get('https://www.taobao.com') +time.sleep(1) +browser.switch_to.window(browser.window_handles[0]) +browser.get('https://python.org') \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo12异常处理.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo12异常处理.py new file mode 100644 index 0000000..c6a81d6 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo12异常处理.py @@ -0,0 +1,26 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 21:17 +@Usage : 异常处理 +@Desc : 可能会遇到获取节点失败的异常,可以对异常进行处理 +''' + +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.common.exceptions import TimeoutException, NoSuchElementException + +browser = webdriver.Chrome() + +try: + browser.get('https://www.baidu.com') +except TimeoutException: + print('Time out') + +try: + browser.find_element(By.ID, 'hello') +except NoSuchElementException: + print('No Such Element') +finally: + browser.close() diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo13反屏蔽.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo13反屏蔽.py new file mode 100644 index 0000000..687e4c8 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo13反屏蔽.py @@ -0,0 +1,33 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 21:20 +@Usage : 反屏蔽 +@Desc : 现在很多网站增加了对Selenium的监测,如果检测到Selenium打开浏览器就直接屏蔽 +基本原理是监测当前浏览器窗口下的window.navigator对象中是否包含webdriver属性。 +正常使用浏览器这个属性应该是undefined,一旦使用了Selenium,就会给window.navigator设置webdriver属性 +https://antispider1.scrape.center/ 就是使用了上述原理 +''' +from selenium import webdriver +from selenium.webdriver import ChromeOptions + +option = ChromeOptions() +option.add_experimental_option('excludeSwitches', ['enable-automation']) +option.add_experimental_option('useAutomationExtension', False) +browser = webdriver.Chrome(options=option) +# 无效,因为这是页面加载完毕之后才执行,但是页面渲染之前已经检测了 +browser.execute_script('Object.defineProperty(navigator, "webdriver", {get: () => undefined})') +browser.get('https://antispider1.scrape.center/') + + + +# 使用CDP(chrome开发工具协议)解决这个问题,在每个页面刚加载的时候就执行JavaScript语句,将webdriver置空 +option = ChromeOptions() +option.add_experimental_option('excludeSwitches', ['enable-automation']) +option.add_experimental_option('useAutomationExtension', False) +browser = webdriver.Chrome(options=option) +browser.execute_cdp_cmd('Page.addScriptToEvaluateOnNewDocument', { + 'source': 'Object.defineProperty(navigator, "webdriver", {get: () => undefined})' +}) +browser.get('https://antispider1.scrape.cuiqingcai.com/') diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo14无头模式.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo14无头模式.py new file mode 100644 index 0000000..86af476 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo14无头模式.py @@ -0,0 +1,20 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 21:31 +@Usage : 无头模式 +@Desc : 之前的案例运行时,总会弹出一个路浏览器窗口 +现在已经支持无头模式Headless +''' + + +from selenium import webdriver +from selenium.webdriver import ChromeOptions + +option = ChromeOptions() +option.add_argument('--headless') +browser = webdriver.Chrome(options=option) +browser.set_window_size(1366, 768) +browser.get('https://www.baidu.com') +browser.get_screenshot_as_file('preview.png') \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo2.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo2.py new file mode 100644 index 0000000..039facc --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo2.py @@ -0,0 +1,22 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 19:59 +@Usage : +@Desc :selenium访问页面与查找节点 +''' + +from selenium import webdriver +from selenium.webdriver.common.by import By + +browser = webdriver.Chrome() +browser.get('https://www.taobao.com') +input_first = browser.find_element(By.ID, 'q') +input_second = browser.find_element(By.CSS_SELECTOR, '#q') +input_third = browser.find_element(By.XPATH, '//*[@id="q"]') +print(input_first, input_second, input_third) +# 多个节点 +lis = browser.find_elements(By.CSS_SELECTOR,'.service-bd li') +print(lis) +browser.close() diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo3.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo3.py new file mode 100644 index 0000000..4840b3d --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo3.py @@ -0,0 +1,23 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 20:04 +@Usage : +@Desc :selenium节点交互 驱动浏览器实现一些操作 +''' + +from selenium import webdriver +from selenium.webdriver.common.by import By +import time + +browser = webdriver.Chrome() +browser.get('https://www.taobao.com') +input = browser.find_element(By.ID, 'q') +input.send_keys('iPhone') # 输入文字 +time.sleep(1) +input.clear() # 清空文字 +input.send_keys('iPad') +button = browser.find_element(By.CLASS_NAME, 'btn-search') +button.click() # 点击搜索 + diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo4.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo4.py new file mode 100644 index 0000000..b1b3872 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo4.py @@ -0,0 +1,23 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 20:08 +@Usage : +@Desc :selenium动作链 一系列动作连续执行 +''' + +from selenium import webdriver +from selenium.webdriver import ActionChains +from selenium.webdriver.common.by import By + +browser = webdriver.Chrome() +url = 'http://www.runoob.com/try/try.php?filename=jqueryui-api-droppable' +browser.get(url) +browser.switch_to.frame('iframeResult') +source = browser.find_element(By.CSS_SELECTOR, '#draggable') +target = browser.find_element(By.CSS_SELECTOR, '#droppable') +actions = ActionChains(browser) +# 模拟鼠标的点击与放下 +actions.drag_and_drop(source, target) +actions.perform() # 正式执行上述模拟操作 diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo5.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo5.py new file mode 100644 index 0000000..40e19c4 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo5.py @@ -0,0 +1,20 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 20:14 +@Usage : +@Desc :selenium运行javaScrip,有一些操作selenium没有提供API,这时可以直接通过运行javascript实现 +''' + +from selenium import webdriver +import time +browser = webdriver.Chrome() +browser.get('https://www.zhihu.com/explore') +# browser.get('https://www.taobao.com') +# 将进度条下拉到最底部 +browser.execute_script('window.scrollTo(0, document.body.scrollHeight)') +# 弹出警告提示框 +browser.execute_script('alert("To Bottom")') +time.sleep(5) +browser.close() \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo6.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo6.py new file mode 100644 index 0000000..daf1645 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo6.py @@ -0,0 +1,27 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 20:20 +@Usage : +@Desc :获取节点信息 +''' + +from selenium import webdriver +from selenium.webdriver.common.by import By + +browser = webdriver.Chrome() +url = 'https://spa2.scrape.center/' +browser.get(url) +logo = browser.find_element(By.CLASS_NAME, 'logo-image') +print(logo) +# 获取属性 +print(logo.get_attribute('src')) +# 获取文本值 +title = browser.find_element(By.CLASS_NAME, 'logo-title') +print(title.text) +# 获取ID,位置,标签名,大小 +print(title.id) +print(title.location) +print(title.tag_name) +print(title.size) \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo7.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo7.py new file mode 100644 index 0000000..32a2aad --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo7.py @@ -0,0 +1,26 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 20:31 +@Usage : 切换Frame +@Desc : 网页中有一种节点叫iframe,相当于页面的子页面, + selenium打开一个页面后,默认是在父Frame里面操作,这时需要使用switch_to.frame方法切换 +''' +import time +from selenium import webdriver +from selenium.common.exceptions import NoSuchElementException +from selenium.webdriver.common.by import By + +browser = webdriver.Chrome() +url = 'http://www.runoob.com/try/try.php?filename=jqueryui-api-droppable' +browser.get(url) +browser.switch_to.frame('iframeResult') +try: + logo = browser.find_element(By.CLASS_NAME, 'logo') +except NoSuchElementException: + print('NO LOGO') +browser.switch_to.parent_frame() +logo = browser.find_element(By.CLASS_NAME, 'logo') +print(logo) +print(logo.text) diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo8前进后退.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo8前进后退.py new file mode 100644 index 0000000..70407b7 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo8前进后退.py @@ -0,0 +1,31 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 20:38 +@Usage : 延时等待 +@Desc :get方法在网页框架加载结束后才会结束执行 + 所以在get方法执行完毕之后其结果可能并不是浏览器完全加载完成的页面 + 所以在必要时我们需要设置浏览器延时等待一段时间 +''' +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC + +browser = webdriver.Chrome() +# 隐式等待 :效果并不好,因为只规定了一个固定时间,页面加载事件会受到网络条件影响 +browser.implicitly_wait(10) +browser.get('https://spa2.scrape.center/') +input = browser.find_element(By.CLASS_NAME, 'logo-image') +print(input) + + +# 显示等待:指定要查找的节点和最长等待时间 +browser.get('https://www.taobao.com/') +wait = WebDriverWait(browser, 10) +# presence_of_element_located这个条件表示节点出现 +input = wait.until(EC.presence_of_element_located((By.ID, 'q'))) +# element_to_be_clickable表示按钮可点击 +button = wait.until(EC.element_to_be_clickable((By.CSS_SELECTOR, '.btn-search'))) +print(input, button) \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo9延时等待.py b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo9延时等待.py new file mode 100644 index 0000000..b4977b6 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/seleniumLearning/demo9延时等待.py @@ -0,0 +1,21 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/6 20:38 +@Usage : 模拟浏览器前进后退功能 +@Desc : +''' +import time +from selenium import webdriver + +browser = webdriver.Chrome() +browser.get('https://www.baidu.com/') +browser.get('https://www.taobao.com/') +browser.get('https://www.python.org/') +# 后退 +browser.back() +time.sleep(1) +# 前进 +browser.forward() +browser.close() \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/__init__.py b/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/__init__.py new file mode 100644 index 0000000..8d35434 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 20:07 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main1.py b/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main1.py new file mode 100644 index 0000000..b9ccd9c --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main1.py @@ -0,0 +1,28 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 20:07 +@Usage : +@Desc :字体反扒测试 +''' + +from selenium import webdriver +from pyquery import PyQuery as pq +from selenium.webdriver.common.by import By +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.wait import WebDriverWait + +browser = webdriver.Chrome() +browser.get('https://antispider4.scrape.center/') +WebDriverWait(browser, 10) \ + .until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, '.item'))) +html = browser.page_source +doc = pq(html) +items = doc('.item') +for item in items.items(): + name = item('.name').text() + categories = [o.text() for o in item('.categories button').items()] + score = item('.score').text() + print(f'name: {name} categories: {categories} score: {score}') +browser.close() \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main2.py b/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main2.py new file mode 100644 index 0000000..2d65e9d --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main2.py @@ -0,0 +1,20 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 20:20 +@Usage : +@Desc :尝试解析对应的css源文件,来获取对应的我们想要的 +''' + +import re +import requests +url = 'https://antispider4.scrape.center/css/app.654ba59e.css' + + +response = requests.get(url) +pattern = re.compile('.icon-(.*?):before\{content:"(.*?)"\}') +results = re.findall(pattern, response.text) +icon_map = {item[0]: item[1] for item in results} +print(icon_map['789']) +print(icon_map['437']) \ No newline at end of file diff --git a/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main3.py b/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main3.py new file mode 100644 index 0000000..e44ef49 --- /dev/null +++ b/Spider/Chapter07_动态渲染页面爬取/字体反爬案例分析与爬取实战/main3.py @@ -0,0 +1,49 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/7 20:22 +@Usage : +@Desc : +''' + +from selenium import webdriver +from pyquery import PyQuery as pq +from selenium.webdriver.common.by import By +from selenium.webdriver.support import expected_conditions as EC +from selenium.webdriver.support.wait import WebDriverWait +import re +import requests +url = 'https://antispider4.scrape.center/css/app.654ba59e.css' + + +response = requests.get(url) +pattern = re.compile('.icon-(.*?):before\{content:"(.*?)"\}') +results = re.findall(pattern, response.text) +icon_map = {item[0]: item[1] for item in results} + + +def parse_score(item): + elements = item('.icon') + icon_values = [] + for element in elements.items(): + class_name = (element.attr('class')) + icon_key = re.search('icon-(\d+)', class_name).group(1) + icon_value = icon_map.get(icon_key) + icon_values.append(icon_value) + return ''.join(icon_values) + + +browser = webdriver.Chrome() +browser.get('https://antispider4.scrape.center/') +WebDriverWait(browser, 10) \ + .until(EC.presence_of_all_elements_located((By.CSS_SELECTOR, '.item'))) +html = browser.page_source +doc = pq(html) +items = doc('.item') +for item in items.items(): + name = item('.name').text() + categories = [o.text() for o in item('.categories button').items()] + score = parse_score(item) + print(f'name: {name} categories: {categories} score: {score}') +browser.close() \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/__init__.py b/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/__init__.py new file mode 100644 index 0000000..114f0b0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/11 17:17 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo1识别测试.py b/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo1识别测试.py new file mode 100644 index 0000000..825c858 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo1识别测试.py @@ -0,0 +1,16 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/11 19:31 +@Usage : +@Desc : +''' + +import tesserocr +from PIL import Image + + +image = Image.open('image.png') +result = tesserocr.image_to_text(image) +print(result) # 打印:19 b 2 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo2处理验证码.py b/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo2处理验证码.py new file mode 100644 index 0000000..68dafc1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo2处理验证码.py @@ -0,0 +1,26 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/11 19:35 +@Usage : +@Desc : +''' +import tesserocr +from PIL import Image +import numpy as np + +image = Image.open('image.png') + +print(np.array(image).shape) +print(image.mode) + +image = image.convert('L') +threshold = 100 +array = np.array(image) + +array = np.where(array > threshold, 255, 0) +image = Image.fromarray(array.astype('uint8')) + +# image.show() +print(tesserocr.image_to_text(image)) diff --git a/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo3爬取实战.py b/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo3爬取实战.py new file mode 100644 index 0000000..3051b96 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/OCR技术识别图形验证码/demo3爬取实战.py @@ -0,0 +1,65 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/11 19:53 +@Usage : +@Desc : 尝试使用selenium和ocr技术去爬取 https://captcha7.scrape.center/ +@参考:https://github.com/Python3WebSpider/CrackImageCaptcha/blob/master/main.py +''' + +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.support.wait import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC +from selenium.common.exceptions import TimeoutException +from io import BytesIO +from PIL import Image +import numpy as np +import tesserocr +import re +from retrying import retry +import time + +browser = webdriver.Chrome() + + +# 预处理,提高图片识别率 +def preProcess(image): + image = image.convert('L') + array = np.array(image) + array = np.where(array > 50, 255, 0) + return Image.fromarray(array.astype('uint8')) + + +@retry(stop_max_attempt_number=10, retry_on_result=lambda x: x is False) +def login(): + browser.get('https://captcha7.scrape.center/') + # send_keys输入 + browser.find_element(By.CSS_SELECTOR, ".username input[type='text']").send_keys('admin') + browser.find_element(By.CSS_SELECTOR, ".password input[type='password']").send_keys('admin') + captcha = browser.find_element(By.CSS_SELECTOR, "#captcha") + image = Image.open(BytesIO(captcha.screenshot_as_png)) + print("处理前:",tesserocr.image_to_text(image)) + # 预处理提高识别率 + # image = preProcess(image) + # captcha = tesserocr.image_to_text(image) + # 模式匹配,消除空格等 + captcha=tesserocr.image_to_text(image) + print("处理后:",captcha) + captcha = re.sub(' ', '', captcha) + print("模式匹配后",captcha) + browser.find_element(By.CSS_SELECTOR, ".captcha input[type='text']").send_keys(captcha) + # 点击登录 + browser.find_element(By.CSS_SELECTOR, '.login').click() + try: + WebDriverWait(browser, 10).until(EC.presence_of_element_located((By.XPATH, '//h2[contains(.,"登录成功")]'))) + time.sleep(5) + browser.close() + return True + except TimeoutException: + return False + + +if __name__ == '__main__': + login() \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/__init__.py b/Spider/Chapter08_验证码的识别/__init__.py new file mode 100644 index 0000000..114f0b0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/11 17:17 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/opencv识别滑动验证码缺口/__init__.py b/Spider/Chapter08_验证码的识别/opencv识别滑动验证码缺口/__init__.py new file mode 100644 index 0000000..e21af44 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/opencv识别滑动验证码缺口/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/11 20:49 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/opencv识别滑动验证码缺口/demo1缺口识别.py b/Spider/Chapter08_验证码的识别/opencv识别滑动验证码缺口/demo1缺口识别.py new file mode 100644 index 0000000..67bf658 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/opencv识别滑动验证码缺口/demo1缺口识别.py @@ -0,0 +1,85 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/11 20:59 +@Usage : +@Desc : +@参考:https://github.com/Python3WebSpider/CrackSlideCaptcha/blob/cv/main.py +''' + +import cv2 + +GAUSSIAN_BLUR_KERNEL_SIZE = (5, 5) +GAUSSIAN_BLUR_SIGMA_X = 0 +CANNY_THRESHOLD1 = 200 +CANNY_THRESHOLD2 = 450 + + +# 得到高斯滤波之后的图 +def get_gaussian_blur_image(image): + return cv2.GaussianBlur(image, GAUSSIAN_BLUR_KERNEL_SIZE, GAUSSIAN_BLUR_SIGMA_X) + + +# 得到边缘检测之后的图 +def get_canny_image(image): + return cv2.Canny(image, CANNY_THRESHOLD1, CANNY_THRESHOLD2) + + +# 得到轮廓信息,会保留比较明显的边缘信息 +def get_contours(image): + contours, _ = cv2.findContours(image, cv2.RETR_CCOMP, cv2.CHAIN_APPROX_SIMPLE) + return contours + + +# 得到轮廓的上下限: +# 外接矩形的高度和宽度是通过实际测量得出来的,高约0.25,宽约0.15 +# 缺口有一个最大偏移量和最小偏移量,最小偏移量是验证码宽度的0.2倍,最大是0.85倍 + +#面积阈值 +def get_contour_area_threshold(image_width, image_height): + contour_area_min = (image_width * 0.15) * (image_height * 0.25) * 0.8 + contour_area_max = (image_width * 0.15) * (image_height * 0.25) * 1.2 + return contour_area_min, contour_area_max + +# 周长阈值 +def get_arc_length_threshold(image_width, image_height): + arc_length_min = ((image_width * 0.15) + (image_height * 0.25)) * 2 * 0.8 + arc_length_max = ((image_width * 0.15) + (image_height * 0.25)) * 2 * 1.2 + return arc_length_min, arc_length_max + +# offset阈值 +def get_offset_threshold(image_width): + offset_min = 0.2 * image_width + offset_max = 0.85 * image_width + return offset_min, offset_max + + +def main(): + # 长,宽,channel + image_raw = cv2.imread('captcha.png') + image_height, image_width, _ = image_raw.shape + image_gaussian_blur = get_gaussian_blur_image(image_raw) + # 长,宽 黑白的没有channel + image_canny = get_canny_image(image_gaussian_blur) + contours = get_contours(image_canny) + cv2.imwrite('image_canny.png', image_canny) + cv2.imwrite('image_gaussian_blur.png', image_gaussian_blur) + contour_area_min, contour_area_max = get_contour_area_threshold(image_width, image_height) + arc_length_min, arc_length_max = get_arc_length_threshold(image_width, image_height) + offset_min, offset_max = get_offset_threshold(image_width) + offset = None + for contour in contours: + # 计算外接矩形的x,y起始点位置;w,h宽和高 + x, y, w, h = cv2.boundingRect(contour) + if contour_area_min < cv2.contourArea(contour) < contour_area_max and \ + arc_length_min < cv2.arcLength(contour, True) < arc_length_max and \ + offset_min < x < offset_max: + cv2.rectangle(image_raw, (x, y), (x + w, y + h), (0, 0, 255), 2) + offset = x + cv2.imwrite('image_label.png', image_raw) + print('offset', offset) + + +if __name__ == '__main__': + main() diff --git a/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/__init__.py b/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/__init__.py new file mode 100644 index 0000000..3d0c648 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 16:49 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/chaojiying.py b/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/chaojiying.py new file mode 100644 index 0000000..374dad0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/chaojiying.py @@ -0,0 +1,53 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 16:49 +@Usage : +@Desc : 基于超级鹰官网SDK改写的 +''' +import requests +from hashlib import md5 + + +class Chaojiying(object): + + def __init__(self, username, password, soft_id): + self.username = username + self.password = md5(password.encode('utf-8')).hexdigest() + self.soft_id = soft_id + self.base_params = { + 'user': self.username, + 'pass2': self.password, + 'softid': self.soft_id, # 软件ID,需要到超级鹰后台的"软件ID"中获取 + } + self.headers = { + 'User-Agent': 'Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 5.1; Trident/4.0)', + } + + # 上传验证码并获取识别结果 + def post_pic(self, im, codetype): + """ + im: 图片字节 + codetype: 题目类型 参考 http://www.chaojiying.com/price.html + """ + params = { + 'codetype': codetype, + } + params.update(self.base_params) + files = {'userfile': ('ccc.jpg', im)} + r = requests.post('http://upload.chaojiying.net/Upload/Processing.php', data=params, files=files, + headers=self.headers) + return r.json() + + # 用于上报识别错误,识别错误时不扣题分 + def report_error(self, im_id): + """ + im_id:报错题目的图片ID + """ + params = { + 'id': im_id, + } + params.update(self.base_params) + r = requests.post('http://upload.chaojiying.net/Upload/ReportError.php', data=params, headers=self.headers) + return r.json() diff --git a/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/demo1_图形验证码.py b/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/demo1_图形验证码.py new file mode 100644 index 0000000..383fc8f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/demo1_图形验证码.py @@ -0,0 +1,19 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 16:55 +@Usage : +@Desc : +''' + +from chaojiying import Chaojiying + +USERNAME = 'Germey' +PASSWORD = '' +SOFT_ID = '915502' +CAPTCHA_KIND = '1006' +FILE_NAME = 'captcha1.png' +client = Chaojiying(USERNAME, PASSWORD, SOFT_ID) +result = client.post_pic(open(FILE_NAME, 'rb').read(), CAPTCHA_KIND) +print(result) \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/demo2_点选验证码.py b/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/demo2_点选验证码.py new file mode 100644 index 0000000..acbb37c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/使用打码平台识别验证码/demo2_点选验证码.py @@ -0,0 +1,26 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 16:57 +@Usage : +@Desc : +''' + +from chaojiying import Chaojiying + +# USERNAME = 'Germey' +# PASSWORD = '' +# SOFT_ID = '915502' +# CAPTCHA_KIND = '9004' +# FILE_NAME = 'captcha2.png' +# client = Chaojiying(USERNAME, PASSWORD, SOFT_ID) +# result = client.post_pic(open(FILE_NAME, 'rb').read(), CAPTCHA_KIND) +# print(result) + +import cv2 + +image = cv2.imread('captcha2.png') +image = cv2.circle(image, (108, 133), radius=10, color=(0, 0, 255), thickness=-1) +image = cv2.circle(image, (227, 143), radius=10, color=(0, 0, 255), thickness=-1) +cv2.imwrite('captcha2_label.png', image) \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/收集验证码自动化处理/__init__.py b/Spider/Chapter08_验证码的识别/收集验证码自动化处理/__init__.py new file mode 100644 index 0000000..7ed0a5a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/收集验证码自动化处理/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 19:42 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/收集验证码自动化处理/demo1_Flask接受手机端短信.py b/Spider/Chapter08_验证码的识别/收集验证码自动化处理/demo1_Flask接受手机端短信.py new file mode 100644 index 0000000..9ffa636 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/收集验证码自动化处理/demo1_Flask接受手机端短信.py @@ -0,0 +1,23 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 19:43 +@Usage : +@Desc : +''' + +from flask import Flask, request, jsonify + +app = Flask(__name__) + + +@app.route('/sms', methods=['POST']) +def receive(): + sms_content = request.form.get('content') + print(sms_content) + return jsonify(status='success') + + +if __name__ == '__main__': + app.run(debug=True) diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/__init__.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/__init__.py new file mode 100644 index 0000000..fc71d3c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 12:49 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/dataset.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/dataset.py new file mode 100644 index 0000000..8a7d71b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/dataset.py @@ -0,0 +1,58 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 12:53 +@Usage : +@Desc : +''' + +# -*- coding: UTF-8 -*- +import os +from torch.utils.data import DataLoader, Dataset +import torchvision.transforms as transforms +from PIL import Image +import encoding as ohe +import setting + + +class mydataset(Dataset): + + def __init__(self, folder, transform=None): + self.train_image_file_paths = [os.path.join(folder, image_file) for image_file in os.listdir(folder)] + self.transform = transform + + def __len__(self): + return len(self.train_image_file_paths) + + def __getitem__(self, idx): + image_root = self.train_image_file_paths[idx] + image_name = image_root.split(os.path.sep)[-1] + image = Image.open(image_root) + if self.transform is not None: + image = self.transform(image) + label = ohe.encode(image_name.split('_')[0]) + return image, label + + +transform = transforms.Compose([ + # transforms.ColorJitter(), + transforms.Grayscale(), + transforms.ToTensor(), + # transforms.Normalize(mean=[0.485, 0.456, 0.406], std=[0.229, 0.224, 0.225]) +]) + + +def get_train_data_loader(): + dataset = mydataset(setting.TRAIN_DATASET_PATH, transform=transform) + return DataLoader(dataset, batch_size=64, shuffle=True) + + +def get_eval_data_loader(): + dataset = mydataset(setting.EVAL_DATASET_PATH, transform=transform) + return DataLoader(dataset, batch_size=1, shuffle=True) + + +def get_predict_data_loader(): + dataset = mydataset(setting.PREDICT_DATASET_PATH, transform=transform) + return DataLoader(dataset, batch_size=1, shuffle=True) \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/encoding.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/encoding.py new file mode 100644 index 0000000..9fe7197 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/encoding.py @@ -0,0 +1,65 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 12:54 +@Usage : +@Desc : +''' + +# -*- coding: UTF-8 -*- +import numpy as np +import setting + + +def encode(text): + vector = np.zeros(setting.ALL_CHAR_SET_LEN * setting.MAX_CAPTCHA, dtype=float) + + def char2pos(c): + if c == '_': + k = 62 + return k + # ord()用来返回单个字符的ascii值(0-255)获取unicode值 + # chr()用来返回一个【0-255】数值对应的ascii符号 + # 48,65,97分别是0,A,a的ascii值 + # 等价于ord(c)-ord(0) + k = ord(c) - 48 + if k > 9: + # >9说明不是字母,+10是因为0-9位数字 + k = ord(c) - 65 + 10 + if k > 35: + # +26是因为大写字母有26位 + k = ord(c) - 97 + 26 + 10 + if k > 61: + raise ValueError('error') + return k + + for i, c in enumerate(text): + idx = i * setting.ALL_CHAR_SET_LEN + char2pos(c) + vector[idx] = 1.0 + return vector + + +def decode(vec): + char_pos = vec.nonzero()[0] + text = [] + for i, c in enumerate(char_pos): + char_at_pos = i # c/63 + char_idx = c % setting.ALL_CHAR_SET_LEN + if char_idx < 10: + char_code = char_idx + ord('0') + elif char_idx < 36: + char_code = char_idx - 10 + ord('A') + elif char_idx < 62: + char_code = char_idx - 36 + ord('a') + elif char_idx == 62: + char_code = ord('_') + else: + raise ValueError('error') + text.append(chr(char_code)) + return "".join(text) + + +if __name__ == '__main__': + e = encode("BK7H") + print(decode(e)) diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/evaluate.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/evaluate.py new file mode 100644 index 0000000..a57a5a6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/evaluate.py @@ -0,0 +1,57 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 13:41 +@Usage : +@Desc : +''' + +# -*- coding: UTF-8 -*- +import numpy as np +import torch +from torch.autograd import Variable +import setting +import dataset +from model import CNN +import encoding + + +def main(model_path): + cnn = CNN() + cnn.eval() + cnn.load_state_dict(torch.load(model_path)) + print("load cnn net.") + + eval_dataloader = dataset.get_eval_data_loader() + + correct = 0 + total = 0 + for i, (images, labels) in enumerate(eval_dataloader): + image = images + vimage = Variable(image) + predict_label = cnn(vimage) + + c0 = setting.ALL_CHAR_SET[np.argmax( + predict_label[0, 0:setting.ALL_CHAR_SET_LEN].data.numpy())] + c1 = setting.ALL_CHAR_SET[np.argmax( + predict_label[0, setting.ALL_CHAR_SET_LEN:2 * setting.ALL_CHAR_SET_LEN].data.numpy())] + c2 = setting.ALL_CHAR_SET[np.argmax( + predict_label[0, 2 * setting.ALL_CHAR_SET_LEN:3 * setting.ALL_CHAR_SET_LEN].data.numpy())] + c3 = setting.ALL_CHAR_SET[np.argmax( + predict_label[0, 3 * setting.ALL_CHAR_SET_LEN:4 * setting.ALL_CHAR_SET_LEN].data.numpy())] + predict_label = '%s%s%s%s' % (c0, c1, c2, c3) + true_label = encoding.decode(labels.numpy()[0]) + total += labels.size(0) + if (predict_label == true_label): + correct += 1 + if (total % 200 == 0): + print('Test Accuracy of the model on the %d eval images: %f %%' % + (total, 100 * correct / total)) + print('Test Accuracy of the model on the %d eval images: %f %%' % + (total, 100 * correct / total)) + return correct / total + + +if __name__ == '__main__': + main() \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/generate.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/generate.py new file mode 100644 index 0000000..04da55c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/generate.py @@ -0,0 +1,45 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 13:30 +@Usage : +@Desc : +''' + +# -*- coding: UTF-8 -*- +from captcha.image import ImageCaptcha # pip install captcha +from PIL import Image +import random +import time +import setting +import os + + +def generate_captcha_text(): + captcha_text = [] + for i in range(setting.MAX_CAPTCHA): + c = random.choice(setting.ALL_CHAR_SET) + captcha_text.append(c) + return ''.join(captcha_text) + + +def generate_captcha_text_and_image(): + image = ImageCaptcha() + captcha_text = generate_captcha_text() + captcha_image = Image.open(image.generate(captcha_text)) + return captcha_text, captcha_image + + +if __name__ == '__main__': + # 生成3000张验证集 + count = 3000 + path = setting.PREDICT_DATASET_PATH + if not os.path.exists(path): + os.makedirs(path) + for i in range(count): + now = str(int(time.time())) + text, image = generate_captcha_text_and_image() + filename = text + '_' + now + '.png' + image.save(path + os.path.sep + filename) + print('saved %d : %s' % (i + 1, filename)) \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/model.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/model.py new file mode 100644 index 0000000..663d460 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/model.py @@ -0,0 +1,55 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 13:36 +@Usage : +@Desc : +''' + +# -*- coding: UTF-8 -*- +import torch.nn as nn +import setting + + +# CNN Model (2 conv layer) +class CNN(nn.Module): + def __init__(self): + super(CNN, self).__init__() + self.layer1 = nn.Sequential( + nn.Conv2d(1, 32, kernel_size=3, padding=1), + nn.BatchNorm2d(32), + nn.Dropout(0.5), # drop 50% of the neuron + nn.ReLU(), + nn.MaxPool2d(2)) + self.layer2 = nn.Sequential( + nn.Conv2d(32, 64, kernel_size=3, padding=1), + nn.BatchNorm2d(64), + nn.Dropout(0.5), # drop 50% of the neuron + nn.ReLU(), + nn.MaxPool2d(2)) + self.layer3 = nn.Sequential( + nn.Conv2d(64, 64, kernel_size=3, padding=1), + nn.BatchNorm2d(64), + nn.Dropout(0.5), # drop 50% of the neuron + nn.ReLU(), + nn.MaxPool2d(2)) + self.fc = nn.Sequential( + # 除以8是因为MaxPool2d了3次 + nn.Linear((setting.IMAGE_WIDTH // 8) * (setting.IMAGE_HEIGHT // 8) * 64, 1024), + nn.Dropout(0.5), # drop 50% of the neuron + nn.ReLU()) + self.rfc = nn.Sequential( + # setting.MAX_CAPTCHA * setting.ALL_CHAR_SET_LEN是字典集的长度 + nn.Linear(1024, setting.MAX_CAPTCHA * setting.ALL_CHAR_SET_LEN), + ) + + def forward(self, x): + out = self.layer1(x) + out = self.layer2(out) + out = self.layer3(out) + # flatten展平 + out = out.view(out.size(0), -1) + out = self.fc(out) + out = self.rfc(out) + return out \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/predict.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/predict.py new file mode 100644 index 0000000..7ed4e95 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/predict.py @@ -0,0 +1,53 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 15:03 +@Usage : +@Desc : +''' + +# -*- coding: UTF-8 -*- +import numpy as np +import torch +from torch.autograd import Variable +# from visdom import Visdom # pip install Visdom +import setting +import dataset +from model import CNN +import encoding as encode + + +def main(): + cnn = CNN() + cnn.eval() + cnn.load_state_dict(torch.load('./output/best_model.pkl', map_location=torch.device('cpu'))) + print("load cnn net.") + + predict_dataloader = dataset.get_predict_data_loader() + + # vis = Visdom() + correct = 0 + for i, (images, labels) in enumerate(predict_dataloader): + image = images + vimage = Variable(image) + predict_label = cnn(vimage) + actual_label = encode.decode(labels[0].numpy()) + + c0 = setting.ALL_CHAR_SET[np.argmax(predict_label[0, 0:setting.ALL_CHAR_SET_LEN].data.numpy())] + c1 = setting.ALL_CHAR_SET[np.argmax( + predict_label[0, setting.ALL_CHAR_SET_LEN:2 * setting.ALL_CHAR_SET_LEN].data.numpy())] + c2 = setting.ALL_CHAR_SET[np.argmax( + predict_label[0, 2 * setting.ALL_CHAR_SET_LEN:3 * setting.ALL_CHAR_SET_LEN].data.numpy())] + c3 = setting.ALL_CHAR_SET[np.argmax( + predict_label[0, 3 * setting.ALL_CHAR_SET_LEN:4 * setting.ALL_CHAR_SET_LEN].data.numpy())] + correct += 1 if "".join([c0, c1, c2, c3]) == actual_label else 0 + c = '%s%s%s%s' % (c0, c1, c2, c3) + print(f"predict:{c},actual:{actual_label}") + # vis.images(image, opts=dict(caption=c)) + print(f"total:{len(predict_dataloader)},correct:{correct}") + # 经过测试,最终正确率约74%,total:3000,correct:2233 + + +if __name__ == '__main__': + main() diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/setting.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/setting.py new file mode 100644 index 0000000..069ed3d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/setting.py @@ -0,0 +1,29 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 12:54 +@Usage : +@Desc : +''' + +# -*- coding: UTF-8 -*- +import os + +# 验证码中的字符 +# string.digits + string.ascii_uppercase +NUMBER = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] +ALPHABET = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', + 'V', 'W', 'X', 'Y', 'Z'] + +ALL_CHAR_SET = NUMBER + ALPHABET +ALL_CHAR_SET_LEN = len(ALL_CHAR_SET) +MAX_CAPTCHA = 4 + +# 图像大小 +IMAGE_HEIGHT = 60 +IMAGE_WIDTH = 160 + +TRAIN_DATASET_PATH = 'dataset' + os.path.sep + 'train' +EVAL_DATASET_PATH = 'dataset' + os.path.sep + 'eval' +PREDICT_DATASET_PATH = 'dataset' + os.path.sep + 'predict' \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/train.py b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/train.py new file mode 100644 index 0000000..9e7ea43 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别图形验证码/train.py @@ -0,0 +1,66 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 13:40 +@Usage : +@Desc : +''' + +# -*- coding: UTF-8 -*- +import torch +import torch.nn as nn +from torch.autograd import Variable +import dataset +from model import CNN +from evaluate import main as evaluate +import os +import os.path + +num_epochs = 30 +batch_size = 100 +learning_rate = 0.001 + +output = './output' +os.path.exists(output) or os.makedirs(output) + + +def main(): + cnn = CNN() + cnn.train() + + criterion = nn.MultiLabelSoftMarginLoss() + optimizer = torch.optim.Adam(cnn.parameters(), lr=learning_rate) + max_eval_acc = -1 + + train_dataloader = dataset.get_train_data_loader() + for epoch in range(num_epochs): + model_path = os.path.join(output, "model.pkl") + for i, (images, labels) in enumerate(train_dataloader): + # 在这里变成可以torch梯度autograd的变量 + images = Variable(images) + labels = Variable(labels.float()) + predict_labels = cnn(images) + loss = criterion(predict_labels, labels) + optimizer.zero_grad() + loss.backward() + optimizer.step() + if (i + 1) % 10 == 0: + print("epoch:", epoch, "step:", i, "loss:", loss.item()) + + + + print("epoch:", epoch, "step:", i, "loss:", loss.item()) + torch.save(cnn.state_dict(), model_path) + print("save model") + eval_acc = evaluate(model_path) + if eval_acc > max_eval_acc: + # best model save as best_model.pkl + torch.save(cnn.state_dict(), os.path.join(output, "best_model.pkl")) + print("save best model") + torch.save(cnn.state_dict(), os.path.join(output, "model.pkl")) + print("save last model") + + +if __name__ == '__main__': + main() diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/.gitignore b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/.gitignore new file mode 100644 index 0000000..994778d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/.gitignore @@ -0,0 +1,19 @@ +#checkpoints/ +.DS_Store +build +.git +*.egg-info +dist +output +data/coco +backup +weights/*.weights +weights/* +__pycache__ + +/.idea + +/logs +data/captcha/images/*.xml + +.vscode/ \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/LICENSE b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/LICENSE new file mode 100644 index 0000000..92b370f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/LICENSE @@ -0,0 +1,674 @@ +GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/README.md b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/README.md new file mode 100644 index 0000000..8746e63 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/README.md @@ -0,0 +1,124 @@ +# 滑动验证码深度学习识别 + +本项目使用深度学习 YOLOV3 模型来识别滑动验证码缺口,基于 [https://github.com/eriklindernoren/PyTorch-YOLOv3](https://github.com/eriklindernoren/PyTorch-YOLOv3) 修改。 + +只需要几百张缺口标注图片即可训练出精度高的识别模型,识别效果样例: + +![](data/captcha/result/captcha_435.png) +## 克隆项目 + +运行命令: + +``` +git clone https://github.com/Python3WebSpider/DeepLearningSlideCaptcha2.git +``` + +## 数据准备 + +使用 LabelImg 工具标注自行标注一批数据,大约 200 张以上即可训练出不错的效果。 + +LabelImg:[https://github.com/tzutalin/labelImg](https://github.com/tzutalin/labelImg) + +标注要求: + +* 圈出验证码目标滑块区域的完整完整矩形,无需标注源滑块。 +* 目标矩形命名为 target 这个类别。 +* 建议使用 LabelImg 的快捷键提高标注效率。 + +## 环境准备 + +建议在 GPU 环境和虚拟 Python 环境下执行如下命令: + +``` +pip3 install -r requirements.txt +``` + +## 预训练模型下载 + +YOLOV3 的训练要加载预训练模型才能有不错的训练效果,预训练模型下载: + +``` +bash prepare.sh +``` + +下载完成之后会在 weights 文件夹下出现模型权重文件,供训练使用。 + +## 训练 + +本项目已经提供了标注好的数据集,在 data/captcha,可以直接使用。 + +如果要训练自己的数据,数据格式准备见:[https://github.com/eriklindernoren/PyTorch-YOLOv3#train-on-custom-dataset](https://github.com/eriklindernoren/PyTorch-YOLOv3#train-on-custom-dataset)。 + +当前数据训练脚本: + +``` +bash train.sh +``` + +实测 P100 训练时长约 15 秒一个 epoch,大约几分钟即可训练出较好效果。 + +## 测试 + +训练完毕之后会在 checkpoints 文件夹生成 pth 文件,可直接使用模型来预测生成标注结果。 + +此时 checkpoints 文件夹会生成训练好的 pth 文件。 + +当前数据测试脚本: + +``` +sh detect.sh +``` + +该脚本会读取 captcha 下的 test 文件夹所有图片,并将处理后的结果输出到 test 文件夹。 + +运行结果样例: + +``` +Performing object detection: + + Batch 0, Inference Time: 0:00:00.044223 + + Batch 1, Inference Time: 0:00:00.028566 + + Batch 2, Inference Time: 0:00:00.029764 + + Batch 3, Inference Time: 0:00:00.032430 + + Batch 4, Inference Time: 0:00:00.033373 + + Batch 5, Inference Time: 0:00:00.027861 + + Batch 6, Inference Time: 0:00:00.031444 + + Batch 7, Inference Time: 0:00:00.032110 + + Batch 8, Inference Time: 0:00:00.029131 + +Saving images: +(0) Image: 'data/captcha/test/captcha_4497.png' + + Label: target, Conf: 0.99999 +(1) Image: 'data/captcha/test/captcha_4498.png' + + Label: target, Conf: 0.99999 +(2) Image: 'data/captcha/test/captcha_4499.png' + + Label: target, Conf: 0.99997 +(3) Image: 'data/captcha/test/captcha_4500.png' + + Label: target, Conf: 0.99999 +(4) Image: 'data/captcha/test/captcha_4501.png' + + Label: target, Conf: 0.99997 +(5) Image: 'data/captcha/test/captcha_4502.png' + + Label: target, Conf: 0.99999 +(6) Image: 'data/captcha/test/captcha_4503.png' + + Label: target, Conf: 0.99997 +(7) Image: 'data/captcha/test/captcha_4504.png' + + Label: target, Conf: 0.99998 +(8) Image: 'data/captcha/test/captcha_4505.png' + + Label: target, Conf: 0.99998 +``` + +样例结果: + +![](data/captcha/result/captcha_288.png) + +![](data/captcha/result/captcha_435.png) + +![](data/captcha/result/captcha_354.png) + +## 协议 + +本项目基于开源 [GNU 协议](https://github.com/eriklindernoren/PyTorch-YOLOv3/blob/master/LICENSE) +,另外本项目不提供任何有关滑动轨迹相关模拟和 JavaScript 逆向分析方案。 + +本项目仅供学习交流使用,请勿用于非法用途,本人不承担任何法律责任。 + +如有侵权请联系个人删除,谢谢。 diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/__init__.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/__init__.py new file mode 100644 index 0000000..66b3e2d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/12 15:31 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/checkpoints/.gitignore b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/checkpoints/.gitignore new file mode 100644 index 0000000..c96a04f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/checkpoints/.gitignore @@ -0,0 +1,2 @@ +* +!.gitignore \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/collect.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/collect.py new file mode 100644 index 0000000..12c09f9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/collect.py @@ -0,0 +1,26 @@ +from selenium import webdriver +from selenium.webdriver.common.by import By +from selenium.webdriver.support.ui import WebDriverWait +from selenium.webdriver.support import expected_conditions as EC +from selenium.common.exceptions import WebDriverException +import time +import logging as logger + +COUNT = 1000 + +for i in range(0, COUNT + 1): + try: + browser = webdriver.Chrome() + wait = WebDriverWait(browser, 10) + browser.get('https://captcha1.scrape.center/') + button = wait.until(EC.element_to_be_clickable( + (By.CSS_SELECTOR, '.el-button'))) + button.click() + captcha = wait.until( + EC.presence_of_element_located((By.CSS_SELECTOR, '.geetest_slicebg.geetest_absolute'))) + time.sleep(5) + captcha.screenshot(f'data/captcha/images/captcha_{i}.png') + except WebDriverException as e: + logger.error(f'webdriver error occurred {e.msg}') + finally: + browser.close() diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/config/captcha.data b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/config/captcha.data new file mode 100644 index 0000000..738c60d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/config/captcha.data @@ -0,0 +1,4 @@ +classes= 1 +train=data/captcha/train.txt +valid=data/captcha/valid.txt +names=data/captcha/classes.names diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/config/yolov3-captcha.cfg b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/config/yolov3-captcha.cfg new file mode 100644 index 0000000..b114af1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/config/yolov3-captcha.cfg @@ -0,0 +1,790 @@ + +[net] +# Testing +#batch=1 +#subdivisions=1 +# Training +batch=16 +subdivisions=1 +width=416 +height=416 +channels=3 +momentum=0.9 +decay=0.0005 +angle=0 +saturation = 1.5 +exposure = 1.5 +hue=.1 + +learning_rate=0.001 +burn_in=1000 +max_batches = 500200 +policy=steps +steps=400000,450000 +scales=.1,.1 + +[convolutional] +batch_normalize=1 +filters=32 +size=3 +stride=1 +pad=1 +activation=leaky + +# Downsample + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=2 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=32 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=64 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +# Downsample + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=2 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=64 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +# Downsample + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=2 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +# Downsample + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=2 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +# Downsample + +[convolutional] +batch_normalize=1 +filters=1024 +size=3 +stride=2 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=1024 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=1024 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=1024 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=1024 +size=3 +stride=1 +pad=1 +activation=leaky + +[shortcut] +from=-3 +activation=linear + +###################### + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=1024 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=1024 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=512 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=1024 +activation=leaky + +[convolutional] +size=1 +stride=1 +pad=1 +filters=18 +activation=linear + + +[yolo] +mask = 6,7,8 +anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 +classes=1 +num=9 +jitter=.3 +ignore_thresh = .7 +truth_thresh = 1 +random=1 + + +[route] +layers = -4 + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[upsample] +stride=2 + +[route] +layers = -1, 61 + + + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=512 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=512 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=256 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=512 +activation=leaky + +[convolutional] +size=1 +stride=1 +pad=1 +filters=18 +activation=linear + + +[yolo] +mask = 3,4,5 +anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 +classes=1 +num=9 +jitter=.3 +ignore_thresh = .7 +truth_thresh = 1 +random=1 + + + +[route] +layers = -4 + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[upsample] +stride=2 + +[route] +layers = -1, 36 + + + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=256 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=256 +activation=leaky + +[convolutional] +batch_normalize=1 +filters=128 +size=1 +stride=1 +pad=1 +activation=leaky + +[convolutional] +batch_normalize=1 +size=3 +stride=1 +pad=1 +filters=256 +activation=leaky + +[convolutional] +size=1 +stride=1 +pad=1 +filters=18 +activation=linear + + +[yolo] +mask = 0,1,2 +anchors = 10,13, 16,30, 33,23, 30,61, 62,45, 59,119, 116,90, 156,198, 373,326 +classes=1 +num=9 +jitter=.3 +ignore_thresh = .7 +truth_thresh = 1 +random=1 + diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/classes.names b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/classes.names new file mode 100644 index 0000000..eb5a316 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/classes.names @@ -0,0 +1 @@ +target diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_0.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_0.png new file mode 100644 index 0000000..8c8dcd3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_0.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_1.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_1.png new file mode 100644 index 0000000..63718d7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_1.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_10.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_10.png new file mode 100644 index 0000000..e9f4672 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_10.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_100.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_100.png new file mode 100644 index 0000000..bb216ad Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_100.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_1000.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_1000.png new file mode 100644 index 0000000..1683ce7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_1000.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_101.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_101.png new file mode 100644 index 0000000..005a831 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_101.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_102.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_102.png new file mode 100644 index 0000000..8dd86a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_102.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_103.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_103.png new file mode 100644 index 0000000..efbe795 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_103.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_104.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_104.png new file mode 100644 index 0000000..dde90a1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_104.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_105.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_105.png new file mode 100644 index 0000000..7fc74f8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_105.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_106.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_106.png new file mode 100644 index 0000000..78d57fb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_106.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_107.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_107.png new file mode 100644 index 0000000..4a5102c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_107.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_108.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_108.png new file mode 100644 index 0000000..d6266cb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_108.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_109.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_109.png new file mode 100644 index 0000000..90b25cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_109.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_11.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_11.png new file mode 100644 index 0000000..6e4b9ed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_11.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_110.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_110.png new file mode 100644 index 0000000..b066399 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_110.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_111.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_111.png new file mode 100644 index 0000000..77a3849 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_111.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_112.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_112.png new file mode 100644 index 0000000..78167fb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_112.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_113.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_113.png new file mode 100644 index 0000000..c29b5af Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_113.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_114.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_114.png new file mode 100644 index 0000000..8241cfb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_114.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_115.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_115.png new file mode 100644 index 0000000..a492c7c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_115.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_116.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_116.png new file mode 100644 index 0000000..04dbd40 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_116.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_117.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_117.png new file mode 100644 index 0000000..8939762 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_117.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_118.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_118.png new file mode 100644 index 0000000..b2dce44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_118.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_119.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_119.png new file mode 100644 index 0000000..00429e1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_119.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_12.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_12.png new file mode 100644 index 0000000..55c198b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_12.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_120.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_120.png new file mode 100644 index 0000000..a091ae9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_120.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_121.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_121.png new file mode 100644 index 0000000..b477e01 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_121.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_122.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_122.png new file mode 100644 index 0000000..b870f79 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_122.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_123.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_123.png new file mode 100644 index 0000000..1bc07f7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_123.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_124.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_124.png new file mode 100644 index 0000000..6933fca Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_124.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_125.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_125.png new file mode 100644 index 0000000..7f0eb8f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_125.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_126.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_126.png new file mode 100644 index 0000000..720d376 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_126.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_127.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_127.png new file mode 100644 index 0000000..f118db5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_127.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_128.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_128.png new file mode 100644 index 0000000..12eefd6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_128.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_129.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_129.png new file mode 100644 index 0000000..53143d5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_129.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_13.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_13.png new file mode 100644 index 0000000..d4e7e09 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_13.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_130.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_130.png new file mode 100644 index 0000000..e4e757f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_130.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_131.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_131.png new file mode 100644 index 0000000..a6d0b7b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_131.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_132.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_132.png new file mode 100644 index 0000000..f836299 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_132.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_133.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_133.png new file mode 100644 index 0000000..851cc6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_133.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_134.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_134.png new file mode 100644 index 0000000..772321d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_134.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_135.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_135.png new file mode 100644 index 0000000..fd5f9ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_135.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_136.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_136.png new file mode 100644 index 0000000..447c455 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_136.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_137.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_137.png new file mode 100644 index 0000000..69938e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_137.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_138.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_138.png new file mode 100644 index 0000000..9858214 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_138.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_139.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_139.png new file mode 100644 index 0000000..82f781e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_139.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_14.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_14.png new file mode 100644 index 0000000..fddd57d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_14.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_140.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_140.png new file mode 100644 index 0000000..b01ed26 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_140.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_141.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_141.png new file mode 100644 index 0000000..329fdd2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_141.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_142.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_142.png new file mode 100644 index 0000000..bd8f8a0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_142.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_143.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_143.png new file mode 100644 index 0000000..01a5dd2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_143.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_144.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_144.png new file mode 100644 index 0000000..e95123b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_144.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_145.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_145.png new file mode 100644 index 0000000..1d2ea3a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_145.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_146.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_146.png new file mode 100644 index 0000000..79f9933 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_146.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_147.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_147.png new file mode 100644 index 0000000..b8cdad3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_147.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_148.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_148.png new file mode 100644 index 0000000..e9c6196 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_148.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_149.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_149.png new file mode 100644 index 0000000..49e7e49 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_149.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_15.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_15.png new file mode 100644 index 0000000..15d38d6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_15.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_150.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_150.png new file mode 100644 index 0000000..c26f554 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_150.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_151.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_151.png new file mode 100644 index 0000000..b4c9907 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_151.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_152.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_152.png new file mode 100644 index 0000000..ca2ec08 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_152.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_153.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_153.png new file mode 100644 index 0000000..0cc9233 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_153.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_154.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_154.png new file mode 100644 index 0000000..7d80659 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_154.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_155.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_155.png new file mode 100644 index 0000000..e9282bf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_155.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_156.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_156.png new file mode 100644 index 0000000..317b998 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_156.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_157.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_157.png new file mode 100644 index 0000000..51b8d94 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_157.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_158.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_158.png new file mode 100644 index 0000000..e4b54c0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_158.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_159.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_159.png new file mode 100644 index 0000000..dd62cb4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_159.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_16.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_16.png new file mode 100644 index 0000000..390ba94 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_16.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_160.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_160.png new file mode 100644 index 0000000..cb993ae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_160.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_161.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_161.png new file mode 100644 index 0000000..ec1994c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_161.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_162.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_162.png new file mode 100644 index 0000000..c822a15 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_162.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_163.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_163.png new file mode 100644 index 0000000..0f39a7e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_163.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_164.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_164.png new file mode 100644 index 0000000..80e24e1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_164.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_165.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_165.png new file mode 100644 index 0000000..917f379 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_165.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_166.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_166.png new file mode 100644 index 0000000..bb84a3a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_166.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_167.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_167.png new file mode 100644 index 0000000..706b497 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_167.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_168.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_168.png new file mode 100644 index 0000000..ad1c6a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_168.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_169.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_169.png new file mode 100644 index 0000000..82a3cb7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_169.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_17.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_17.png new file mode 100644 index 0000000..87e4ecf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_17.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_170.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_170.png new file mode 100644 index 0000000..613b27c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_170.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_171.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_171.png new file mode 100644 index 0000000..4686471 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_171.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_172.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_172.png new file mode 100644 index 0000000..53c6f91 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_172.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_173.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_173.png new file mode 100644 index 0000000..d07399d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_173.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_174.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_174.png new file mode 100644 index 0000000..6ff09e8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_174.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_175.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_175.png new file mode 100644 index 0000000..b2c7da7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_175.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_176.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_176.png new file mode 100644 index 0000000..cdd9db1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_176.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_177.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_177.png new file mode 100644 index 0000000..095ed38 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_177.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_178.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_178.png new file mode 100644 index 0000000..76806f7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_178.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_179.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_179.png new file mode 100644 index 0000000..fca37ee Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_179.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_18.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_18.png new file mode 100644 index 0000000..514edaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_18.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_180.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_180.png new file mode 100644 index 0000000..162fb29 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_180.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_181.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_181.png new file mode 100644 index 0000000..097f58a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_181.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_182.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_182.png new file mode 100644 index 0000000..8e9463b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_182.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_183.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_183.png new file mode 100644 index 0000000..3ca7f60 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_183.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_184.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_184.png new file mode 100644 index 0000000..d96aa7d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_184.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_185.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_185.png new file mode 100644 index 0000000..a0c1a1e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_185.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_186.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_186.png new file mode 100644 index 0000000..e44083d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_186.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_187.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_187.png new file mode 100644 index 0000000..be3f2ba Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_187.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_188.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_188.png new file mode 100644 index 0000000..13d80e8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_188.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_189.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_189.png new file mode 100644 index 0000000..8638f76 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_189.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_19.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_19.png new file mode 100644 index 0000000..a56d900 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_19.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_190.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_190.png new file mode 100644 index 0000000..45fb970 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_190.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_191.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_191.png new file mode 100644 index 0000000..175c721 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_191.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_192.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_192.png new file mode 100644 index 0000000..7ca2dd0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_192.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_193.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_193.png new file mode 100644 index 0000000..62602eb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_193.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_194.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_194.png new file mode 100644 index 0000000..3447cf7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_194.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_195.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_195.png new file mode 100644 index 0000000..849d4e1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_195.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_196.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_196.png new file mode 100644 index 0000000..2c86e66 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_196.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_197.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_197.png new file mode 100644 index 0000000..eab092e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_197.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_198.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_198.png new file mode 100644 index 0000000..ea3c601 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_198.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_199.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_199.png new file mode 100644 index 0000000..0fd8d28 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_199.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_2.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_2.png new file mode 100644 index 0000000..cdde274 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_2.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_20.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_20.png new file mode 100644 index 0000000..714dd47 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_20.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_200.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_200.png new file mode 100644 index 0000000..b094e7d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_200.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_201.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_201.png new file mode 100644 index 0000000..60c0660 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_201.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_202.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_202.png new file mode 100644 index 0000000..2db9cda Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_202.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_203.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_203.png new file mode 100644 index 0000000..388ca94 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_203.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_204.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_204.png new file mode 100644 index 0000000..0ad0d2a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_204.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_205.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_205.png new file mode 100644 index 0000000..0800a77 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_205.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_206.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_206.png new file mode 100644 index 0000000..5b37b4f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_206.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_207.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_207.png new file mode 100644 index 0000000..5b8e996 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_207.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_208.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_208.png new file mode 100644 index 0000000..745ff14 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_208.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_209.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_209.png new file mode 100644 index 0000000..709ae63 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_209.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_21.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_21.png new file mode 100644 index 0000000..4f71111 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_21.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_210.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_210.png new file mode 100644 index 0000000..761da54 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_210.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_211.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_211.png new file mode 100644 index 0000000..0e7ca89 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_211.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_212.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_212.png new file mode 100644 index 0000000..b76005d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_212.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_213.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_213.png new file mode 100644 index 0000000..25fd6ff Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_213.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_214.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_214.png new file mode 100644 index 0000000..b392767 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_214.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_215.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_215.png new file mode 100644 index 0000000..ee1209b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_215.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_216.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_216.png new file mode 100644 index 0000000..af35f44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_216.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_217.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_217.png new file mode 100644 index 0000000..b7f4e9e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_217.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_218.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_218.png new file mode 100644 index 0000000..1fbfb65 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_218.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_219.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_219.png new file mode 100644 index 0000000..a72688a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_219.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_22.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_22.png new file mode 100644 index 0000000..62bfcac Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_22.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_220.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_220.png new file mode 100644 index 0000000..da10d48 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_220.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_221.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_221.png new file mode 100644 index 0000000..c25486f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_221.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_222.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_222.png new file mode 100644 index 0000000..37d0be9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_222.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_223.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_223.png new file mode 100644 index 0000000..52742f0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_223.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_224.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_224.png new file mode 100644 index 0000000..c663473 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_224.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_225.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_225.png new file mode 100644 index 0000000..acb8416 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_225.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_226.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_226.png new file mode 100644 index 0000000..eb01551 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_226.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_227.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_227.png new file mode 100644 index 0000000..8b9bcaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_227.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_228.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_228.png new file mode 100644 index 0000000..6e08407 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_228.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_229.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_229.png new file mode 100644 index 0000000..3f2e10e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_229.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_23.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_23.png new file mode 100644 index 0000000..8ca1088 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_23.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_230.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_230.png new file mode 100644 index 0000000..f0bbdac Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_230.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_231.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_231.png new file mode 100644 index 0000000..fdaeb33 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_231.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_232.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_232.png new file mode 100644 index 0000000..7f0df40 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_232.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_233.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_233.png new file mode 100644 index 0000000..63912fe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_233.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_234.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_234.png new file mode 100644 index 0000000..422b2e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_234.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_235.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_235.png new file mode 100644 index 0000000..bea5966 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_235.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_236.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_236.png new file mode 100644 index 0000000..115e40a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_236.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_237.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_237.png new file mode 100644 index 0000000..df30435 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_237.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_238.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_238.png new file mode 100644 index 0000000..5ddf576 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_238.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_239.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_239.png new file mode 100644 index 0000000..2f6bec3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_239.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_24.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_24.png new file mode 100644 index 0000000..cc8a2b3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_24.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_240.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_240.png new file mode 100644 index 0000000..b61b120 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_240.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_241.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_241.png new file mode 100644 index 0000000..2708a71 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_241.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_242.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_242.png new file mode 100644 index 0000000..58237ab Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_242.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_243.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_243.png new file mode 100644 index 0000000..e92bfa3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_243.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_244.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_244.png new file mode 100644 index 0000000..32f5010 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_244.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_245.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_245.png new file mode 100644 index 0000000..5989025 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_245.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_246.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_246.png new file mode 100644 index 0000000..55003e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_246.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_247.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_247.png new file mode 100644 index 0000000..90a8880 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_247.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_248.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_248.png new file mode 100644 index 0000000..32f2447 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_248.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_249.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_249.png new file mode 100644 index 0000000..67eb314 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_249.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_25.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_25.png new file mode 100644 index 0000000..271b816 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_25.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_250.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_250.png new file mode 100644 index 0000000..a216d29 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_250.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_251.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_251.png new file mode 100644 index 0000000..1f50ff1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_251.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_252.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_252.png new file mode 100644 index 0000000..cbda673 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_252.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_253.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_253.png new file mode 100644 index 0000000..b477457 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_253.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_254.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_254.png new file mode 100644 index 0000000..24265a1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_254.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_255.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_255.png new file mode 100644 index 0000000..3fd75be Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_255.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_256.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_256.png new file mode 100644 index 0000000..a23f440 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_256.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_257.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_257.png new file mode 100644 index 0000000..c3ab7db Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_257.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_258.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_258.png new file mode 100644 index 0000000..92290ae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_258.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_259.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_259.png new file mode 100644 index 0000000..20d8ba4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_259.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_26.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_26.png new file mode 100644 index 0000000..0f105e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_26.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_260.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_260.png new file mode 100644 index 0000000..fcc8f98 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_260.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_261.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_261.png new file mode 100644 index 0000000..7c4fb2c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_261.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_262.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_262.png new file mode 100644 index 0000000..22d40d6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_262.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_263.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_263.png new file mode 100644 index 0000000..8f541f2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_263.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_264.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_264.png new file mode 100644 index 0000000..d6b9b6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_264.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_265.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_265.png new file mode 100644 index 0000000..59a182b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_265.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_266.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_266.png new file mode 100644 index 0000000..0561f35 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_266.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_267.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_267.png new file mode 100644 index 0000000..560fde4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_267.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_268.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_268.png new file mode 100644 index 0000000..64e4625 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_268.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_269.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_269.png new file mode 100644 index 0000000..5564b8c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_269.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_27.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_27.png new file mode 100644 index 0000000..4e5699e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_27.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_270.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_270.png new file mode 100644 index 0000000..bc162a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_270.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_271.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_271.png new file mode 100644 index 0000000..b7a1173 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_271.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_272.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_272.png new file mode 100644 index 0000000..10c3fae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_272.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_273.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_273.png new file mode 100644 index 0000000..240fc12 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_273.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_274.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_274.png new file mode 100644 index 0000000..a14eb9b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_274.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_275.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_275.png new file mode 100644 index 0000000..f19c35c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_275.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_276.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_276.png new file mode 100644 index 0000000..1608246 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_276.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_277.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_277.png new file mode 100644 index 0000000..f9ba2ff Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_277.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_278.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_278.png new file mode 100644 index 0000000..635f080 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_278.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_279.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_279.png new file mode 100644 index 0000000..06300ba Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_279.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_28.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_28.png new file mode 100644 index 0000000..528edb5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_28.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_280.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_280.png new file mode 100644 index 0000000..d8d4eba Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_280.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_281.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_281.png new file mode 100644 index 0000000..8c4c30d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_281.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_282.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_282.png new file mode 100644 index 0000000..b81a83d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_282.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_283.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_283.png new file mode 100644 index 0000000..c8172b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_283.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_284.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_284.png new file mode 100644 index 0000000..0a52ace Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_284.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_285.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_285.png new file mode 100644 index 0000000..5c703a5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_285.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_286.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_286.png new file mode 100644 index 0000000..d8cfc6a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_286.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_287.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_287.png new file mode 100644 index 0000000..1d2ce9f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_287.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_288.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_288.png new file mode 100644 index 0000000..e5096c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_288.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_289.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_289.png new file mode 100644 index 0000000..d00db0a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_289.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_29.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_29.png new file mode 100644 index 0000000..fd1be6e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_29.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_290.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_290.png new file mode 100644 index 0000000..01ab05e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_290.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_291.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_291.png new file mode 100644 index 0000000..fadffc9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_291.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_292.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_292.png new file mode 100644 index 0000000..573f798 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_292.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_293.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_293.png new file mode 100644 index 0000000..b0d8da8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_293.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_294.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_294.png new file mode 100644 index 0000000..8fa40ed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_294.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_295.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_295.png new file mode 100644 index 0000000..cbc19ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_295.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_296.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_296.png new file mode 100644 index 0000000..e11e20f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_296.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_297.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_297.png new file mode 100644 index 0000000..c632a86 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_297.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_298.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_298.png new file mode 100644 index 0000000..8b28329 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_298.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_299.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_299.png new file mode 100644 index 0000000..b30ba5a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_299.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_3.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_3.png new file mode 100644 index 0000000..f76fa51 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_3.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_30.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_30.png new file mode 100644 index 0000000..29265d1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_30.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_300.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_300.png new file mode 100644 index 0000000..f23049e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_300.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_301.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_301.png new file mode 100644 index 0000000..def18aa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_301.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_302.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_302.png new file mode 100644 index 0000000..39bcdd9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_302.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_303.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_303.png new file mode 100644 index 0000000..911f1ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_303.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_304.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_304.png new file mode 100644 index 0000000..7e447ec Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_304.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_305.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_305.png new file mode 100644 index 0000000..6589a2c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_305.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_306.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_306.png new file mode 100644 index 0000000..af284c8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_306.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_307.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_307.png new file mode 100644 index 0000000..afe273c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_307.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_308.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_308.png new file mode 100644 index 0000000..a1bc95a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_308.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_309.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_309.png new file mode 100644 index 0000000..ec66ea3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_309.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_31.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_31.png new file mode 100644 index 0000000..7b5d91e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_31.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_310.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_310.png new file mode 100644 index 0000000..e7aef5d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_310.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_311.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_311.png new file mode 100644 index 0000000..db2b454 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_311.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_312.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_312.png new file mode 100644 index 0000000..d877e8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_312.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_313.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_313.png new file mode 100644 index 0000000..cf05e40 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_313.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_314.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_314.png new file mode 100644 index 0000000..98d7666 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_314.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_315.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_315.png new file mode 100644 index 0000000..c958c52 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_315.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_316.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_316.png new file mode 100644 index 0000000..edc6c2e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_316.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_317.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_317.png new file mode 100644 index 0000000..f7b70aa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_317.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_318.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_318.png new file mode 100644 index 0000000..cbdd561 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_318.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_319.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_319.png new file mode 100644 index 0000000..347f482 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_319.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_32.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_32.png new file mode 100644 index 0000000..a9ce79e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_32.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_320.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_320.png new file mode 100644 index 0000000..b411b5e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_320.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_321.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_321.png new file mode 100644 index 0000000..6cdf157 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_321.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_322.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_322.png new file mode 100644 index 0000000..e0f2e03 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_322.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_323.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_323.png new file mode 100644 index 0000000..6565022 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_323.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_324.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_324.png new file mode 100644 index 0000000..202f6d0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_324.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_325.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_325.png new file mode 100644 index 0000000..3f56f1a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_325.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_326.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_326.png new file mode 100644 index 0000000..491be3c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_326.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_327.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_327.png new file mode 100644 index 0000000..a59b910 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_327.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_328.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_328.png new file mode 100644 index 0000000..9e2f972 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_328.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_329.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_329.png new file mode 100644 index 0000000..b9b101f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_329.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_33.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_33.png new file mode 100644 index 0000000..9f3de21 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_33.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_330.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_330.png new file mode 100644 index 0000000..725ef87 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_330.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_331.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_331.png new file mode 100644 index 0000000..ad4602a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_331.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_332.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_332.png new file mode 100644 index 0000000..07a5def Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_332.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_333.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_333.png new file mode 100644 index 0000000..863e8b0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_333.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_334.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_334.png new file mode 100644 index 0000000..ae18767 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_334.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_335.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_335.png new file mode 100644 index 0000000..343f210 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_335.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_336.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_336.png new file mode 100644 index 0000000..4b16cef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_336.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_337.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_337.png new file mode 100644 index 0000000..f5b5d7b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_337.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_338.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_338.png new file mode 100644 index 0000000..b54aec2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_338.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_339.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_339.png new file mode 100644 index 0000000..8f283a2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_339.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_34.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_34.png new file mode 100644 index 0000000..6246bcb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_34.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_340.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_340.png new file mode 100644 index 0000000..700f91f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_340.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_341.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_341.png new file mode 100644 index 0000000..7595799 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_341.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_342.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_342.png new file mode 100644 index 0000000..e849d06 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_342.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_343.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_343.png new file mode 100644 index 0000000..3ab9d45 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_343.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_344.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_344.png new file mode 100644 index 0000000..7858974 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_344.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_345.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_345.png new file mode 100644 index 0000000..9f9caed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_345.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_346.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_346.png new file mode 100644 index 0000000..28b5427 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_346.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_347.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_347.png new file mode 100644 index 0000000..c9bf8e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_347.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_348.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_348.png new file mode 100644 index 0000000..95fe6c2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_348.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_349.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_349.png new file mode 100644 index 0000000..7b58ff0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_349.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_35.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_35.png new file mode 100644 index 0000000..61ba6c8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_35.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_350.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_350.png new file mode 100644 index 0000000..9c4b3bf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_350.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_351.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_351.png new file mode 100644 index 0000000..c896371 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_351.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_352.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_352.png new file mode 100644 index 0000000..08ee615 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_352.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_353.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_353.png new file mode 100644 index 0000000..ede64f0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_353.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_354.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_354.png new file mode 100644 index 0000000..25c3b87 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_354.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_355.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_355.png new file mode 100644 index 0000000..38f6488 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_355.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_356.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_356.png new file mode 100644 index 0000000..f8e350a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_356.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_357.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_357.png new file mode 100644 index 0000000..e0f5268 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_357.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_358.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_358.png new file mode 100644 index 0000000..3a976c3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_358.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_359.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_359.png new file mode 100644 index 0000000..9294113 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_359.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_36.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_36.png new file mode 100644 index 0000000..206d6d0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_36.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_360.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_360.png new file mode 100644 index 0000000..9f4df66 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_360.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_361.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_361.png new file mode 100644 index 0000000..db29524 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_361.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_362.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_362.png new file mode 100644 index 0000000..18c40ca Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_362.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_363.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_363.png new file mode 100644 index 0000000..c6a0edc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_363.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_364.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_364.png new file mode 100644 index 0000000..33e73c0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_364.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_365.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_365.png new file mode 100644 index 0000000..96ecc78 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_365.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_366.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_366.png new file mode 100644 index 0000000..2d61ed2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_366.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_367.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_367.png new file mode 100644 index 0000000..ee16302 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_367.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_368.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_368.png new file mode 100644 index 0000000..6ae9d9c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_368.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_369.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_369.png new file mode 100644 index 0000000..147b63d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_369.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_37.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_37.png new file mode 100644 index 0000000..fc30754 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_37.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_370.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_370.png new file mode 100644 index 0000000..44d0086 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_370.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_371.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_371.png new file mode 100644 index 0000000..28ef221 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_371.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_372.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_372.png new file mode 100644 index 0000000..e1cacfe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_372.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_373.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_373.png new file mode 100644 index 0000000..128448a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_373.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_374.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_374.png new file mode 100644 index 0000000..d86290a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_374.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_375.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_375.png new file mode 100644 index 0000000..496b761 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_375.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_376.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_376.png new file mode 100644 index 0000000..10e159a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_376.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_377.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_377.png new file mode 100644 index 0000000..60555f4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_377.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_378.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_378.png new file mode 100644 index 0000000..19483af Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_378.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_379.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_379.png new file mode 100644 index 0000000..377ce35 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_379.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_38.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_38.png new file mode 100644 index 0000000..59f2654 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_38.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_380.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_380.png new file mode 100644 index 0000000..a37e0a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_380.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_381.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_381.png new file mode 100644 index 0000000..7ac8d5c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_381.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_382.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_382.png new file mode 100644 index 0000000..57bbd0e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_382.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_383.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_383.png new file mode 100644 index 0000000..7d204fa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_383.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_384.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_384.png new file mode 100644 index 0000000..9ca813a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_384.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_385.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_385.png new file mode 100644 index 0000000..0028a3c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_385.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_386.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_386.png new file mode 100644 index 0000000..f567d6a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_386.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_387.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_387.png new file mode 100644 index 0000000..0edf974 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_387.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_388.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_388.png new file mode 100644 index 0000000..f7c581e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_388.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_389.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_389.png new file mode 100644 index 0000000..9cfd3d5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_389.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_39.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_39.png new file mode 100644 index 0000000..5dc7be5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_39.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_390.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_390.png new file mode 100644 index 0000000..4849fb4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_390.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_391.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_391.png new file mode 100644 index 0000000..b934f2c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_391.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_392.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_392.png new file mode 100644 index 0000000..173a35f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_392.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_393.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_393.png new file mode 100644 index 0000000..9ff49b7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_393.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_394.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_394.png new file mode 100644 index 0000000..92aa49e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_394.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_395.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_395.png new file mode 100644 index 0000000..f209dc2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_395.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_396.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_396.png new file mode 100644 index 0000000..b7a80e6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_396.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_397.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_397.png new file mode 100644 index 0000000..89aa3fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_397.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_398.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_398.png new file mode 100644 index 0000000..730a90a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_398.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_399.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_399.png new file mode 100644 index 0000000..44c3459 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_399.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_4.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_4.png new file mode 100644 index 0000000..8c3b4a4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_4.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_40.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_40.png new file mode 100644 index 0000000..0a8d69a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_40.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_400.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_400.png new file mode 100644 index 0000000..3a32f35 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_400.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_401.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_401.png new file mode 100644 index 0000000..7a46d3b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_401.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_402.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_402.png new file mode 100644 index 0000000..ad277cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_402.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_403.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_403.png new file mode 100644 index 0000000..ab61ca5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_403.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_404.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_404.png new file mode 100644 index 0000000..7da8680 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_404.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_405.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_405.png new file mode 100644 index 0000000..5807ea4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_405.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_406.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_406.png new file mode 100644 index 0000000..ff6b589 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_406.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_407.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_407.png new file mode 100644 index 0000000..a846242 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_407.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_408.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_408.png new file mode 100644 index 0000000..b74ce44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_408.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_409.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_409.png new file mode 100644 index 0000000..d53454a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_409.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_41.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_41.png new file mode 100644 index 0000000..4eaff8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_41.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_410.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_410.png new file mode 100644 index 0000000..4a38b06 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_410.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_411.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_411.png new file mode 100644 index 0000000..9e4bb26 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_411.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_412.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_412.png new file mode 100644 index 0000000..cb7a4b7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_412.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_413.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_413.png new file mode 100644 index 0000000..f4bfd53 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_413.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_414.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_414.png new file mode 100644 index 0000000..8024259 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_414.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_415.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_415.png new file mode 100644 index 0000000..785f2a4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_415.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_416.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_416.png new file mode 100644 index 0000000..ffb3a46 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_416.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_417.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_417.png new file mode 100644 index 0000000..52bb77f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_417.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_418.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_418.png new file mode 100644 index 0000000..91fd206 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_418.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_419.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_419.png new file mode 100644 index 0000000..b891804 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_419.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_42.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_42.png new file mode 100644 index 0000000..16dc114 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_42.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_420.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_420.png new file mode 100644 index 0000000..603b1d4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_420.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_421.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_421.png new file mode 100644 index 0000000..a1d0daa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_421.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_422.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_422.png new file mode 100644 index 0000000..d1199fe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_422.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_423.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_423.png new file mode 100644 index 0000000..83572ce Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_423.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_424.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_424.png new file mode 100644 index 0000000..b589e9c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_424.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_425.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_425.png new file mode 100644 index 0000000..a7533c9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_425.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_426.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_426.png new file mode 100644 index 0000000..8583a25 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_426.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_427.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_427.png new file mode 100644 index 0000000..194e3d1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_427.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_428.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_428.png new file mode 100644 index 0000000..d85f9df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_428.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_429.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_429.png new file mode 100644 index 0000000..cd85fe3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_429.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_43.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_43.png new file mode 100644 index 0000000..107aa29 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_43.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_430.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_430.png new file mode 100644 index 0000000..a3e7772 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_430.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_431.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_431.png new file mode 100644 index 0000000..6440a60 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_431.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_432.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_432.png new file mode 100644 index 0000000..89f082c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_432.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_433.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_433.png new file mode 100644 index 0000000..07c1098 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_433.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_434.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_434.png new file mode 100644 index 0000000..b21b5cc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_434.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_435.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_435.png new file mode 100644 index 0000000..794d641 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_435.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_436.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_436.png new file mode 100644 index 0000000..9cd3269 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_436.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_437.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_437.png new file mode 100644 index 0000000..72892e8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_437.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_438.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_438.png new file mode 100644 index 0000000..b1e53fa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_438.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_439.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_439.png new file mode 100644 index 0000000..9cd3da9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_439.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_44.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_44.png new file mode 100644 index 0000000..9cbf5e3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_44.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_440.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_440.png new file mode 100644 index 0000000..edd316c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_440.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_441.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_441.png new file mode 100644 index 0000000..82fc22a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_441.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_442.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_442.png new file mode 100644 index 0000000..c0a7123 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_442.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_443.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_443.png new file mode 100644 index 0000000..01bc6ff Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_443.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_444.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_444.png new file mode 100644 index 0000000..1715230 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_444.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_445.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_445.png new file mode 100644 index 0000000..276af8d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_445.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_446.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_446.png new file mode 100644 index 0000000..daf7e7d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_446.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_447.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_447.png new file mode 100644 index 0000000..d1e6858 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_447.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_448.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_448.png new file mode 100644 index 0000000..cc1e355 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_448.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_449.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_449.png new file mode 100644 index 0000000..6dc36f7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_449.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_45.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_45.png new file mode 100644 index 0000000..d1a5dce Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_45.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_450.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_450.png new file mode 100644 index 0000000..6263ab0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_450.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_451.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_451.png new file mode 100644 index 0000000..aa5f999 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_451.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_452.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_452.png new file mode 100644 index 0000000..f7a3b74 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_452.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_453.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_453.png new file mode 100644 index 0000000..79216b3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_453.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_454.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_454.png new file mode 100644 index 0000000..74c4aa9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_454.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_455.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_455.png new file mode 100644 index 0000000..7777af3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_455.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_456.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_456.png new file mode 100644 index 0000000..75aee44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_456.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_457.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_457.png new file mode 100644 index 0000000..15bbc64 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_457.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_458.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_458.png new file mode 100644 index 0000000..a9c3a67 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_458.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_459.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_459.png new file mode 100644 index 0000000..c9b3c1e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_459.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_46.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_46.png new file mode 100644 index 0000000..43e79f6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_46.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_460.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_460.png new file mode 100644 index 0000000..7e52be8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_460.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_461.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_461.png new file mode 100644 index 0000000..bf88a4a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_461.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_462.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_462.png new file mode 100644 index 0000000..92ed52b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_462.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_463.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_463.png new file mode 100644 index 0000000..1bab5bc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_463.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_464.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_464.png new file mode 100644 index 0000000..c1dc992 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_464.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_465.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_465.png new file mode 100644 index 0000000..02ee83a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_465.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_466.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_466.png new file mode 100644 index 0000000..759ae05 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_466.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_467.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_467.png new file mode 100644 index 0000000..730c3c1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_467.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_468.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_468.png new file mode 100644 index 0000000..ac596a9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_468.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_469.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_469.png new file mode 100644 index 0000000..1ed940b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_469.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_47.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_47.png new file mode 100644 index 0000000..2d3b1a2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_47.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_470.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_470.png new file mode 100644 index 0000000..d847a0f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_470.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_471.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_471.png new file mode 100644 index 0000000..a04d79c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_471.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_472.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_472.png new file mode 100644 index 0000000..cc6d160 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_472.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_473.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_473.png new file mode 100644 index 0000000..2af8949 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_473.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_474.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_474.png new file mode 100644 index 0000000..e1fad41 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_474.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_475.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_475.png new file mode 100644 index 0000000..523a192 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_475.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_476.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_476.png new file mode 100644 index 0000000..f1c805f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_476.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_477.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_477.png new file mode 100644 index 0000000..22bbf8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_477.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_478.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_478.png new file mode 100644 index 0000000..25b34bb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_478.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_479.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_479.png new file mode 100644 index 0000000..e4d96df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_479.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_48.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_48.png new file mode 100644 index 0000000..858562f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_48.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_480.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_480.png new file mode 100644 index 0000000..d22c43f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_480.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_481.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_481.png new file mode 100644 index 0000000..43b4de5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_481.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_482.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_482.png new file mode 100644 index 0000000..24dcb39 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_482.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_483.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_483.png new file mode 100644 index 0000000..f6fb25a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_483.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_484.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_484.png new file mode 100644 index 0000000..1bc8983 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_484.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_485.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_485.png new file mode 100644 index 0000000..1034b12 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_485.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_486.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_486.png new file mode 100644 index 0000000..b7da245 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_486.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_487.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_487.png new file mode 100644 index 0000000..f0b81d3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_487.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_488.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_488.png new file mode 100644 index 0000000..128390a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_488.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_489.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_489.png new file mode 100644 index 0000000..c111e76 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_489.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_49.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_49.png new file mode 100644 index 0000000..8f3794f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_49.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_490.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_490.png new file mode 100644 index 0000000..f38b750 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_490.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_491.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_491.png new file mode 100644 index 0000000..516d5ac Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_491.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_492.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_492.png new file mode 100644 index 0000000..8729b5b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_492.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_493.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_493.png new file mode 100644 index 0000000..95f8237 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_493.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_494.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_494.png new file mode 100644 index 0000000..3e7a335 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_494.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_495.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_495.png new file mode 100644 index 0000000..473b832 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_495.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_496.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_496.png new file mode 100644 index 0000000..224250f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_496.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_497.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_497.png new file mode 100644 index 0000000..7b9c9b4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_497.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_498.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_498.png new file mode 100644 index 0000000..55a0dff Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_498.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_499.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_499.png new file mode 100644 index 0000000..8e06ac7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_499.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_5.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_5.png new file mode 100644 index 0000000..25b7e6a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_5.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_50.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_50.png new file mode 100644 index 0000000..395f6cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_50.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_500.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_500.png new file mode 100644 index 0000000..5e883b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_500.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_501.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_501.png new file mode 100644 index 0000000..bfc4d9b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_501.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_502.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_502.png new file mode 100644 index 0000000..edc3eb8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_502.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_503.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_503.png new file mode 100644 index 0000000..631df1e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_503.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_504.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_504.png new file mode 100644 index 0000000..4b49e7b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_504.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_505.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_505.png new file mode 100644 index 0000000..eca3377 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_505.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_506.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_506.png new file mode 100644 index 0000000..62f478c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_506.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_507.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_507.png new file mode 100644 index 0000000..4299fc2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_507.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_508.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_508.png new file mode 100644 index 0000000..847f654 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_508.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_509.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_509.png new file mode 100644 index 0000000..41c11b7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_509.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_51.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_51.png new file mode 100644 index 0000000..c7d693d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_51.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_510.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_510.png new file mode 100644 index 0000000..fbf259d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_510.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_511.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_511.png new file mode 100644 index 0000000..b69cb37 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_511.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_512.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_512.png new file mode 100644 index 0000000..bdee5c3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_512.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_513.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_513.png new file mode 100644 index 0000000..bcc710b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_513.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_514.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_514.png new file mode 100644 index 0000000..a87926f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_514.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_515.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_515.png new file mode 100644 index 0000000..3b430f2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_515.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_516.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_516.png new file mode 100644 index 0000000..1327e59 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_516.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_517.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_517.png new file mode 100644 index 0000000..d2ff1c1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_517.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_518.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_518.png new file mode 100644 index 0000000..2bd9953 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_518.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_519.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_519.png new file mode 100644 index 0000000..3ff7158 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_519.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_52.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_52.png new file mode 100644 index 0000000..1b3fc11 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_52.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_520.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_520.png new file mode 100644 index 0000000..ba317a3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_520.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_521.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_521.png new file mode 100644 index 0000000..0feec08 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_521.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_522.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_522.png new file mode 100644 index 0000000..417fce6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_522.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_523.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_523.png new file mode 100644 index 0000000..0d4a1b7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_523.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_524.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_524.png new file mode 100644 index 0000000..0ae6227 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_524.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_525.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_525.png new file mode 100644 index 0000000..00b6bbb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_525.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_526.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_526.png new file mode 100644 index 0000000..49ea27e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_526.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_527.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_527.png new file mode 100644 index 0000000..e95b646 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_527.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_528.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_528.png new file mode 100644 index 0000000..4f2be0b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_528.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_529.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_529.png new file mode 100644 index 0000000..cbffade Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_529.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_53.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_53.png new file mode 100644 index 0000000..78c5baa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_53.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_530.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_530.png new file mode 100644 index 0000000..8956fdb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_530.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_531.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_531.png new file mode 100644 index 0000000..dae2f3d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_531.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_532.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_532.png new file mode 100644 index 0000000..0f8917d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_532.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_533.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_533.png new file mode 100644 index 0000000..53e4751 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_533.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_534.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_534.png new file mode 100644 index 0000000..48ed6a3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_534.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_535.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_535.png new file mode 100644 index 0000000..14eb5f8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_535.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_536.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_536.png new file mode 100644 index 0000000..f4566ca Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_536.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_537.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_537.png new file mode 100644 index 0000000..43c42e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_537.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_538.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_538.png new file mode 100644 index 0000000..1f34d31 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_538.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_539.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_539.png new file mode 100644 index 0000000..006fe6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_539.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_54.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_54.png new file mode 100644 index 0000000..87e67dd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_54.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_540.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_540.png new file mode 100644 index 0000000..5c3788e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_540.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_541.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_541.png new file mode 100644 index 0000000..3fbae38 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_541.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_542.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_542.png new file mode 100644 index 0000000..14a02ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_542.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_543.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_543.png new file mode 100644 index 0000000..cd13734 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_543.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_544.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_544.png new file mode 100644 index 0000000..598d399 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_544.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_545.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_545.png new file mode 100644 index 0000000..ef59452 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_545.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_546.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_546.png new file mode 100644 index 0000000..fc71e87 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_546.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_547.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_547.png new file mode 100644 index 0000000..1fb1f9a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_547.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_548.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_548.png new file mode 100644 index 0000000..67da888 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_548.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_549.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_549.png new file mode 100644 index 0000000..fdc51b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_549.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_55.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_55.png new file mode 100644 index 0000000..c086a21 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_55.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_550.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_550.png new file mode 100644 index 0000000..160574f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_550.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_551.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_551.png new file mode 100644 index 0000000..f4f3656 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_551.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_552.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_552.png new file mode 100644 index 0000000..5ff7c83 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_552.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_553.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_553.png new file mode 100644 index 0000000..6377bec Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_553.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_554.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_554.png new file mode 100644 index 0000000..6f7ccb7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_554.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_555.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_555.png new file mode 100644 index 0000000..82538ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_555.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_556.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_556.png new file mode 100644 index 0000000..cff7fe5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_556.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_557.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_557.png new file mode 100644 index 0000000..2c295bd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_557.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_558.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_558.png new file mode 100644 index 0000000..0a88b00 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_558.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_559.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_559.png new file mode 100644 index 0000000..9f66797 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_559.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_56.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_56.png new file mode 100644 index 0000000..f021498 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_56.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_560.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_560.png new file mode 100644 index 0000000..8b2f605 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_560.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_561.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_561.png new file mode 100644 index 0000000..424dd2a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_561.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_562.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_562.png new file mode 100644 index 0000000..c10a56c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_562.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_563.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_563.png new file mode 100644 index 0000000..37a2833 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_563.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_564.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_564.png new file mode 100644 index 0000000..8246212 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_564.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_565.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_565.png new file mode 100644 index 0000000..6253362 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_565.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_566.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_566.png new file mode 100644 index 0000000..0f26af2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_566.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_567.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_567.png new file mode 100644 index 0000000..d678cd3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_567.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_568.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_568.png new file mode 100644 index 0000000..eeeea05 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_568.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_569.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_569.png new file mode 100644 index 0000000..ba2f8b0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_569.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_57.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_57.png new file mode 100644 index 0000000..4729e3f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_57.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_570.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_570.png new file mode 100644 index 0000000..aa1817c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_570.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_571.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_571.png new file mode 100644 index 0000000..9d03f91 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_571.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_572.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_572.png new file mode 100644 index 0000000..53d45cb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_572.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_573.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_573.png new file mode 100644 index 0000000..9e9f718 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_573.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_574.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_574.png new file mode 100644 index 0000000..cd19697 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_574.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_575.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_575.png new file mode 100644 index 0000000..8a23b9c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_575.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_576.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_576.png new file mode 100644 index 0000000..b714798 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_576.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_577.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_577.png new file mode 100644 index 0000000..e6227df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_577.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_578.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_578.png new file mode 100644 index 0000000..92cdb8c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_578.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_579.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_579.png new file mode 100644 index 0000000..f7e3075 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_579.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_58.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_58.png new file mode 100644 index 0000000..cf48f3c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_58.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_580.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_580.png new file mode 100644 index 0000000..858337c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_580.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_581.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_581.png new file mode 100644 index 0000000..b641d6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_581.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_582.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_582.png new file mode 100644 index 0000000..3b71897 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_582.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_583.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_583.png new file mode 100644 index 0000000..f7d078b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_583.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_584.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_584.png new file mode 100644 index 0000000..3e694a7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_584.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_585.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_585.png new file mode 100644 index 0000000..fd1fde5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_585.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_586.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_586.png new file mode 100644 index 0000000..e4f20a7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_586.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_587.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_587.png new file mode 100644 index 0000000..297a7ed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_587.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_588.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_588.png new file mode 100644 index 0000000..a66f0a2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_588.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_589.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_589.png new file mode 100644 index 0000000..9133c81 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_589.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_59.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_59.png new file mode 100644 index 0000000..01790fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_59.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_590.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_590.png new file mode 100644 index 0000000..a74edaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_590.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_591.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_591.png new file mode 100644 index 0000000..1d333c7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_591.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_592.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_592.png new file mode 100644 index 0000000..66e79e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_592.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_593.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_593.png new file mode 100644 index 0000000..c8da488 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_593.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_594.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_594.png new file mode 100644 index 0000000..afadabb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_594.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_595.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_595.png new file mode 100644 index 0000000..880d6cb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_595.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_596.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_596.png new file mode 100644 index 0000000..cba3aaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_596.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_597.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_597.png new file mode 100644 index 0000000..20964da Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_597.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_598.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_598.png new file mode 100644 index 0000000..6b8435f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_598.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_599.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_599.png new file mode 100644 index 0000000..cc6136c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_599.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_6.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_6.png new file mode 100644 index 0000000..6fcf944 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_6.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_60.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_60.png new file mode 100644 index 0000000..770e88c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_60.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_600.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_600.png new file mode 100644 index 0000000..89b39b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_600.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_601.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_601.png new file mode 100644 index 0000000..b2d5326 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_601.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_602.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_602.png new file mode 100644 index 0000000..f2aac09 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_602.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_603.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_603.png new file mode 100644 index 0000000..2d26f53 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_603.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_604.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_604.png new file mode 100644 index 0000000..21fc7f1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_604.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_605.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_605.png new file mode 100644 index 0000000..b213640 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_605.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_606.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_606.png new file mode 100644 index 0000000..e44083a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_606.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_607.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_607.png new file mode 100644 index 0000000..1323af6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_607.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_608.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_608.png new file mode 100644 index 0000000..e19bb6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_608.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_609.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_609.png new file mode 100644 index 0000000..5ff811e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_609.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_61.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_61.png new file mode 100644 index 0000000..27c0ec3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_61.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_610.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_610.png new file mode 100644 index 0000000..04ec700 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_610.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_611.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_611.png new file mode 100644 index 0000000..b1383c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_611.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_612.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_612.png new file mode 100644 index 0000000..94743d3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_612.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_613.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_613.png new file mode 100644 index 0000000..55f7fbe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_613.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_614.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_614.png new file mode 100644 index 0000000..dff3323 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_614.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_615.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_615.png new file mode 100644 index 0000000..d97cab3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_615.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_616.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_616.png new file mode 100644 index 0000000..ad0e431 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_616.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_617.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_617.png new file mode 100644 index 0000000..c4d69b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_617.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_618.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_618.png new file mode 100644 index 0000000..464db0e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_618.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_619.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_619.png new file mode 100644 index 0000000..d6c61d3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_619.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_62.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_62.png new file mode 100644 index 0000000..38ff066 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_62.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_620.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_620.png new file mode 100644 index 0000000..78e8106 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_620.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_621.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_621.png new file mode 100644 index 0000000..5bd68e4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_621.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_622.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_622.png new file mode 100644 index 0000000..45c2d61 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_622.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_623.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_623.png new file mode 100644 index 0000000..d0d946a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_623.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_624.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_624.png new file mode 100644 index 0000000..d5e972a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_624.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_625.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_625.png new file mode 100644 index 0000000..9c69144 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_625.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_626.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_626.png new file mode 100644 index 0000000..b3887d1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_626.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_627.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_627.png new file mode 100644 index 0000000..11607e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_627.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_628.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_628.png new file mode 100644 index 0000000..5b6346d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_628.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_629.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_629.png new file mode 100644 index 0000000..a5213b8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_629.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_63.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_63.png new file mode 100644 index 0000000..43f7570 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_63.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_630.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_630.png new file mode 100644 index 0000000..50932db Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_630.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_631.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_631.png new file mode 100644 index 0000000..19ee12c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_631.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_632.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_632.png new file mode 100644 index 0000000..52b73fc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_632.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_633.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_633.png new file mode 100644 index 0000000..5496471 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_633.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_634.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_634.png new file mode 100644 index 0000000..b8d8d77 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_634.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_635.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_635.png new file mode 100644 index 0000000..43dc231 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_635.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_636.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_636.png new file mode 100644 index 0000000..ae30b1c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_636.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_637.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_637.png new file mode 100644 index 0000000..f22eca6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_637.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_638.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_638.png new file mode 100644 index 0000000..754cd2d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_638.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_639.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_639.png new file mode 100644 index 0000000..1d69d59 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_639.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_64.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_64.png new file mode 100644 index 0000000..6661abd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_64.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_640.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_640.png new file mode 100644 index 0000000..be6d7e9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_640.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_641.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_641.png new file mode 100644 index 0000000..9b8b218 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_641.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_642.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_642.png new file mode 100644 index 0000000..bcfb633 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_642.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_643.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_643.png new file mode 100644 index 0000000..7353ca5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_643.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_644.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_644.png new file mode 100644 index 0000000..607ee4d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_644.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_645.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_645.png new file mode 100644 index 0000000..d54665f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_645.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_646.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_646.png new file mode 100644 index 0000000..bbb5909 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_646.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_647.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_647.png new file mode 100644 index 0000000..182be1f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_647.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_648.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_648.png new file mode 100644 index 0000000..8803eaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_648.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_649.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_649.png new file mode 100644 index 0000000..e0550a5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_649.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_65.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_65.png new file mode 100644 index 0000000..f746fe8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_65.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_650.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_650.png new file mode 100644 index 0000000..8dd6b17 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_650.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_651.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_651.png new file mode 100644 index 0000000..5c6b048 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_651.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_652.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_652.png new file mode 100644 index 0000000..22efe46 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_652.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_653.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_653.png new file mode 100644 index 0000000..dbe670d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_653.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_654.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_654.png new file mode 100644 index 0000000..ab95435 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_654.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_655.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_655.png new file mode 100644 index 0000000..89775b0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_655.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_656.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_656.png new file mode 100644 index 0000000..5836842 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_656.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_657.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_657.png new file mode 100644 index 0000000..435d080 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_657.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_658.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_658.png new file mode 100644 index 0000000..5fbf6f8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_658.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_659.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_659.png new file mode 100644 index 0000000..a2f111d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_659.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_66.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_66.png new file mode 100644 index 0000000..571042b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_66.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_660.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_660.png new file mode 100644 index 0000000..c8d9a43 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_660.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_661.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_661.png new file mode 100644 index 0000000..dccc583 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_661.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_662.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_662.png new file mode 100644 index 0000000..a1e9cc8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_662.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_663.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_663.png new file mode 100644 index 0000000..9607f0b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_663.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_664.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_664.png new file mode 100644 index 0000000..c3496af Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_664.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_665.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_665.png new file mode 100644 index 0000000..9456ce3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_665.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_666.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_666.png new file mode 100644 index 0000000..66aa8ce Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_666.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_667.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_667.png new file mode 100644 index 0000000..0171cc0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_667.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_668.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_668.png new file mode 100644 index 0000000..d500701 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_668.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_669.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_669.png new file mode 100644 index 0000000..ee861a1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_669.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_67.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_67.png new file mode 100644 index 0000000..d608799 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_67.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_670.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_670.png new file mode 100644 index 0000000..20c885d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_670.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_671.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_671.png new file mode 100644 index 0000000..6ad82e6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_671.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_672.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_672.png new file mode 100644 index 0000000..891f0bd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_672.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_673.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_673.png new file mode 100644 index 0000000..f4e21fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_673.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_674.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_674.png new file mode 100644 index 0000000..953ecd7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_674.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_675.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_675.png new file mode 100644 index 0000000..2afff39 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_675.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_676.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_676.png new file mode 100644 index 0000000..3d23977 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_676.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_677.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_677.png new file mode 100644 index 0000000..f81e62f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_677.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_678.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_678.png new file mode 100644 index 0000000..957ec4b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_678.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_679.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_679.png new file mode 100644 index 0000000..7892dbb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_679.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_68.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_68.png new file mode 100644 index 0000000..62da4c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_68.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_680.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_680.png new file mode 100644 index 0000000..c728d6e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_680.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_681.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_681.png new file mode 100644 index 0000000..a71cf46 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_681.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_682.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_682.png new file mode 100644 index 0000000..eabb015 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_682.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_683.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_683.png new file mode 100644 index 0000000..8090b29 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_683.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_684.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_684.png new file mode 100644 index 0000000..a6c9ffe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_684.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_685.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_685.png new file mode 100644 index 0000000..f9e3f19 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_685.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_686.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_686.png new file mode 100644 index 0000000..ab47e16 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_686.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_687.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_687.png new file mode 100644 index 0000000..10035f9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_687.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_688.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_688.png new file mode 100644 index 0000000..bcae4df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_688.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_689.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_689.png new file mode 100644 index 0000000..dd5b521 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_689.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_69.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_69.png new file mode 100644 index 0000000..6fea73d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_69.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_690.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_690.png new file mode 100644 index 0000000..abde0c9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_690.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_691.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_691.png new file mode 100644 index 0000000..4ac3160 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_691.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_692.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_692.png new file mode 100644 index 0000000..4ceec7a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_692.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_693.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_693.png new file mode 100644 index 0000000..28a0377 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_693.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_694.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_694.png new file mode 100644 index 0000000..1eb208c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_694.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_695.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_695.png new file mode 100644 index 0000000..5171419 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_695.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_696.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_696.png new file mode 100644 index 0000000..877d797 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_696.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_697.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_697.png new file mode 100644 index 0000000..99ea83d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_697.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_698.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_698.png new file mode 100644 index 0000000..7bfb160 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_698.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_699.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_699.png new file mode 100644 index 0000000..cd3c3ae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_699.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_7.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_7.png new file mode 100644 index 0000000..603f5f5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_7.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_70.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_70.png new file mode 100644 index 0000000..7f93703 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_70.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_700.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_700.png new file mode 100644 index 0000000..96eb34a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_700.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_701.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_701.png new file mode 100644 index 0000000..daa8870 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_701.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_702.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_702.png new file mode 100644 index 0000000..273ec7d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_702.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_703.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_703.png new file mode 100644 index 0000000..a5c8828 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_703.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_704.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_704.png new file mode 100644 index 0000000..cb96429 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_704.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_705.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_705.png new file mode 100644 index 0000000..85ca2eb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_705.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_706.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_706.png new file mode 100644 index 0000000..aedabf4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_706.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_707.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_707.png new file mode 100644 index 0000000..65c0fbc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_707.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_708.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_708.png new file mode 100644 index 0000000..4e7a93e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_708.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_709.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_709.png new file mode 100644 index 0000000..c0826c0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_709.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_71.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_71.png new file mode 100644 index 0000000..4b1e8bb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_71.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_710.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_710.png new file mode 100644 index 0000000..895c5c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_710.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_711.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_711.png new file mode 100644 index 0000000..9254952 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_711.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_712.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_712.png new file mode 100644 index 0000000..1c1a328 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_712.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_713.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_713.png new file mode 100644 index 0000000..ceeb401 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_713.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_714.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_714.png new file mode 100644 index 0000000..85d9ba3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_714.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_715.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_715.png new file mode 100644 index 0000000..b981ee5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_715.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_716.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_716.png new file mode 100644 index 0000000..f03e458 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_716.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_717.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_717.png new file mode 100644 index 0000000..a8d7711 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_717.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_718.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_718.png new file mode 100644 index 0000000..f81ce6c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_718.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_719.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_719.png new file mode 100644 index 0000000..55e5cf2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_719.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_72.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_72.png new file mode 100644 index 0000000..242cc2e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_72.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_720.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_720.png new file mode 100644 index 0000000..f6dbfaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_720.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_721.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_721.png new file mode 100644 index 0000000..45eb028 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_721.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_722.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_722.png new file mode 100644 index 0000000..f17ea70 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_722.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_723.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_723.png new file mode 100644 index 0000000..0d1fefa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_723.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_724.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_724.png new file mode 100644 index 0000000..a5063db Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_724.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_725.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_725.png new file mode 100644 index 0000000..ab26809 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_725.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_726.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_726.png new file mode 100644 index 0000000..b0e8cbe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_726.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_727.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_727.png new file mode 100644 index 0000000..75b1151 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_727.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_728.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_728.png new file mode 100644 index 0000000..6d80030 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_728.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_729.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_729.png new file mode 100644 index 0000000..a5f0c45 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_729.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_73.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_73.png new file mode 100644 index 0000000..6dc6bad Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_73.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_730.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_730.png new file mode 100644 index 0000000..eea680f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_730.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_731.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_731.png new file mode 100644 index 0000000..45779f9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_731.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_732.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_732.png new file mode 100644 index 0000000..5199741 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_732.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_733.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_733.png new file mode 100644 index 0000000..3177f9a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_733.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_734.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_734.png new file mode 100644 index 0000000..9c6d91a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_734.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_735.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_735.png new file mode 100644 index 0000000..422d13c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_735.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_736.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_736.png new file mode 100644 index 0000000..41b2b4d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_736.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_737.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_737.png new file mode 100644 index 0000000..b0b2d21 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_737.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_738.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_738.png new file mode 100644 index 0000000..56e1937 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_738.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_739.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_739.png new file mode 100644 index 0000000..da8c293 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_739.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_74.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_74.png new file mode 100644 index 0000000..9791d57 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_74.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_740.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_740.png new file mode 100644 index 0000000..10747ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_740.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_741.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_741.png new file mode 100644 index 0000000..0f5c816 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_741.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_742.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_742.png new file mode 100644 index 0000000..894e6b4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_742.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_743.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_743.png new file mode 100644 index 0000000..edd3f78 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_743.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_744.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_744.png new file mode 100644 index 0000000..81f2b1c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_744.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_745.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_745.png new file mode 100644 index 0000000..03c3988 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_745.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_746.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_746.png new file mode 100644 index 0000000..52d9aad Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_746.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_747.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_747.png new file mode 100644 index 0000000..d0bc5f4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_747.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_748.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_748.png new file mode 100644 index 0000000..abe1ee2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_748.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_749.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_749.png new file mode 100644 index 0000000..c773e7e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_749.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_75.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_75.png new file mode 100644 index 0000000..8f4720d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_75.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_750.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_750.png new file mode 100644 index 0000000..7a2ffb0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_750.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_751.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_751.png new file mode 100644 index 0000000..2de08ae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_751.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_752.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_752.png new file mode 100644 index 0000000..af1a14a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_752.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_753.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_753.png new file mode 100644 index 0000000..81b3d1e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_753.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_754.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_754.png new file mode 100644 index 0000000..eb25cf9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_754.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_755.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_755.png new file mode 100644 index 0000000..f736d14 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_755.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_756.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_756.png new file mode 100644 index 0000000..0276779 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_756.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_757.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_757.png new file mode 100644 index 0000000..4b24683 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_757.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_758.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_758.png new file mode 100644 index 0000000..080e01c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_758.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_759.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_759.png new file mode 100644 index 0000000..b581d60 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_759.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_76.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_76.png new file mode 100644 index 0000000..ba6f64c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_76.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_760.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_760.png new file mode 100644 index 0000000..a2663d2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_760.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_761.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_761.png new file mode 100644 index 0000000..52cfe98 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_761.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_762.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_762.png new file mode 100644 index 0000000..cfb9664 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_762.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_763.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_763.png new file mode 100644 index 0000000..1d5fe0d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_763.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_764.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_764.png new file mode 100644 index 0000000..c484744 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_764.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_765.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_765.png new file mode 100644 index 0000000..0bfaf45 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_765.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_766.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_766.png new file mode 100644 index 0000000..d420758 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_766.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_767.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_767.png new file mode 100644 index 0000000..5cdc6f5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_767.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_768.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_768.png new file mode 100644 index 0000000..cb076e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_768.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_769.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_769.png new file mode 100644 index 0000000..3307fc3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_769.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_77.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_77.png new file mode 100644 index 0000000..1a61ed3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_77.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_770.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_770.png new file mode 100644 index 0000000..a76fb5d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_770.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_771.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_771.png new file mode 100644 index 0000000..557c71a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_771.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_772.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_772.png new file mode 100644 index 0000000..25659fb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_772.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_773.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_773.png new file mode 100644 index 0000000..8f16002 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_773.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_774.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_774.png new file mode 100644 index 0000000..69ecae9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_774.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_775.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_775.png new file mode 100644 index 0000000..d3be414 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_775.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_776.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_776.png new file mode 100644 index 0000000..1fb428c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_776.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_777.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_777.png new file mode 100644 index 0000000..c58185a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_777.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_778.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_778.png new file mode 100644 index 0000000..805eb0b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_778.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_779.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_779.png new file mode 100644 index 0000000..d9a2136 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_779.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_78.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_78.png new file mode 100644 index 0000000..66f9f32 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_78.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_780.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_780.png new file mode 100644 index 0000000..cce5e31 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_780.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_781.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_781.png new file mode 100644 index 0000000..5a6226e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_781.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_782.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_782.png new file mode 100644 index 0000000..0d27505 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_782.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_783.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_783.png new file mode 100644 index 0000000..0216504 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_783.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_784.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_784.png new file mode 100644 index 0000000..bc542c4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_784.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_785.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_785.png new file mode 100644 index 0000000..870f865 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_785.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_786.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_786.png new file mode 100644 index 0000000..cb4c6bd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_786.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_787.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_787.png new file mode 100644 index 0000000..07c4cf7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_787.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_788.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_788.png new file mode 100644 index 0000000..78d6924 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_788.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_789.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_789.png new file mode 100644 index 0000000..96e1ed4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_789.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_79.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_79.png new file mode 100644 index 0000000..32a96fc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_79.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_790.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_790.png new file mode 100644 index 0000000..4f3e9db Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_790.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_791.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_791.png new file mode 100644 index 0000000..07c091d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_791.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_792.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_792.png new file mode 100644 index 0000000..0592fc8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_792.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_793.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_793.png new file mode 100644 index 0000000..8724f90 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_793.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_794.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_794.png new file mode 100644 index 0000000..60e7108 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_794.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_795.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_795.png new file mode 100644 index 0000000..0cc89bd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_795.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_796.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_796.png new file mode 100644 index 0000000..e774840 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_796.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_797.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_797.png new file mode 100644 index 0000000..c8ec3cd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_797.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_798.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_798.png new file mode 100644 index 0000000..f90007d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_798.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_799.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_799.png new file mode 100644 index 0000000..ca11c5a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_799.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_8.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_8.png new file mode 100644 index 0000000..6bbc2cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_8.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_80.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_80.png new file mode 100644 index 0000000..29f0188 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_80.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_800.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_800.png new file mode 100644 index 0000000..08d720e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_800.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_801.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_801.png new file mode 100644 index 0000000..cea4fa9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_801.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_802.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_802.png new file mode 100644 index 0000000..6dfe74a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_802.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_803.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_803.png new file mode 100644 index 0000000..d0862f5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_803.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_804.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_804.png new file mode 100644 index 0000000..a5dc860 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_804.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_805.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_805.png new file mode 100644 index 0000000..ab057ea Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_805.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_806.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_806.png new file mode 100644 index 0000000..77dd090 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_806.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_807.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_807.png new file mode 100644 index 0000000..35da302 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_807.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_808.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_808.png new file mode 100644 index 0000000..fd8f75c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_808.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_809.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_809.png new file mode 100644 index 0000000..df8d315 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_809.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_81.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_81.png new file mode 100644 index 0000000..1680b8d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_81.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_810.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_810.png new file mode 100644 index 0000000..466b557 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_810.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_811.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_811.png new file mode 100644 index 0000000..3138dd5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_811.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_812.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_812.png new file mode 100644 index 0000000..89c91f6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_812.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_813.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_813.png new file mode 100644 index 0000000..03e1990 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_813.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_814.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_814.png new file mode 100644 index 0000000..ca93249 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_814.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_815.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_815.png new file mode 100644 index 0000000..4dd7636 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_815.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_816.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_816.png new file mode 100644 index 0000000..5719a83 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_816.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_817.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_817.png new file mode 100644 index 0000000..8ff58f8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_817.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_818.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_818.png new file mode 100644 index 0000000..f9007d6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_818.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_819.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_819.png new file mode 100644 index 0000000..a922ba4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_819.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_82.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_82.png new file mode 100644 index 0000000..32ba2df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_82.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_820.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_820.png new file mode 100644 index 0000000..36af458 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_820.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_821.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_821.png new file mode 100644 index 0000000..9ff7235 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_821.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_822.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_822.png new file mode 100644 index 0000000..504fc0f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_822.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_823.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_823.png new file mode 100644 index 0000000..fbb5a22 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_823.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_824.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_824.png new file mode 100644 index 0000000..a4f3948 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_824.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_825.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_825.png new file mode 100644 index 0000000..d0f2536 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_825.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_826.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_826.png new file mode 100644 index 0000000..94da81a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_826.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_827.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_827.png new file mode 100644 index 0000000..f68b122 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_827.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_828.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_828.png new file mode 100644 index 0000000..27ba67e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_828.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_829.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_829.png new file mode 100644 index 0000000..b6d33ad Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_829.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_83.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_83.png new file mode 100644 index 0000000..b1e2536 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_83.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_830.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_830.png new file mode 100644 index 0000000..dd0da37 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_830.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_831.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_831.png new file mode 100644 index 0000000..8ab10a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_831.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_832.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_832.png new file mode 100644 index 0000000..6803261 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_832.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_833.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_833.png new file mode 100644 index 0000000..2299531 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_833.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_834.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_834.png new file mode 100644 index 0000000..439b331 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_834.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_835.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_835.png new file mode 100644 index 0000000..40c3e61 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_835.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_836.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_836.png new file mode 100644 index 0000000..aac8f23 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_836.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_837.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_837.png new file mode 100644 index 0000000..f502f9e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_837.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_838.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_838.png new file mode 100644 index 0000000..ff9ca66 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_838.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_839.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_839.png new file mode 100644 index 0000000..bb82e77 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_839.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_84.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_84.png new file mode 100644 index 0000000..3b62def Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_84.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_840.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_840.png new file mode 100644 index 0000000..7e7aad4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_840.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_841.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_841.png new file mode 100644 index 0000000..31897ed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_841.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_842.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_842.png new file mode 100644 index 0000000..83fa398 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_842.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_843.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_843.png new file mode 100644 index 0000000..d7dd853 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_843.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_844.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_844.png new file mode 100644 index 0000000..a792d95 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_844.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_845.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_845.png new file mode 100644 index 0000000..57bbe38 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_845.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_846.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_846.png new file mode 100644 index 0000000..5c8e7e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_846.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_847.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_847.png new file mode 100644 index 0000000..e7d3cab Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_847.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_848.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_848.png new file mode 100644 index 0000000..d6b0795 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_848.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_849.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_849.png new file mode 100644 index 0000000..06381fe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_849.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_85.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_85.png new file mode 100644 index 0000000..1256f0e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_85.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_850.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_850.png new file mode 100644 index 0000000..1ad3a08 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_850.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_851.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_851.png new file mode 100644 index 0000000..3539469 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_851.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_852.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_852.png new file mode 100644 index 0000000..24eafaf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_852.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_853.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_853.png new file mode 100644 index 0000000..7b2816d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_853.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_854.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_854.png new file mode 100644 index 0000000..d5d2d78 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_854.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_855.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_855.png new file mode 100644 index 0000000..e67f9c3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_855.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_856.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_856.png new file mode 100644 index 0000000..d22bcbe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_856.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_857.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_857.png new file mode 100644 index 0000000..c45cef9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_857.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_858.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_858.png new file mode 100644 index 0000000..84ffeb7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_858.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_859.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_859.png new file mode 100644 index 0000000..846b4c0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_859.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_86.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_86.png new file mode 100644 index 0000000..ae84a1b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_86.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_860.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_860.png new file mode 100644 index 0000000..536522e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_860.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_861.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_861.png new file mode 100644 index 0000000..f6e718a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_861.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_862.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_862.png new file mode 100644 index 0000000..025a608 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_862.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_863.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_863.png new file mode 100644 index 0000000..d97e970 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_863.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_864.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_864.png new file mode 100644 index 0000000..1be2555 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_864.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_865.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_865.png new file mode 100644 index 0000000..18efb18 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_865.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_866.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_866.png new file mode 100644 index 0000000..16be896 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_866.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_867.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_867.png new file mode 100644 index 0000000..2fff8f1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_867.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_868.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_868.png new file mode 100644 index 0000000..6a2bf06 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_868.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_869.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_869.png new file mode 100644 index 0000000..e54f5a0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_869.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_87.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_87.png new file mode 100644 index 0000000..7d18d4e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_87.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_870.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_870.png new file mode 100644 index 0000000..a34ba2c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_870.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_871.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_871.png new file mode 100644 index 0000000..a262127 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_871.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_872.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_872.png new file mode 100644 index 0000000..88d25ab Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_872.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_873.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_873.png new file mode 100644 index 0000000..635e5c1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_873.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_874.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_874.png new file mode 100644 index 0000000..09b296f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_874.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_875.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_875.png new file mode 100644 index 0000000..ce83e59 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_875.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_876.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_876.png new file mode 100644 index 0000000..1c90866 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_876.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_877.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_877.png new file mode 100644 index 0000000..181efda Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_877.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_878.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_878.png new file mode 100644 index 0000000..c983837 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_878.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_879.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_879.png new file mode 100644 index 0000000..ebe8514 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_879.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_88.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_88.png new file mode 100644 index 0000000..9114eaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_88.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_880.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_880.png new file mode 100644 index 0000000..b735168 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_880.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_881.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_881.png new file mode 100644 index 0000000..f020dce Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_881.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_882.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_882.png new file mode 100644 index 0000000..b24592f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_882.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_883.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_883.png new file mode 100644 index 0000000..9d55038 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_883.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_884.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_884.png new file mode 100644 index 0000000..cb09a4d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_884.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_885.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_885.png new file mode 100644 index 0000000..be3d609 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_885.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_886.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_886.png new file mode 100644 index 0000000..9fefff4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_886.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_887.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_887.png new file mode 100644 index 0000000..60b8545 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_887.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_888.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_888.png new file mode 100644 index 0000000..9eaa721 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_888.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_889.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_889.png new file mode 100644 index 0000000..a214823 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_889.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_89.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_89.png new file mode 100644 index 0000000..f15a2d7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_89.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_890.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_890.png new file mode 100644 index 0000000..9aca291 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_890.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_891.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_891.png new file mode 100644 index 0000000..1e49d4b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_891.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_892.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_892.png new file mode 100644 index 0000000..5002d3b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_892.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_893.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_893.png new file mode 100644 index 0000000..169c183 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_893.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_894.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_894.png new file mode 100644 index 0000000..3e38c1b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_894.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_895.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_895.png new file mode 100644 index 0000000..3886b23 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_895.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_896.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_896.png new file mode 100644 index 0000000..5b15b44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_896.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_897.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_897.png new file mode 100644 index 0000000..d45ba0c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_897.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_898.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_898.png new file mode 100644 index 0000000..583ab23 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_898.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_899.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_899.png new file mode 100644 index 0000000..b2bb5a4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_899.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_9.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_9.png new file mode 100644 index 0000000..afd0166 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_9.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_90.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_90.png new file mode 100644 index 0000000..15f27e2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_90.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_900.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_900.png new file mode 100644 index 0000000..fa307d9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_900.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_901.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_901.png new file mode 100644 index 0000000..ce95449 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_901.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_902.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_902.png new file mode 100644 index 0000000..bfdb2dc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_902.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_903.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_903.png new file mode 100644 index 0000000..06d44f2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_903.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_904.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_904.png new file mode 100644 index 0000000..b8eba75 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_904.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_905.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_905.png new file mode 100644 index 0000000..f86a592 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_905.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_906.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_906.png new file mode 100644 index 0000000..1edb4f0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_906.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_907.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_907.png new file mode 100644 index 0000000..6696494 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_907.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_908.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_908.png new file mode 100644 index 0000000..158a6e3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_908.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_909.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_909.png new file mode 100644 index 0000000..e0dfd63 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_909.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_91.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_91.png new file mode 100644 index 0000000..45e238a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_91.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_910.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_910.png new file mode 100644 index 0000000..c37bbb9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_910.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_911.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_911.png new file mode 100644 index 0000000..bb16c1c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_911.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_912.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_912.png new file mode 100644 index 0000000..81bd3cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_912.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_913.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_913.png new file mode 100644 index 0000000..319c8e3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_913.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_914.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_914.png new file mode 100644 index 0000000..1d6d347 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_914.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_915.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_915.png new file mode 100644 index 0000000..b353418 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_915.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_916.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_916.png new file mode 100644 index 0000000..979a680 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_916.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_917.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_917.png new file mode 100644 index 0000000..f972eee Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_917.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_918.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_918.png new file mode 100644 index 0000000..db5a190 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_918.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_919.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_919.png new file mode 100644 index 0000000..2dfcf2f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_919.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_92.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_92.png new file mode 100644 index 0000000..e31dcbd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_92.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_920.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_920.png new file mode 100644 index 0000000..b8a328e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_920.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_921.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_921.png new file mode 100644 index 0000000..550cfc6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_921.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_922.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_922.png new file mode 100644 index 0000000..c6e411a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_922.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_923.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_923.png new file mode 100644 index 0000000..049a948 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_923.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_924.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_924.png new file mode 100644 index 0000000..44324b5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_924.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_925.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_925.png new file mode 100644 index 0000000..c307573 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_925.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_926.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_926.png new file mode 100644 index 0000000..358706e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_926.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_927.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_927.png new file mode 100644 index 0000000..7a62be2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_927.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_928.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_928.png new file mode 100644 index 0000000..24ed967 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_928.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_929.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_929.png new file mode 100644 index 0000000..d3f2c58 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_929.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_93.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_93.png new file mode 100644 index 0000000..54d6de1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_93.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_930.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_930.png new file mode 100644 index 0000000..53487ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_930.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_931.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_931.png new file mode 100644 index 0000000..ebbc1c2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_931.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_932.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_932.png new file mode 100644 index 0000000..03de80f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_932.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_933.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_933.png new file mode 100644 index 0000000..0f1e8ec Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_933.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_934.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_934.png new file mode 100644 index 0000000..78f2e97 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_934.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_935.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_935.png new file mode 100644 index 0000000..d86bc0e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_935.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_936.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_936.png new file mode 100644 index 0000000..51b2cbf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_936.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_937.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_937.png new file mode 100644 index 0000000..9c34b25 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_937.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_938.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_938.png new file mode 100644 index 0000000..5a0a9e9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_938.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_939.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_939.png new file mode 100644 index 0000000..5c547fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_939.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_94.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_94.png new file mode 100644 index 0000000..120bb9e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_94.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_940.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_940.png new file mode 100644 index 0000000..d2c0288 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_940.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_941.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_941.png new file mode 100644 index 0000000..619ef13 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_941.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_942.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_942.png new file mode 100644 index 0000000..c36271b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_942.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_943.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_943.png new file mode 100644 index 0000000..8dc67d6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_943.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_944.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_944.png new file mode 100644 index 0000000..531fd0d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_944.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_945.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_945.png new file mode 100644 index 0000000..8a3dc4c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_945.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_946.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_946.png new file mode 100644 index 0000000..2e23148 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_946.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_947.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_947.png new file mode 100644 index 0000000..3ed8188 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_947.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_948.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_948.png new file mode 100644 index 0000000..fad1b99 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_948.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_949.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_949.png new file mode 100644 index 0000000..4940179 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_949.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_95.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_95.png new file mode 100644 index 0000000..3aa82a7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_95.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_950.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_950.png new file mode 100644 index 0000000..d9698c8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_950.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_951.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_951.png new file mode 100644 index 0000000..149fd73 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_951.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_952.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_952.png new file mode 100644 index 0000000..e9d6a8f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_952.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_953.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_953.png new file mode 100644 index 0000000..3317d2d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_953.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_954.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_954.png new file mode 100644 index 0000000..0c48fa6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_954.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_955.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_955.png new file mode 100644 index 0000000..51fe9ea Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_955.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_956.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_956.png new file mode 100644 index 0000000..ed6daf4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_956.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_957.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_957.png new file mode 100644 index 0000000..de4f673 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_957.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_958.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_958.png new file mode 100644 index 0000000..695d6bf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_958.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_959.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_959.png new file mode 100644 index 0000000..aa4ff17 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_959.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_96.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_96.png new file mode 100644 index 0000000..8f165e3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_96.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_960.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_960.png new file mode 100644 index 0000000..cddaeda Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_960.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_961.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_961.png new file mode 100644 index 0000000..1b82865 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_961.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_962.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_962.png new file mode 100644 index 0000000..247bd0b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_962.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_963.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_963.png new file mode 100644 index 0000000..ddcec8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_963.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_964.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_964.png new file mode 100644 index 0000000..73c8156 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_964.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_965.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_965.png new file mode 100644 index 0000000..ee21119 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_965.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_966.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_966.png new file mode 100644 index 0000000..f6c2519 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_966.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_967.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_967.png new file mode 100644 index 0000000..0908739 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_967.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_968.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_968.png new file mode 100644 index 0000000..1f78f60 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_968.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_969.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_969.png new file mode 100644 index 0000000..817d8fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_969.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_97.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_97.png new file mode 100644 index 0000000..b96519e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_97.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_970.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_970.png new file mode 100644 index 0000000..c50228e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_970.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_971.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_971.png new file mode 100644 index 0000000..16f9c10 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_971.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_972.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_972.png new file mode 100644 index 0000000..eee298f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_972.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_973.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_973.png new file mode 100644 index 0000000..592fb67 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_973.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_974.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_974.png new file mode 100644 index 0000000..36e391f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_974.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_975.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_975.png new file mode 100644 index 0000000..68ecc78 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_975.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_976.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_976.png new file mode 100644 index 0000000..0eb8493 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_976.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_977.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_977.png new file mode 100644 index 0000000..95334a1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_977.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_978.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_978.png new file mode 100644 index 0000000..517df69 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_978.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_979.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_979.png new file mode 100644 index 0000000..49eef41 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_979.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_98.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_98.png new file mode 100644 index 0000000..7b9e70e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_98.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_980.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_980.png new file mode 100644 index 0000000..47e7b3a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_980.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_981.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_981.png new file mode 100644 index 0000000..ccd829d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_981.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_982.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_982.png new file mode 100644 index 0000000..adf0ef2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_982.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_983.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_983.png new file mode 100644 index 0000000..61283f4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_983.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_984.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_984.png new file mode 100644 index 0000000..b73751c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_984.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_985.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_985.png new file mode 100644 index 0000000..75ba1ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_985.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_986.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_986.png new file mode 100644 index 0000000..d64a309 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_986.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_987.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_987.png new file mode 100644 index 0000000..5581516 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_987.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_988.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_988.png new file mode 100644 index 0000000..65b6eb6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_988.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_989.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_989.png new file mode 100644 index 0000000..b5969d5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_989.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_99.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_99.png new file mode 100644 index 0000000..2735848 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_99.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_990.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_990.png new file mode 100644 index 0000000..ce80e8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_990.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_991.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_991.png new file mode 100644 index 0000000..0db3ec1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_991.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_992.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_992.png new file mode 100644 index 0000000..5228b49 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_992.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_993.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_993.png new file mode 100644 index 0000000..f76ab63 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_993.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_994.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_994.png new file mode 100644 index 0000000..e415c1d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_994.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_995.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_995.png new file mode 100644 index 0000000..46af11f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_995.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_996.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_996.png new file mode 100644 index 0000000..1ff7ab0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_996.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_997.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_997.png new file mode 100644 index 0000000..c1b5c84 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_997.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_998.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_998.png new file mode 100644 index 0000000..ced9d6d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_998.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_999.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_999.png new file mode 100644 index 0000000..1012640 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/images/captcha_999.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_0.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_0.txt new file mode 100644 index 0000000..12beefe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_0.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_1.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_1.txt new file mode 100644 index 0000000..c054805 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_1.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_10.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_10.txt new file mode 100644 index 0000000..54b2eaa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_10.txt @@ -0,0 +1 @@ +0 0.35 0.271875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_100.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_100.txt new file mode 100644 index 0000000..699eba8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_100.txt @@ -0,0 +1 @@ +0 0.5346153846153846 0.521875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_1000.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_1000.txt new file mode 100644 index 0000000..5c61787 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_1000.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.540625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_101.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_101.txt new file mode 100644 index 0000000..ae5cb85 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_101.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_102.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_102.txt new file mode 100644 index 0000000..11a1663 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_102.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_103.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_103.txt new file mode 100644 index 0000000..2ed7cb7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_103.txt @@ -0,0 +1 @@ +0 0.5346153846153846 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_104.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_104.txt new file mode 100644 index 0000000..5c0b4f1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_104.txt @@ -0,0 +1 @@ +0 0.5557692307692308 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_105.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_105.txt new file mode 100644 index 0000000..46b1b89 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_105.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_106.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_106.txt new file mode 100644 index 0000000..9d0be29 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_106.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_107.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_107.txt new file mode 100644 index 0000000..51db49a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_107.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_108.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_108.txt new file mode 100644 index 0000000..6bbd89c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_108.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_109.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_109.txt new file mode 100644 index 0000000..8355674 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_109.txt @@ -0,0 +1 @@ +0 0.46923076923076923 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_11.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_11.txt new file mode 100644 index 0000000..3613a4f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_11.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_110.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_110.txt new file mode 100644 index 0000000..f4ecef8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_110.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.146875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_111.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_111.txt new file mode 100644 index 0000000..8bc2bf0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_111.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_112.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_112.txt new file mode 100644 index 0000000..60fb234 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_112.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.628125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_113.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_113.txt new file mode 100644 index 0000000..4a5718d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_113.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_114.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_114.txt new file mode 100644 index 0000000..50ff5f1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_114.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_115.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_115.txt new file mode 100644 index 0000000..520e716 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_115.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.54375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_116.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_116.txt new file mode 100644 index 0000000..3f9ca4d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_116.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.228125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_117.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_117.txt new file mode 100644 index 0000000..1f0b3f6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_117.txt @@ -0,0 +1 @@ +0 0.6230769230769231 0.18125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_118.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_118.txt new file mode 100644 index 0000000..a3154e5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_118.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_119.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_119.txt new file mode 100644 index 0000000..050a301 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_119.txt @@ -0,0 +1 @@ +0 0.6865384615384615 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_12.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_12.txt new file mode 100644 index 0000000..14a88cb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_12.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_120.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_120.txt new file mode 100644 index 0000000..c37f55a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_120.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.34375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_121.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_121.txt new file mode 100644 index 0000000..7d5e10d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_121.txt @@ -0,0 +1 @@ +0 0.5365384615384615 0.33125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_122.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_122.txt new file mode 100644 index 0000000..2022da2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_122.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_123.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_123.txt new file mode 100644 index 0000000..cd07f11 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_123.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_124.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_124.txt new file mode 100644 index 0000000..2971de1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_124.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_125.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_125.txt new file mode 100644 index 0000000..1f98d09 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_125.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.521875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_126.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_126.txt new file mode 100644 index 0000000..427dad6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_126.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_127.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_127.txt new file mode 100644 index 0000000..0653eb3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_127.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_128.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_128.txt new file mode 100644 index 0000000..c5a3689 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_128.txt @@ -0,0 +1 @@ +0 0.6711538461538461 0.209375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_129.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_129.txt new file mode 100644 index 0000000..5a07582 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_129.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.203125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_13.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_13.txt new file mode 100644 index 0000000..b870c20 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_13.txt @@ -0,0 +1 @@ +0 0.6057692307692307 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_130.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_130.txt new file mode 100644 index 0000000..4d930bf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_130.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.4625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_131.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_131.txt new file mode 100644 index 0000000..77dc521 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_131.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_132.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_132.txt new file mode 100644 index 0000000..75a88ff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_132.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_133.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_133.txt new file mode 100644 index 0000000..e8968e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_133.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.36875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_134.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_134.txt new file mode 100644 index 0000000..4971157 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_134.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_135.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_135.txt new file mode 100644 index 0000000..2744d7c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_135.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.546875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_136.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_136.txt new file mode 100644 index 0000000..faa5585 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_136.txt @@ -0,0 +1 @@ +0 0.4115384615384615 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_137.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_137.txt new file mode 100644 index 0000000..122fada --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_137.txt @@ -0,0 +1 @@ +0 0.5269230769230769 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_138.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_138.txt new file mode 100644 index 0000000..8efd0c6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_138.txt @@ -0,0 +1 @@ +0 0.676923076923077 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_139.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_139.txt new file mode 100644 index 0000000..9ce12c0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_139.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_14.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_14.txt new file mode 100644 index 0000000..844bd09 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_14.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_140.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_140.txt new file mode 100644 index 0000000..b1bf29d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_140.txt @@ -0,0 +1 @@ +0 0.4653846153846154 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_141.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_141.txt new file mode 100644 index 0000000..d14803d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_141.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.278125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_142.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_142.txt new file mode 100644 index 0000000..ecfa39a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_142.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_143.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_143.txt new file mode 100644 index 0000000..e595503 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_143.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.221875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_144.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_144.txt new file mode 100644 index 0000000..1a905d9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_144.txt @@ -0,0 +1 @@ +0 0.3596153846153846 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_145.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_145.txt new file mode 100644 index 0000000..7d11c71 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_145.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.221875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_146.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_146.txt new file mode 100644 index 0000000..08fe145 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_146.txt @@ -0,0 +1 @@ +0 0.325 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_147.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_147.txt new file mode 100644 index 0000000..aeb53ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_147.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_148.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_148.txt new file mode 100644 index 0000000..a95127e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_148.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.58125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_149.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_149.txt new file mode 100644 index 0000000..9ed089f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_149.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_15.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_15.txt new file mode 100644 index 0000000..1e93e01 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_15.txt @@ -0,0 +1 @@ +0 0.325 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_150.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_150.txt new file mode 100644 index 0000000..d591ff2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_150.txt @@ -0,0 +1 @@ +0 0.6538461538461539 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_151.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_151.txt new file mode 100644 index 0000000..cac71f2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_151.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_152.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_152.txt new file mode 100644 index 0000000..7088c08 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_152.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_153.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_153.txt new file mode 100644 index 0000000..db33103 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_153.txt @@ -0,0 +1 @@ +0 0.425 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_154.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_154.txt new file mode 100644 index 0000000..4fe5d65 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_154.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_155.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_155.txt new file mode 100644 index 0000000..39860fa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_155.txt @@ -0,0 +1 @@ +0 0.48653846153846153 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_156.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_156.txt new file mode 100644 index 0000000..ab94693 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_156.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_157.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_157.txt new file mode 100644 index 0000000..6771b35 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_157.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_158.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_158.txt new file mode 100644 index 0000000..0cf2e81 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_158.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_159.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_159.txt new file mode 100644 index 0000000..3547ada --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_159.txt @@ -0,0 +1 @@ +0 0.5346153846153846 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_16.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_16.txt new file mode 100644 index 0000000..9df1347 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_16.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.15 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_160.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_160.txt new file mode 100644 index 0000000..7061df8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_160.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.078125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_161.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_161.txt new file mode 100644 index 0000000..a702321 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_161.txt @@ -0,0 +1 @@ +0 0.625 0.190625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_162.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_162.txt new file mode 100644 index 0000000..dfab0d5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_162.txt @@ -0,0 +1 @@ +0 0.6653846153846154 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_163.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_163.txt new file mode 100644 index 0000000..93df56c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_163.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.571875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_164.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_164.txt new file mode 100644 index 0000000..9a3fe89 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_164.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_165.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_165.txt new file mode 100644 index 0000000..4beae6e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_165.txt @@ -0,0 +1 @@ +0 0.3769230769230769 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_166.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_166.txt new file mode 100644 index 0000000..4bae9f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_166.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_167.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_167.txt new file mode 100644 index 0000000..152de20 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_167.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_168.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_168.txt new file mode 100644 index 0000000..dcee446 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_168.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_169.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_169.txt new file mode 100644 index 0000000..5aa92c5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_169.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_17.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_17.txt new file mode 100644 index 0000000..f76dd9c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_17.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_170.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_170.txt new file mode 100644 index 0000000..2f188b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_170.txt @@ -0,0 +1 @@ +0 0.5807692307692308 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_171.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_171.txt new file mode 100644 index 0000000..9c17619 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_171.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_172.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_172.txt new file mode 100644 index 0000000..eb4b9a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_172.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_173.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_173.txt new file mode 100644 index 0000000..5f0919b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_173.txt @@ -0,0 +1 @@ +0 0.3096153846153846 0.43125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_174.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_174.txt new file mode 100644 index 0000000..e035bd7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_174.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_175.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_175.txt new file mode 100644 index 0000000..c464d2e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_175.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_176.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_176.txt new file mode 100644 index 0000000..75367c6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_176.txt @@ -0,0 +1 @@ +0 0.5788461538461539 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_177.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_177.txt new file mode 100644 index 0000000..59c5a49 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_177.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_178.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_178.txt new file mode 100644 index 0000000..6fbed4a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_178.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_179.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_179.txt new file mode 100644 index 0000000..8443f60 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_179.txt @@ -0,0 +1 @@ +0 0.4 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_18.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_18.txt new file mode 100644 index 0000000..5aaf59f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_18.txt @@ -0,0 +1 @@ +0 0.575 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_180.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_180.txt new file mode 100644 index 0000000..b716af3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_180.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.140625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_181.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_181.txt new file mode 100644 index 0000000..4ab791b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_181.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_182.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_182.txt new file mode 100644 index 0000000..a9180c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_182.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_183.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_183.txt new file mode 100644 index 0000000..6f874ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_183.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_184.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_184.txt new file mode 100644 index 0000000..dc5a7e7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_184.txt @@ -0,0 +1 @@ +0 0.5807692307692308 0.30625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_185.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_185.txt new file mode 100644 index 0000000..9f6e987 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_185.txt @@ -0,0 +1 @@ +0 0.4634615384615385 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_186.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_186.txt new file mode 100644 index 0000000..b55734a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_186.txt @@ -0,0 +1 @@ +0 0.45 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_187.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_187.txt new file mode 100644 index 0000000..e51ecb0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_187.txt @@ -0,0 +1 @@ +0 0.6923076923076923 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_188.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_188.txt new file mode 100644 index 0000000..8cc3dce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_188.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_189.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_189.txt new file mode 100644 index 0000000..56e8dc2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_189.txt @@ -0,0 +1 @@ +0 0.3269230769230769 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_19.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_19.txt new file mode 100644 index 0000000..a85467f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_19.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.56875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_190.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_190.txt new file mode 100644 index 0000000..c0c85e2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_190.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.415625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_191.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_191.txt new file mode 100644 index 0000000..8a1a386 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_191.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.565625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_192.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_192.txt new file mode 100644 index 0000000..f90e6a7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_192.txt @@ -0,0 +1 @@ +0 0.3153846153846154 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_193.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_193.txt new file mode 100644 index 0000000..36072de --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_193.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.55625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_194.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_194.txt new file mode 100644 index 0000000..118684c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_194.txt @@ -0,0 +1 @@ +0 0.6442307692307693 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_195.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_195.txt new file mode 100644 index 0000000..83ff8b5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_195.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_196.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_196.txt new file mode 100644 index 0000000..44e1f21 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_196.txt @@ -0,0 +1 @@ +0 0.49230769230769234 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_197.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_197.txt new file mode 100644 index 0000000..868004d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_197.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_198.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_198.txt new file mode 100644 index 0000000..96665d0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_198.txt @@ -0,0 +1 @@ +0 0.5192307692307693 0.44375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_199.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_199.txt new file mode 100644 index 0000000..61463f4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_199.txt @@ -0,0 +1 @@ +0 0.3153846153846154 0.446875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_2.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_2.txt new file mode 100644 index 0000000..c2672a3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_2.txt @@ -0,0 +1 @@ +0 0.4115384615384615 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_20.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_20.txt new file mode 100644 index 0000000..05deb62 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_20.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.2875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_200.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_200.txt new file mode 100644 index 0000000..7f61fb4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_200.txt @@ -0,0 +1 @@ +0 0.575 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_201.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_201.txt new file mode 100644 index 0000000..95da5a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_201.txt @@ -0,0 +1 @@ +0 0.6807692307692308 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_202.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_202.txt new file mode 100644 index 0000000..98257f3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_202.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_203.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_203.txt new file mode 100644 index 0000000..4bef2cd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_203.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_204.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_204.txt new file mode 100644 index 0000000..9ea86c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_204.txt @@ -0,0 +1 @@ +0 0.41923076923076924 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_205.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_205.txt new file mode 100644 index 0000000..5019a1a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_205.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_206.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_206.txt new file mode 100644 index 0000000..fc19620 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_206.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_207.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_207.txt new file mode 100644 index 0000000..24dad37 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_207.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_208.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_208.txt new file mode 100644 index 0000000..b8b464e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_208.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.634375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_209.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_209.txt new file mode 100644 index 0000000..f6733dc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_209.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.659375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_21.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_21.txt new file mode 100644 index 0000000..accb7df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_21.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.56875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_210.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_210.txt new file mode 100644 index 0000000..98e710c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_210.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_211.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_211.txt new file mode 100644 index 0000000..b7ae955 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_211.txt @@ -0,0 +1 @@ +0 0.5615384615384615 0.14375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_212.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_212.txt new file mode 100644 index 0000000..434702e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_212.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.390625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_213.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_213.txt new file mode 100644 index 0000000..fb9f9a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_213.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_214.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_214.txt new file mode 100644 index 0000000..f1a17ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_214.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.40625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_215.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_215.txt new file mode 100644 index 0000000..11b77ab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_215.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_216.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_216.txt new file mode 100644 index 0000000..11e83ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_216.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_217.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_217.txt new file mode 100644 index 0000000..ab6b152 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_217.txt @@ -0,0 +1 @@ +0 0.40384615384615385 0.571875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_218.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_218.txt new file mode 100644 index 0000000..73368e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_218.txt @@ -0,0 +1 @@ +0 0.5115384615384615 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_219.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_219.txt new file mode 100644 index 0000000..f810725 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_219.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_22.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_22.txt new file mode 100644 index 0000000..f7f3030 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_22.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.565625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_220.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_220.txt new file mode 100644 index 0000000..d73a539 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_220.txt @@ -0,0 +1 @@ +0 0.65 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_221.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_221.txt new file mode 100644 index 0000000..6a4c868 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_221.txt @@ -0,0 +1 @@ +0 0.6711538461538461 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_222.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_222.txt new file mode 100644 index 0000000..537f6da --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_222.txt @@ -0,0 +1 @@ +0 0.3153846153846154 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_223.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_223.txt new file mode 100644 index 0000000..9ed9a1e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_223.txt @@ -0,0 +1 @@ +0 0.3096153846153846 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_224.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_224.txt new file mode 100644 index 0000000..72e2c2a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_224.txt @@ -0,0 +1 @@ +0 0.6269230769230769 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_225.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_225.txt new file mode 100644 index 0000000..4955961 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_225.txt @@ -0,0 +1 @@ +0 0.5557692307692308 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_226.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_226.txt new file mode 100644 index 0000000..c219f6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_226.txt @@ -0,0 +1 @@ +0 0.6442307692307693 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_227.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_227.txt new file mode 100644 index 0000000..7a7709d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_227.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_228.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_228.txt new file mode 100644 index 0000000..8d6008a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_228.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.45 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_229.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_229.txt new file mode 100644 index 0000000..52aeab9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_229.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_23.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_23.txt new file mode 100644 index 0000000..37854fb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_23.txt @@ -0,0 +1 @@ +0 0.3730769230769231 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_230.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_230.txt new file mode 100644 index 0000000..b411f81 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_230.txt @@ -0,0 +1 @@ +0 0.3576923076923077 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_231.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_231.txt new file mode 100644 index 0000000..a8b1476 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_231.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_232.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_232.txt new file mode 100644 index 0000000..2b5782d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_232.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_233.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_233.txt new file mode 100644 index 0000000..0f490c0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_233.txt @@ -0,0 +1 @@ +0 0.55 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_234.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_234.txt new file mode 100644 index 0000000..03e5f54 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_234.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_235.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_235.txt new file mode 100644 index 0000000..d1f70cb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_235.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_236.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_236.txt new file mode 100644 index 0000000..41b038b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_236.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_237.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_237.txt new file mode 100644 index 0000000..53681a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_237.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.590625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_238.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_238.txt new file mode 100644 index 0000000..1de0029 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_238.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.415625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_239.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_239.txt new file mode 100644 index 0000000..b9de947 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_239.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_24.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_24.txt new file mode 100644 index 0000000..711358c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_24.txt @@ -0,0 +1 @@ +0 0.35 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_240.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_240.txt new file mode 100644 index 0000000..76501ca --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_240.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_241.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_241.txt new file mode 100644 index 0000000..98744ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_241.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_242.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_242.txt new file mode 100644 index 0000000..7f7231b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_242.txt @@ -0,0 +1 @@ +0 0.5019230769230769 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_243.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_243.txt new file mode 100644 index 0000000..4ffddce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_243.txt @@ -0,0 +1 @@ +0 0.525 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_244.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_244.txt new file mode 100644 index 0000000..79542f3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_244.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_245.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_245.txt new file mode 100644 index 0000000..0df73ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_245.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_246.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_246.txt new file mode 100644 index 0000000..f637261 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_246.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_247.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_247.txt new file mode 100644 index 0000000..b8224ab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_247.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_248.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_248.txt new file mode 100644 index 0000000..63e21b9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_248.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.565625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_249.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_249.txt new file mode 100644 index 0000000..fa22cdd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_249.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.578125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_25.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_25.txt new file mode 100644 index 0000000..c5deaca --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_25.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_250.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_250.txt new file mode 100644 index 0000000..ae714ce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_250.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.221875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_251.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_251.txt new file mode 100644 index 0000000..6ce886d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_251.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.378125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_252.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_252.txt new file mode 100644 index 0000000..8346e57 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_252.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_253.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_253.txt new file mode 100644 index 0000000..0bba845 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_253.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_254.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_254.txt new file mode 100644 index 0000000..e6f1b0b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_254.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.240625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_255.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_255.txt new file mode 100644 index 0000000..5f27c7f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_255.txt @@ -0,0 +1 @@ +0 0.48653846153846153 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_256.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_256.txt new file mode 100644 index 0000000..d28c02b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_256.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.34375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_257.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_257.txt new file mode 100644 index 0000000..5b9fff2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_257.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_258.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_258.txt new file mode 100644 index 0000000..5cca452 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_258.txt @@ -0,0 +1 @@ +0 0.475 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_259.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_259.txt new file mode 100644 index 0000000..c422330 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_259.txt @@ -0,0 +1 @@ +0 0.4230769230769231 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_26.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_26.txt new file mode 100644 index 0000000..4cd4185 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_26.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_260.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_260.txt new file mode 100644 index 0000000..5159af0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_260.txt @@ -0,0 +1 @@ +0 0.4673076923076923 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_261.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_261.txt new file mode 100644 index 0000000..92da60b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_261.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_262.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_262.txt new file mode 100644 index 0000000..02d55c7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_262.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_263.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_263.txt new file mode 100644 index 0000000..0c9f164 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_263.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_264.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_264.txt new file mode 100644 index 0000000..b9e6952 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_264.txt @@ -0,0 +1 @@ +0 0.475 0.140625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_265.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_265.txt new file mode 100644 index 0000000..10215ad --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_265.txt @@ -0,0 +1 @@ +0 0.45 0.525 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_266.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_266.txt new file mode 100644 index 0000000..7ab2a6b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_266.txt @@ -0,0 +1 @@ +0 0.6673076923076923 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_267.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_267.txt new file mode 100644 index 0000000..ba9a152 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_267.txt @@ -0,0 +1 @@ +0 0.35384615384615387 0.546875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_268.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_268.txt new file mode 100644 index 0000000..c139e9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_268.txt @@ -0,0 +1 @@ +0 0.48846153846153845 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_269.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_269.txt new file mode 100644 index 0000000..b54bc69 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_269.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.24375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_27.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_27.txt new file mode 100644 index 0000000..e45d28a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_27.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.628125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_270.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_270.txt new file mode 100644 index 0000000..7368fb8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_270.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_271.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_271.txt new file mode 100644 index 0000000..c4f80f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_271.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_272.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_272.txt new file mode 100644 index 0000000..657b5c6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_272.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.48125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_273.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_273.txt new file mode 100644 index 0000000..04eae6c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_273.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_274.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_274.txt new file mode 100644 index 0000000..1bf6af4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_274.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.4625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_275.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_275.txt new file mode 100644 index 0000000..e3b2a02 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_275.txt @@ -0,0 +1 @@ +0 0.6269230769230769 0.459375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_276.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_276.txt new file mode 100644 index 0000000..eab8ec0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_276.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_277.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_277.txt new file mode 100644 index 0000000..82c1143 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_277.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_278.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_278.txt new file mode 100644 index 0000000..0439508 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_278.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_279.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_279.txt new file mode 100644 index 0000000..7643b0d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_279.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_28.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_28.txt new file mode 100644 index 0000000..3ad369c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_28.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.390625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_280.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_280.txt new file mode 100644 index 0000000..4c8d4a9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_280.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_281.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_281.txt new file mode 100644 index 0000000..9b487aa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_281.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.6375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_282.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_282.txt new file mode 100644 index 0000000..4531e11 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_282.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_283.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_283.txt new file mode 100644 index 0000000..37c3ede --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_283.txt @@ -0,0 +1 @@ +0 0.575 0.640625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_284.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_284.txt new file mode 100644 index 0000000..7772f65 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_284.txt @@ -0,0 +1 @@ +0 0.6230769230769231 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_285.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_285.txt new file mode 100644 index 0000000..ef548be --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_285.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_286.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_286.txt new file mode 100644 index 0000000..3fde522 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_286.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.65 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_287.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_287.txt new file mode 100644 index 0000000..aff8654 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_287.txt @@ -0,0 +1 @@ +0 0.625 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_288.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_288.txt new file mode 100644 index 0000000..673e13b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_288.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_289.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_289.txt new file mode 100644 index 0000000..03cb0f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_289.txt @@ -0,0 +1 @@ +0 0.573076923076923 0.578125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_29.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_29.txt new file mode 100644 index 0000000..a6466b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_29.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_290.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_290.txt new file mode 100644 index 0000000..90d82a3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_290.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_291.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_291.txt new file mode 100644 index 0000000..ae1182f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_291.txt @@ -0,0 +1 @@ +0 0.3153846153846154 0.58125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_292.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_292.txt new file mode 100644 index 0000000..506aa6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_292.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.540625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_293.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_293.txt new file mode 100644 index 0000000..141195f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_293.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_294.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_294.txt new file mode 100644 index 0000000..9f989c9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_294.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_295.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_295.txt new file mode 100644 index 0000000..002800a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_295.txt @@ -0,0 +1 @@ +0 0.4346153846153846 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_296.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_296.txt new file mode 100644 index 0000000..300e61c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_296.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_297.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_297.txt new file mode 100644 index 0000000..81b79e0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_297.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_298.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_298.txt new file mode 100644 index 0000000..e826550 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_298.txt @@ -0,0 +1 @@ +0 0.6884615384615385 0.278125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_299.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_299.txt new file mode 100644 index 0000000..e2aca35 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_299.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_3.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_3.txt new file mode 100644 index 0000000..d470c30 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_3.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_30.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_30.txt new file mode 100644 index 0000000..da706ce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_30.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_300.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_300.txt new file mode 100644 index 0000000..a5b17d0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_300.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_301.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_301.txt new file mode 100644 index 0000000..1079851 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_301.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_302.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_302.txt new file mode 100644 index 0000000..ee77bfc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_302.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.30625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_303.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_303.txt new file mode 100644 index 0000000..b92df26 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_303.txt @@ -0,0 +1 @@ +0 0.5230769230769231 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_304.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_304.txt new file mode 100644 index 0000000..70813a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_304.txt @@ -0,0 +1 @@ +0 0.46923076923076923 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_305.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_305.txt new file mode 100644 index 0000000..1cc8b3f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_305.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.165625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_306.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_306.txt new file mode 100644 index 0000000..37c3ede --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_306.txt @@ -0,0 +1 @@ +0 0.575 0.640625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_307.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_307.txt new file mode 100644 index 0000000..9e212d7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_307.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_308.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_308.txt new file mode 100644 index 0000000..1550373 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_308.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_309.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_309.txt new file mode 100644 index 0000000..0c1f148 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_309.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_31.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_31.txt new file mode 100644 index 0000000..79792f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_31.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_310.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_310.txt new file mode 100644 index 0000000..f79a7af --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_310.txt @@ -0,0 +1 @@ +0 0.4096153846153846 0.63125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_311.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_311.txt new file mode 100644 index 0000000..25bd653 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_311.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_312.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_312.txt new file mode 100644 index 0000000..73bb1d3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_312.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.43125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_313.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_313.txt new file mode 100644 index 0000000..32ecaab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_313.txt @@ -0,0 +1 @@ +0 0.5192307692307693 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_314.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_314.txt new file mode 100644 index 0000000..ed3461b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_314.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_315.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_315.txt new file mode 100644 index 0000000..f9616fa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_315.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_316.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_316.txt new file mode 100644 index 0000000..d57d0a0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_316.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.365625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_317.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_317.txt new file mode 100644 index 0000000..5d12d3b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_317.txt @@ -0,0 +1 @@ +0 0.4634615384615385 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_318.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_318.txt new file mode 100644 index 0000000..844bd09 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_318.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_319.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_319.txt new file mode 100644 index 0000000..4b368ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_319.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_32.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_32.txt new file mode 100644 index 0000000..df9db74 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_32.txt @@ -0,0 +1 @@ +0 0.5615384615384615 0.521875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_320.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_320.txt new file mode 100644 index 0000000..eb95c53 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_320.txt @@ -0,0 +1 @@ +0 0.6923076923076923 0.271875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_321.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_321.txt new file mode 100644 index 0000000..70b066b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_321.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_322.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_322.txt new file mode 100644 index 0000000..4ef9fe9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_322.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_323.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_323.txt new file mode 100644 index 0000000..dab9016 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_323.txt @@ -0,0 +1 @@ +0 0.41923076923076924 0.68125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_324.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_324.txt new file mode 100644 index 0000000..3e25071 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_324.txt @@ -0,0 +1 @@ +0 0.6923076923076923 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_325.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_325.txt new file mode 100644 index 0000000..b83dde7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_325.txt @@ -0,0 +1 @@ +0 0.6 0.384375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_326.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_326.txt new file mode 100644 index 0000000..1d7c7b5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_326.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.54375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_327.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_327.txt new file mode 100644 index 0000000..41ff8df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_327.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.590625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_328.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_328.txt new file mode 100644 index 0000000..309b42c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_328.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_329.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_329.txt new file mode 100644 index 0000000..f12421b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_329.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_33.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_33.txt new file mode 100644 index 0000000..c5deaca --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_33.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_330.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_330.txt new file mode 100644 index 0000000..d786bc2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_330.txt @@ -0,0 +1 @@ +0 0.325 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_331.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_331.txt new file mode 100644 index 0000000..5ddfd65 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_331.txt @@ -0,0 +1 @@ +0 0.5 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_332.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_332.txt new file mode 100644 index 0000000..c924c58 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_332.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_333.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_333.txt new file mode 100644 index 0000000..d260eab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_333.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.446875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_334.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_334.txt new file mode 100644 index 0000000..a8f7cb6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_334.txt @@ -0,0 +1 @@ +0 0.35384615384615387 0.44375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_335.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_335.txt new file mode 100644 index 0000000..4c55d96 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_335.txt @@ -0,0 +1 @@ +0 0.5192307692307693 0.409375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_336.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_336.txt new file mode 100644 index 0000000..46b56a5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_336.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_337.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_337.txt new file mode 100644 index 0000000..189a66f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_337.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_338.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_338.txt new file mode 100644 index 0000000..9875178 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_338.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.634375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_339.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_339.txt new file mode 100644 index 0000000..c7d8886 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_339.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_34.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_34.txt new file mode 100644 index 0000000..565236e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_34.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_340.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_340.txt new file mode 100644 index 0000000..cb0d0e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_340.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_341.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_341.txt new file mode 100644 index 0000000..98b99c8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_341.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_342.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_342.txt new file mode 100644 index 0000000..2a3bba7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_342.txt @@ -0,0 +1 @@ +0 0.3269230769230769 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_343.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_343.txt new file mode 100644 index 0000000..f3467f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_343.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_344.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_344.txt new file mode 100644 index 0000000..bf174da --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_344.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_345.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_345.txt new file mode 100644 index 0000000..84d80c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_345.txt @@ -0,0 +1 @@ +0 0.45384615384615384 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_346.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_346.txt new file mode 100644 index 0000000..969e9bd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_346.txt @@ -0,0 +1 @@ +0 0.3576923076923077 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_347.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_347.txt new file mode 100644 index 0000000..ecdf74a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_347.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_348.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_348.txt new file mode 100644 index 0000000..c104351 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_348.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_349.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_349.txt new file mode 100644 index 0000000..875d657 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_349.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.434375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_35.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_35.txt new file mode 100644 index 0000000..0eaaff7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_35.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_350.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_350.txt new file mode 100644 index 0000000..06ddc7e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_350.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.4125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_351.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_351.txt new file mode 100644 index 0000000..00d5e31 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_351.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_352.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_352.txt new file mode 100644 index 0000000..eed5531 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_352.txt @@ -0,0 +1 @@ +0 0.6615384615384615 0.365625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_353.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_353.txt new file mode 100644 index 0000000..2a5df5e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_353.txt @@ -0,0 +1 @@ +0 0.5653846153846154 0.36875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_354.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_354.txt new file mode 100644 index 0000000..019b6f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_354.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_355.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_355.txt new file mode 100644 index 0000000..871056a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_355.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_356.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_356.txt new file mode 100644 index 0000000..73fb54a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_356.txt @@ -0,0 +1 @@ +0 0.3269230769230769 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_357.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_357.txt new file mode 100644 index 0000000..efa98ad --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_357.txt @@ -0,0 +1 @@ +0 0.5 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_358.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_358.txt new file mode 100644 index 0000000..55d13fc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_358.txt @@ -0,0 +1 @@ +0 0.6576923076923077 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_359.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_359.txt new file mode 100644 index 0000000..fca2498 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_359.txt @@ -0,0 +1 @@ +0 0.6538461538461539 0.303125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_36.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_36.txt new file mode 100644 index 0000000..fd36b9d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_36.txt @@ -0,0 +1 @@ +0 0.676923076923077 0.340625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_360.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_360.txt new file mode 100644 index 0000000..d824628 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_360.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_361.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_361.txt new file mode 100644 index 0000000..bcf6fda --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_361.txt @@ -0,0 +1 @@ +0 0.6596153846153846 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_362.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_362.txt new file mode 100644 index 0000000..1f19eaf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_362.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_363.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_363.txt new file mode 100644 index 0000000..6ace519 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_363.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_364.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_364.txt new file mode 100644 index 0000000..0698cf8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_364.txt @@ -0,0 +1 @@ +0 0.6057692307692307 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_365.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_365.txt new file mode 100644 index 0000000..af6d2a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_365.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.521875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_366.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_366.txt new file mode 100644 index 0000000..e547b79 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_366.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_367.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_367.txt new file mode 100644 index 0000000..0bf34fd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_367.txt @@ -0,0 +1 @@ +0 0.4346153846153846 0.54375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_368.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_368.txt new file mode 100644 index 0000000..076ada7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_368.txt @@ -0,0 +1 @@ +0 0.5269230769230769 0.540625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_369.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_369.txt new file mode 100644 index 0000000..187efd2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_369.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_37.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_37.txt new file mode 100644 index 0000000..e192d16 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_37.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_370.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_370.txt new file mode 100644 index 0000000..52b43b0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_370.txt @@ -0,0 +1 @@ +0 0.4096153846153846 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_371.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_371.txt new file mode 100644 index 0000000..4420e9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_371.txt @@ -0,0 +1 @@ +0 0.3576923076923077 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_372.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_372.txt new file mode 100644 index 0000000..3791163 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_372.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_373.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_373.txt new file mode 100644 index 0000000..146e650 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_373.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.60625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_374.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_374.txt new file mode 100644 index 0000000..276c682 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_374.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_375.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_375.txt new file mode 100644 index 0000000..29b2b97 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_375.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_376.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_376.txt new file mode 100644 index 0000000..67f7282 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_376.txt @@ -0,0 +1 @@ +0 0.551923076923077 0.4625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_377.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_377.txt new file mode 100644 index 0000000..9332c77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_377.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_378.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_378.txt new file mode 100644 index 0000000..7ff2a1b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_378.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_379.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_379.txt new file mode 100644 index 0000000..87e53f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_379.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.434375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_38.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_38.txt new file mode 100644 index 0000000..bace8b1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_38.txt @@ -0,0 +1 @@ +0 0.425 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_380.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_380.txt new file mode 100644 index 0000000..2f2ec60 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_380.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.578125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_381.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_381.txt new file mode 100644 index 0000000..1a4205f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_381.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_382.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_382.txt new file mode 100644 index 0000000..c386580 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_382.txt @@ -0,0 +1 @@ +0 0.575 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_383.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_383.txt new file mode 100644 index 0000000..c36959f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_383.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_384.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_384.txt new file mode 100644 index 0000000..1a7c094 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_384.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_385.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_385.txt new file mode 100644 index 0000000..b5f76e6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_385.txt @@ -0,0 +1 @@ +0 0.5134615384615384 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_386.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_386.txt new file mode 100644 index 0000000..f12421b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_386.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_387.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_387.txt new file mode 100644 index 0000000..3526530 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_387.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_388.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_388.txt new file mode 100644 index 0000000..f4c8eab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_388.txt @@ -0,0 +1 @@ +0 0.4673076923076923 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_389.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_389.txt new file mode 100644 index 0000000..9aea70c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_389.txt @@ -0,0 +1 @@ +0 0.575 0.28125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_39.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_39.txt new file mode 100644 index 0000000..0faaa15 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_39.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_390.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_390.txt new file mode 100644 index 0000000..2fcdc63 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_390.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.6375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_391.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_391.txt new file mode 100644 index 0000000..22ccd77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_391.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.365625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_392.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_392.txt new file mode 100644 index 0000000..dae9650 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_392.txt @@ -0,0 +1 @@ +0 0.5634615384615385 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_393.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_393.txt new file mode 100644 index 0000000..18e23f2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_393.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_394.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_394.txt new file mode 100644 index 0000000..06b8366 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_394.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_395.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_395.txt new file mode 100644 index 0000000..a8adc08 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_395.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_396.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_396.txt new file mode 100644 index 0000000..ae187e8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_396.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_397.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_397.txt new file mode 100644 index 0000000..ae2ed44 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_397.txt @@ -0,0 +1 @@ +0 0.6826923076923077 0.278125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_398.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_398.txt new file mode 100644 index 0000000..a8dd6b6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_398.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_399.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_399.txt new file mode 100644 index 0000000..56b31b5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_399.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_4.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_4.txt new file mode 100644 index 0000000..416b5cb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_4.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.390625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_40.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_40.txt new file mode 100644 index 0000000..334f385 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_40.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.240625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_400.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_400.txt new file mode 100644 index 0000000..05bc6fe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_400.txt @@ -0,0 +1 @@ +0 0.5615384615384615 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_401.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_401.txt new file mode 100644 index 0000000..1c512ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_401.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_402.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_402.txt new file mode 100644 index 0000000..d53205d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_402.txt @@ -0,0 +1 @@ +0 0.325 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_403.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_403.txt new file mode 100644 index 0000000..f033e7c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_403.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_404.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_404.txt new file mode 100644 index 0000000..cd7addf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_404.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_405.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_405.txt new file mode 100644 index 0000000..34ce950 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_405.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_406.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_406.txt new file mode 100644 index 0000000..5e33568 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_406.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_407.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_407.txt new file mode 100644 index 0000000..3a3ed5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_407.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_408.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_408.txt new file mode 100644 index 0000000..e81880e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_408.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.15 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_409.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_409.txt new file mode 100644 index 0000000..af5eaa4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_409.txt @@ -0,0 +1 @@ +0 0.5980769230769231 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_41.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_41.txt new file mode 100644 index 0000000..e5619b6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_41.txt @@ -0,0 +1 @@ +0 0.5461538461538461 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_410.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_410.txt new file mode 100644 index 0000000..f24dcec --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_410.txt @@ -0,0 +1 @@ +0 0.6346153846153846 0.33125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_411.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_411.txt new file mode 100644 index 0000000..71d06c5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_411.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_412.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_412.txt new file mode 100644 index 0000000..7af0ef9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_412.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_413.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_413.txt new file mode 100644 index 0000000..d8fb839 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_413.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_414.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_414.txt new file mode 100644 index 0000000..1ad44a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_414.txt @@ -0,0 +1 @@ +0 0.5634615384615385 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_415.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_415.txt new file mode 100644 index 0000000..6b042de --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_415.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_416.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_416.txt new file mode 100644 index 0000000..fa3285d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_416.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_417.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_417.txt new file mode 100644 index 0000000..409cf73 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_417.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_418.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_418.txt new file mode 100644 index 0000000..a03149f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_418.txt @@ -0,0 +1 @@ +0 0.3596153846153846 0.459375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_419.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_419.txt new file mode 100644 index 0000000..bb1d337 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_419.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_42.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_42.txt new file mode 100644 index 0000000..fe23d41 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_42.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_420.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_420.txt new file mode 100644 index 0000000..8432eb0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_420.txt @@ -0,0 +1 @@ +0 0.4346153846153846 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_421.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_421.txt new file mode 100644 index 0000000..a87bf60 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_421.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.65 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_422.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_422.txt new file mode 100644 index 0000000..abffae2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_422.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.1125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_423.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_423.txt new file mode 100644 index 0000000..dc5afa5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_423.txt @@ -0,0 +1 @@ +0 0.4307692307692308 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_424.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_424.txt new file mode 100644 index 0000000..a5838ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_424.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_425.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_425.txt new file mode 100644 index 0000000..3bfd9eb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_425.txt @@ -0,0 +1 @@ +0 0.4096153846153846 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_426.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_426.txt new file mode 100644 index 0000000..5a37dfc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_426.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.234375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_427.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_427.txt new file mode 100644 index 0000000..0dcbe78 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_427.txt @@ -0,0 +1 @@ +0 0.6 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_428.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_428.txt new file mode 100644 index 0000000..3ec7e33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_428.txt @@ -0,0 +1 @@ +0 0.5538461538461539 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_429.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_429.txt new file mode 100644 index 0000000..b3ec0c3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_429.txt @@ -0,0 +1 @@ +0 0.4634615384615385 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_43.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_43.txt new file mode 100644 index 0000000..ef9e295 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_43.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_430.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_430.txt new file mode 100644 index 0000000..572a01a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_430.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_431.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_431.txt new file mode 100644 index 0000000..fec7a36 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_431.txt @@ -0,0 +1 @@ +0 0.475 0.434375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_432.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_432.txt new file mode 100644 index 0000000..789240f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_432.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_433.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_433.txt new file mode 100644 index 0000000..43b8aff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_433.txt @@ -0,0 +1 @@ +0 0.6519230769230769 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_434.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_434.txt new file mode 100644 index 0000000..82e07fc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_434.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_435.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_435.txt new file mode 100644 index 0000000..1361397 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_435.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_436.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_436.txt new file mode 100644 index 0000000..1bec417 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_436.txt @@ -0,0 +1 @@ +0 0.6115384615384616 0.55 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_437.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_437.txt new file mode 100644 index 0000000..66529c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_437.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_438.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_438.txt new file mode 100644 index 0000000..a90d501 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_438.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.303125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_439.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_439.txt new file mode 100644 index 0000000..1cca387 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_439.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_44.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_44.txt new file mode 100644 index 0000000..fe9127a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_44.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_440.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_440.txt new file mode 100644 index 0000000..5647dfe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_440.txt @@ -0,0 +1 @@ +0 0.5288461538461539 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_441.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_441.txt new file mode 100644 index 0000000..69264eb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_441.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_442.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_442.txt new file mode 100644 index 0000000..9f796f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_442.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_443.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_443.txt new file mode 100644 index 0000000..cd1ed8c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_443.txt @@ -0,0 +1 @@ +0 0.6692307692307692 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_444.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_444.txt new file mode 100644 index 0000000..b92f51d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_444.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_445.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_445.txt new file mode 100644 index 0000000..a7122a0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_445.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.371875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_446.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_446.txt new file mode 100644 index 0000000..3056f8d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_446.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_447.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_447.txt new file mode 100644 index 0000000..c8fd7c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_447.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_448.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_448.txt new file mode 100644 index 0000000..42e7566 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_448.txt @@ -0,0 +1 @@ +0 0.5 0.340625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_449.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_449.txt new file mode 100644 index 0000000..d5f6e18 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_449.txt @@ -0,0 +1 @@ +0 0.6557692307692308 0.203125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_45.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_45.txt new file mode 100644 index 0000000..be27224 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_45.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_450.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_450.txt new file mode 100644 index 0000000..254b0fe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_450.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_451.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_451.txt new file mode 100644 index 0000000..3438ed1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_451.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_452.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_452.txt new file mode 100644 index 0000000..0f7caab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_452.txt @@ -0,0 +1 @@ +0 0.3423076923076923 0.578125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_453.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_453.txt new file mode 100644 index 0000000..64ce159 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_453.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_454.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_454.txt new file mode 100644 index 0000000..df14c97 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_454.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_455.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_455.txt new file mode 100644 index 0000000..20e81a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_455.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.63125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_456.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_456.txt new file mode 100644 index 0000000..c40cd35 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_456.txt @@ -0,0 +1 @@ +0 0.375 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_457.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_457.txt new file mode 100644 index 0000000..60d09f7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_457.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_458.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_458.txt new file mode 100644 index 0000000..33131a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_458.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.08125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_459.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_459.txt new file mode 100644 index 0000000..7c7b268 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_459.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_46.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_46.txt new file mode 100644 index 0000000..b135db0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_46.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_460.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_460.txt new file mode 100644 index 0000000..41a354f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_460.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_461.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_461.txt new file mode 100644 index 0000000..ff05970 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_461.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.65 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_462.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_462.txt new file mode 100644 index 0000000..f6f2bfa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_462.txt @@ -0,0 +1 @@ +0 0.5057692307692307 0.590625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_463.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_463.txt new file mode 100644 index 0000000..8b7f7ec --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_463.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.459375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_464.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_464.txt new file mode 100644 index 0000000..1dc6654 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_464.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_465.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_465.txt new file mode 100644 index 0000000..2b351fc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_465.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.165625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_466.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_466.txt new file mode 100644 index 0000000..3eee44a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_466.txt @@ -0,0 +1 @@ +0 0.573076923076923 0.421875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_467.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_467.txt new file mode 100644 index 0000000..30708d5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_467.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_468.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_468.txt new file mode 100644 index 0000000..f77b38c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_468.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.60625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_469.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_469.txt new file mode 100644 index 0000000..1867d9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_469.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_47.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_47.txt new file mode 100644 index 0000000..5fcdbce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_47.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_470.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_470.txt new file mode 100644 index 0000000..84c8011 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_470.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_471.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_471.txt new file mode 100644 index 0000000..2770aa5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_471.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_472.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_472.txt new file mode 100644 index 0000000..cb91346 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_472.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_473.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_473.txt new file mode 100644 index 0000000..7341d02 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_473.txt @@ -0,0 +1 @@ +0 0.625 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_474.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_474.txt new file mode 100644 index 0000000..78894a3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_474.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.33125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_475.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_475.txt new file mode 100644 index 0000000..961e3bd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_475.txt @@ -0,0 +1 @@ +0 0.3423076923076923 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_476.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_476.txt new file mode 100644 index 0000000..51cdb5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_476.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_477.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_477.txt new file mode 100644 index 0000000..a73edef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_477.txt @@ -0,0 +1 @@ +0 0.525 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_478.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_478.txt new file mode 100644 index 0000000..0bc673d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_478.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_479.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_479.txt new file mode 100644 index 0000000..7e9910a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_479.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.55625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_48.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_48.txt new file mode 100644 index 0000000..b1d93f2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_48.txt @@ -0,0 +1 @@ +0 0.45 0.409375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_480.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_480.txt new file mode 100644 index 0000000..1ece177 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_480.txt @@ -0,0 +1 @@ +0 0.47884615384615387 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_481.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_481.txt new file mode 100644 index 0000000..87e147f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_481.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_482.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_482.txt new file mode 100644 index 0000000..aee9ecf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_482.txt @@ -0,0 +1 @@ +0 0.6615384615384615 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_483.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_483.txt new file mode 100644 index 0000000..8d850af --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_483.txt @@ -0,0 +1 @@ +0 0.40384615384615385 0.43125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_484.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_484.txt new file mode 100644 index 0000000..55c0f3c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_484.txt @@ -0,0 +1 @@ +0 0.4 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_485.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_485.txt new file mode 100644 index 0000000..abdd3ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_485.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_486.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_486.txt new file mode 100644 index 0000000..093ac52 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_486.txt @@ -0,0 +1 @@ +0 0.4 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_487.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_487.txt new file mode 100644 index 0000000..b7286ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_487.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_488.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_488.txt new file mode 100644 index 0000000..6c03d22 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_488.txt @@ -0,0 +1 @@ +0 0.4346153846153846 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_489.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_489.txt new file mode 100644 index 0000000..d48661f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_489.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_49.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_49.txt new file mode 100644 index 0000000..7bf9900 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_49.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_490.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_490.txt new file mode 100644 index 0000000..1837efd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_490.txt @@ -0,0 +1 @@ +0 0.48846153846153845 0.675 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_491.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_491.txt new file mode 100644 index 0000000..e8cb6cb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_491.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.315625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_492.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_492.txt new file mode 100644 index 0000000..6190a04 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_492.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_493.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_493.txt new file mode 100644 index 0000000..7843909 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_493.txt @@ -0,0 +1 @@ +0 0.6826923076923077 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_494.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_494.txt new file mode 100644 index 0000000..fa1e00f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_494.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.421875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_495.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_495.txt new file mode 100644 index 0000000..8d6d7be --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_495.txt @@ -0,0 +1 @@ +0 0.3730769230769231 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_496.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_496.txt new file mode 100644 index 0000000..fd0eb1d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_496.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_497.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_497.txt new file mode 100644 index 0000000..df1813a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_497.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.3 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_498.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_498.txt new file mode 100644 index 0000000..0942858 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_498.txt @@ -0,0 +1 @@ +0 0.6442307692307693 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_499.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_499.txt new file mode 100644 index 0000000..161ae00 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_499.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_5.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_5.txt new file mode 100644 index 0000000..3a8ae19 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_5.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_50.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_50.txt new file mode 100644 index 0000000..9d82f33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_50.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.1 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_500.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_500.txt new file mode 100644 index 0000000..ecf503d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_500.txt @@ -0,0 +1 @@ +0 0.46923076923076923 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_501.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_501.txt new file mode 100644 index 0000000..8515f89 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_501.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_502.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_502.txt new file mode 100644 index 0000000..b4466ab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_502.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_503.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_503.txt new file mode 100644 index 0000000..90bd624 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_503.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.146875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_504.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_504.txt new file mode 100644 index 0000000..239b697 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_504.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_505.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_505.txt new file mode 100644 index 0000000..135e324 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_505.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.44375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_506.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_506.txt new file mode 100644 index 0000000..6cc4b69 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_506.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_507.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_507.txt new file mode 100644 index 0000000..77913c8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_507.txt @@ -0,0 +1 @@ +0 0.48653846153846153 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_508.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_508.txt new file mode 100644 index 0000000..ea9741d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_508.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_509.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_509.txt new file mode 100644 index 0000000..c1c46ab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_509.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_51.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_51.txt new file mode 100644 index 0000000..bae483b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_51.txt @@ -0,0 +1 @@ +0 0.5288461538461539 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_510.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_510.txt new file mode 100644 index 0000000..f580129 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_510.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_511.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_511.txt new file mode 100644 index 0000000..226409f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_511.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_512.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_512.txt new file mode 100644 index 0000000..979a15e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_512.txt @@ -0,0 +1 @@ +0 0.6653846153846154 0.1375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_513.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_513.txt new file mode 100644 index 0000000..09c6c41 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_513.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_514.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_514.txt new file mode 100644 index 0000000..4e00b1b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_514.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_515.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_515.txt new file mode 100644 index 0000000..1347cf2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_515.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_516.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_516.txt new file mode 100644 index 0000000..0d45ab4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_516.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_517.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_517.txt new file mode 100644 index 0000000..6a16ad1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_517.txt @@ -0,0 +1 @@ +0 0.325 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_518.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_518.txt new file mode 100644 index 0000000..009b920 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_518.txt @@ -0,0 +1 @@ +0 0.41346153846153844 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_519.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_519.txt new file mode 100644 index 0000000..4cbcc33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_519.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_52.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_52.txt new file mode 100644 index 0000000..04c2ed3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_52.txt @@ -0,0 +1 @@ +0 0.4096153846153846 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_520.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_520.txt new file mode 100644 index 0000000..1a14550 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_520.txt @@ -0,0 +1 @@ +0 0.6865384615384615 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_521.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_521.txt new file mode 100644 index 0000000..1281d69 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_521.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_522.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_522.txt new file mode 100644 index 0000000..9feb54d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_522.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.14375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_523.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_523.txt new file mode 100644 index 0000000..fb21c9a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_523.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_524.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_524.txt new file mode 100644 index 0000000..9625840 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_524.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_525.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_525.txt new file mode 100644 index 0000000..4be5e1b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_525.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_526.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_526.txt new file mode 100644 index 0000000..8ca6701 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_526.txt @@ -0,0 +1 @@ +0 0.675 0.565625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_527.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_527.txt new file mode 100644 index 0000000..8b9953d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_527.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_528.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_528.txt new file mode 100644 index 0000000..b18bc56 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_528.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.546875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_529.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_529.txt new file mode 100644 index 0000000..37ca185 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_529.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_53.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_53.txt new file mode 100644 index 0000000..bf3b4b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_53.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.084375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_530.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_530.txt new file mode 100644 index 0000000..f498815 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_530.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_531.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_531.txt new file mode 100644 index 0000000..93b2b5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_531.txt @@ -0,0 +1 @@ +0 0.48846153846153845 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_532.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_532.txt new file mode 100644 index 0000000..fc2f1f4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_532.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_533.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_533.txt new file mode 100644 index 0000000..a99f9f0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_533.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.378125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_534.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_534.txt new file mode 100644 index 0000000..95eb91c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_534.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_535.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_535.txt new file mode 100644 index 0000000..e6d6911 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_535.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.303125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_536.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_536.txt new file mode 100644 index 0000000..ae5fff5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_536.txt @@ -0,0 +1 @@ +0 0.6692307692307692 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_537.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_537.txt new file mode 100644 index 0000000..e7efa9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_537.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.11875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_538.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_538.txt new file mode 100644 index 0000000..8f2edd0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_538.txt @@ -0,0 +1 @@ +0 0.551923076923077 0.646875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_539.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_539.txt new file mode 100644 index 0000000..97ee822 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_539.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_54.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_54.txt new file mode 100644 index 0000000..7c940dc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_54.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.446875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_540.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_540.txt new file mode 100644 index 0000000..c74b068 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_540.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_541.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_541.txt new file mode 100644 index 0000000..57cddcc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_541.txt @@ -0,0 +1 @@ +0 0.5461538461538461 0.553125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_542.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_542.txt new file mode 100644 index 0000000..3e30cd7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_542.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_543.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_543.txt new file mode 100644 index 0000000..6059bc1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_543.txt @@ -0,0 +1 @@ +0 0.5134615384615384 0.55 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_544.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_544.txt new file mode 100644 index 0000000..cc9d46b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_544.txt @@ -0,0 +1 @@ +0 0.375 0.084375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_545.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_545.txt new file mode 100644 index 0000000..f2641c2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_545.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_546.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_546.txt new file mode 100644 index 0000000..a5bd0d9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_546.txt @@ -0,0 +1 @@ +0 0.5019230769230769 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_547.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_547.txt new file mode 100644 index 0000000..1fd915a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_547.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_548.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_548.txt new file mode 100644 index 0000000..60d65b4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_548.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_549.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_549.txt new file mode 100644 index 0000000..9b17ba9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_549.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.240625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_55.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_55.txt new file mode 100644 index 0000000..b8159d6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_55.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_550.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_550.txt new file mode 100644 index 0000000..3a70233 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_550.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.384375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_551.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_551.txt new file mode 100644 index 0000000..c076861 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_551.txt @@ -0,0 +1 @@ +0 0.6673076923076923 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_552.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_552.txt new file mode 100644 index 0000000..702b490 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_552.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_553.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_553.txt new file mode 100644 index 0000000..87c6aec --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_553.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_554.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_554.txt new file mode 100644 index 0000000..4361932 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_554.txt @@ -0,0 +1 @@ +0 0.4230769230769231 0.63125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_555.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_555.txt new file mode 100644 index 0000000..b52465a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_555.txt @@ -0,0 +1 @@ +0 0.5538461538461539 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_556.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_556.txt new file mode 100644 index 0000000..e63fe04 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_556.txt @@ -0,0 +1 @@ +0 0.325 0.34375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_557.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_557.txt new file mode 100644 index 0000000..bdb2066 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_557.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_558.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_558.txt new file mode 100644 index 0000000..5722c59 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_558.txt @@ -0,0 +1 @@ +0 0.5365384615384615 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_559.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_559.txt new file mode 100644 index 0000000..7bc9e40 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_559.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_56.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_56.txt new file mode 100644 index 0000000..59e6b3b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_56.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_560.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_560.txt new file mode 100644 index 0000000..715aabe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_560.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.1125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_561.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_561.txt new file mode 100644 index 0000000..e196846 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_561.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_562.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_562.txt new file mode 100644 index 0000000..1bc81bb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_562.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_563.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_563.txt new file mode 100644 index 0000000..44bba2d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_563.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.228125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_564.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_564.txt new file mode 100644 index 0000000..87a7643 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_564.txt @@ -0,0 +1 @@ +0 0.5365384615384615 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_565.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_565.txt new file mode 100644 index 0000000..9fec86b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_565.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_566.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_566.txt new file mode 100644 index 0000000..2ae336b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_566.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_567.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_567.txt new file mode 100644 index 0000000..48f9cfa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_567.txt @@ -0,0 +1 @@ +0 0.6115384615384616 0.234375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_568.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_568.txt new file mode 100644 index 0000000..3b252ec --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_568.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_569.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_569.txt new file mode 100644 index 0000000..417a777 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_569.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_57.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_57.txt new file mode 100644 index 0000000..9daab33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_57.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.365625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_570.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_570.txt new file mode 100644 index 0000000..1651e6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_570.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_571.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_571.txt new file mode 100644 index 0000000..8806452 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_571.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_572.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_572.txt new file mode 100644 index 0000000..f0f2cc4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_572.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_573.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_573.txt new file mode 100644 index 0000000..194fa16 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_573.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_574.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_574.txt new file mode 100644 index 0000000..0d1627f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_574.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_575.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_575.txt new file mode 100644 index 0000000..1991135 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_575.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_576.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_576.txt new file mode 100644 index 0000000..ad609ac --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_576.txt @@ -0,0 +1 @@ +0 0.41923076923076924 0.071875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_577.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_577.txt new file mode 100644 index 0000000..8e2ea9c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_577.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_578.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_578.txt new file mode 100644 index 0000000..eb892d9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_578.txt @@ -0,0 +1 @@ +0 0.41923076923076924 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_579.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_579.txt new file mode 100644 index 0000000..bf9bec7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_579.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_58.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_58.txt new file mode 100644 index 0000000..5044287 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_58.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_580.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_580.txt new file mode 100644 index 0000000..01ca7e7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_580.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_581.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_581.txt new file mode 100644 index 0000000..f85437f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_581.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.378125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_582.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_582.txt new file mode 100644 index 0000000..f6a1836 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_582.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_583.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_583.txt new file mode 100644 index 0000000..52ed8ca --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_583.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_584.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_584.txt new file mode 100644 index 0000000..0546360 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_584.txt @@ -0,0 +1 @@ +0 0.6115384615384616 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_585.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_585.txt new file mode 100644 index 0000000..8fb557d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_585.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_586.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_586.txt new file mode 100644 index 0000000..5022d3a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_586.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_587.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_587.txt new file mode 100644 index 0000000..bc32b2a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_587.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_588.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_588.txt new file mode 100644 index 0000000..b31a3ee --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_588.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.384375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_589.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_589.txt new file mode 100644 index 0000000..5313457 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_589.txt @@ -0,0 +1 @@ +0 0.4288461538461538 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_59.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_59.txt new file mode 100644 index 0000000..25dc4df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_59.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_590.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_590.txt new file mode 100644 index 0000000..7a6fb82 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_590.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_591.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_591.txt new file mode 100644 index 0000000..72dd2ff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_591.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_592.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_592.txt new file mode 100644 index 0000000..494e283 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_592.txt @@ -0,0 +1 @@ +0 0.6807692307692308 0.071875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_593.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_593.txt new file mode 100644 index 0000000..23055f1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_593.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_594.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_594.txt new file mode 100644 index 0000000..db8d99f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_594.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_595.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_595.txt new file mode 100644 index 0000000..d6383f2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_595.txt @@ -0,0 +1 @@ +0 0.4653846153846154 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_596.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_596.txt new file mode 100644 index 0000000..9afbacc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_596.txt @@ -0,0 +1 @@ +0 0.5288461538461539 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_597.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_597.txt new file mode 100644 index 0000000..941f6f7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_597.txt @@ -0,0 +1 @@ +0 0.3423076923076923 0.553125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_598.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_598.txt new file mode 100644 index 0000000..9325358 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_598.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_599.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_599.txt new file mode 100644 index 0000000..fad5383 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_599.txt @@ -0,0 +1 @@ +0 0.5153846153846153 0.1125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_6.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_6.txt new file mode 100644 index 0000000..1bc9c5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_6.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_60.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_60.txt new file mode 100644 index 0000000..1ce4452 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_60.txt @@ -0,0 +1 @@ +0 0.35 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_600.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_600.txt new file mode 100644 index 0000000..f00f3eb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_600.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.1 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_601.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_601.txt new file mode 100644 index 0000000..1e7ceda --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_601.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_602.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_602.txt new file mode 100644 index 0000000..7277950 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_602.txt @@ -0,0 +1 @@ +0 0.425 0.65 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_603.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_603.txt new file mode 100644 index 0000000..e98bbb5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_603.txt @@ -0,0 +1 @@ +0 0.45384615384615384 0.34375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_604.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_604.txt new file mode 100644 index 0000000..37fbe35 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_604.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.146875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_605.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_605.txt new file mode 100644 index 0000000..1d22910 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_605.txt @@ -0,0 +1 @@ +0 0.5615384615384615 0.640625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_606.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_606.txt new file mode 100644 index 0000000..6af410c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_606.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_607.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_607.txt new file mode 100644 index 0000000..779cba3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_607.txt @@ -0,0 +1 @@ +0 0.6038461538461538 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_608.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_608.txt new file mode 100644 index 0000000..6f6ac6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_608.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_609.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_609.txt new file mode 100644 index 0000000..e0bc4e6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_609.txt @@ -0,0 +1 @@ +0 0.5538461538461539 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_61.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_61.txt new file mode 100644 index 0000000..a4ea8a7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_61.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_610.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_610.txt new file mode 100644 index 0000000..c513175 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_610.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_611.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_611.txt new file mode 100644 index 0000000..2959c58 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_611.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_612.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_612.txt new file mode 100644 index 0000000..182f227 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_612.txt @@ -0,0 +1 @@ +0 0.49038461538461536 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_613.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_613.txt new file mode 100644 index 0000000..d540b76 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_613.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_614.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_614.txt new file mode 100644 index 0000000..a70d39b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_614.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_615.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_615.txt new file mode 100644 index 0000000..53c1c15 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_615.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_616.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_616.txt new file mode 100644 index 0000000..5456c39 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_616.txt @@ -0,0 +1 @@ +0 0.5269230769230769 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_617.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_617.txt new file mode 100644 index 0000000..263feb9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_617.txt @@ -0,0 +1 @@ +0 0.5788461538461539 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_618.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_618.txt new file mode 100644 index 0000000..30d9d0c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_618.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.646875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_619.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_619.txt new file mode 100644 index 0000000..117a6db --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_619.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_62.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_62.txt new file mode 100644 index 0000000..beae879 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_62.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.11875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_620.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_620.txt new file mode 100644 index 0000000..769dfb3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_620.txt @@ -0,0 +1 @@ +0 0.36923076923076925 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_621.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_621.txt new file mode 100644 index 0000000..1fc0e75 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_621.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_622.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_622.txt new file mode 100644 index 0000000..8e992d4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_622.txt @@ -0,0 +1 @@ +0 0.575 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_623.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_623.txt new file mode 100644 index 0000000..b16cf00 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_623.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_624.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_624.txt new file mode 100644 index 0000000..71cd109 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_624.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_625.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_625.txt new file mode 100644 index 0000000..aa9a21c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_625.txt @@ -0,0 +1 @@ +0 0.5115384615384615 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_626.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_626.txt new file mode 100644 index 0000000..ca9365a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_626.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.371875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_627.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_627.txt new file mode 100644 index 0000000..6b8ef12 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_627.txt @@ -0,0 +1 @@ +0 0.6269230769230769 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_628.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_628.txt new file mode 100644 index 0000000..8412441 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_628.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_629.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_629.txt new file mode 100644 index 0000000..4469a47 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_629.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_63.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_63.txt new file mode 100644 index 0000000..644542e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_63.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_630.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_630.txt new file mode 100644 index 0000000..ae2804e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_630.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_631.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_631.txt new file mode 100644 index 0000000..a5d6e96 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_631.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_632.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_632.txt new file mode 100644 index 0000000..5f7f7c2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_632.txt @@ -0,0 +1 @@ +0 0.5980769230769231 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_633.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_633.txt new file mode 100644 index 0000000..09e8348 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_633.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_634.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_634.txt new file mode 100644 index 0000000..681116c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_634.txt @@ -0,0 +1 @@ +0 0.48846153846153845 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_635.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_635.txt new file mode 100644 index 0000000..eab5110 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_635.txt @@ -0,0 +1 @@ +0 0.5153846153846153 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_636.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_636.txt new file mode 100644 index 0000000..9af966a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_636.txt @@ -0,0 +1 @@ +0 0.6692307692307692 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_637.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_637.txt new file mode 100644 index 0000000..9e5da93 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_637.txt @@ -0,0 +1 @@ +0 0.6711538461538461 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_638.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_638.txt new file mode 100644 index 0000000..55fa9a2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_638.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_639.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_639.txt new file mode 100644 index 0000000..9dbdd55 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_639.txt @@ -0,0 +1 @@ +0 0.6538461538461539 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_64.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_64.txt new file mode 100644 index 0000000..2af9dae --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_64.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_640.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_640.txt new file mode 100644 index 0000000..b32aa7a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_640.txt @@ -0,0 +1 @@ +0 0.3769230769230769 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_641.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_641.txt new file mode 100644 index 0000000..aea91df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_641.txt @@ -0,0 +1 @@ +0 0.6692307692307692 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_642.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_642.txt new file mode 100644 index 0000000..35993d3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_642.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.1 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_643.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_643.txt new file mode 100644 index 0000000..3828a85 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_643.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_644.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_644.txt new file mode 100644 index 0000000..e983517 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_644.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.08125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_645.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_645.txt new file mode 100644 index 0000000..2a5f9a5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_645.txt @@ -0,0 +1 @@ +0 0.47884615384615387 0.209375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_646.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_646.txt new file mode 100644 index 0000000..8cefa9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_646.txt @@ -0,0 +1 @@ +0 0.6865384615384615 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_647.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_647.txt new file mode 100644 index 0000000..77ca2ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_647.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.45 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_648.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_648.txt new file mode 100644 index 0000000..00aef56 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_648.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_649.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_649.txt new file mode 100644 index 0000000..ca38b72 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_649.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.090625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_65.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_65.txt new file mode 100644 index 0000000..751a9e9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_65.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.25 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_650.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_650.txt new file mode 100644 index 0000000..2936051 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_650.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_651.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_651.txt new file mode 100644 index 0000000..6a5dc26 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_651.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_652.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_652.txt new file mode 100644 index 0000000..4d18f33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_652.txt @@ -0,0 +1 @@ +0 0.676923076923077 0.446875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_653.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_653.txt new file mode 100644 index 0000000..e3d499f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_653.txt @@ -0,0 +1 @@ +0 0.49038461538461536 0.4125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_654.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_654.txt new file mode 100644 index 0000000..d1b66b2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_654.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.409375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_655.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_655.txt new file mode 100644 index 0000000..8be6668 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_655.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_656.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_656.txt new file mode 100644 index 0000000..af7775d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_656.txt @@ -0,0 +1 @@ +0 0.6826923076923077 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_657.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_657.txt new file mode 100644 index 0000000..03a934f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_657.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_658.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_658.txt new file mode 100644 index 0000000..0dfc4bb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_658.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.109375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_659.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_659.txt new file mode 100644 index 0000000..fa3285d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_659.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_66.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_66.txt new file mode 100644 index 0000000..a049d58 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_66.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_660.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_660.txt new file mode 100644 index 0000000..c7a4551 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_660.txt @@ -0,0 +1 @@ +0 0.4288461538461538 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_661.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_661.txt new file mode 100644 index 0000000..75d5d77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_661.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_662.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_662.txt new file mode 100644 index 0000000..cc6da53 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_662.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.14375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_663.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_663.txt new file mode 100644 index 0000000..6860283 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_663.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_664.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_664.txt new file mode 100644 index 0000000..cf3e1f7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_664.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_665.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_665.txt new file mode 100644 index 0000000..87c433b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_665.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.08125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_666.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_666.txt new file mode 100644 index 0000000..c991a7c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_666.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_667.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_667.txt new file mode 100644 index 0000000..1e28f48 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_667.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_668.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_668.txt new file mode 100644 index 0000000..3b2fd34 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_668.txt @@ -0,0 +1 @@ +0 0.5653846153846154 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_669.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_669.txt new file mode 100644 index 0000000..e00f00e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_669.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_67.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_67.txt new file mode 100644 index 0000000..380aaa5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_67.txt @@ -0,0 +1 @@ +0 0.35 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_670.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_670.txt new file mode 100644 index 0000000..c2d412c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_670.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_671.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_671.txt new file mode 100644 index 0000000..0346b11 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_671.txt @@ -0,0 +1 @@ +0 0.5 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_672.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_672.txt new file mode 100644 index 0000000..acfa65e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_672.txt @@ -0,0 +1 @@ +0 0.6038461538461538 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_673.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_673.txt new file mode 100644 index 0000000..bc7ab5f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_673.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_674.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_674.txt new file mode 100644 index 0000000..d4e666b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_674.txt @@ -0,0 +1 @@ +0 0.5134615384615384 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_675.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_675.txt new file mode 100644 index 0000000..9ec5c69 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_675.txt @@ -0,0 +1 @@ +0 0.6519230769230769 0.15 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_676.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_676.txt new file mode 100644 index 0000000..9332c77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_676.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_677.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_677.txt new file mode 100644 index 0000000..c5c908b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_677.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_678.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_678.txt new file mode 100644 index 0000000..690a984 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_678.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_679.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_679.txt new file mode 100644 index 0000000..7ff63f0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_679.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_68.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_68.txt new file mode 100644 index 0000000..e49d5ee --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_68.txt @@ -0,0 +1 @@ +0 0.5115384615384615 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_680.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_680.txt new file mode 100644 index 0000000..050d22e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_680.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_681.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_681.txt new file mode 100644 index 0000000..64dc952 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_681.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_682.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_682.txt new file mode 100644 index 0000000..fa99e5e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_682.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.4375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_683.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_683.txt new file mode 100644 index 0000000..07ba98c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_683.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.33125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_684.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_684.txt new file mode 100644 index 0000000..b75f04d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_684.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_685.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_685.txt new file mode 100644 index 0000000..53dd16a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_685.txt @@ -0,0 +1 @@ +0 0.6576923076923077 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_686.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_686.txt new file mode 100644 index 0000000..dd3d623 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_686.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_687.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_687.txt new file mode 100644 index 0000000..93711d6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_687.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_688.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_688.txt new file mode 100644 index 0000000..5b9c6b5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_688.txt @@ -0,0 +1 @@ +0 0.6653846153846154 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_689.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_689.txt new file mode 100644 index 0000000..42f057a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_689.txt @@ -0,0 +1 @@ +0 0.35 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_69.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_69.txt new file mode 100644 index 0000000..b8dea74 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_69.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.4125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_690.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_690.txt new file mode 100644 index 0000000..1420fdc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_690.txt @@ -0,0 +1 @@ +0 0.6884615384615385 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_691.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_691.txt new file mode 100644 index 0000000..85cdb8d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_691.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.55625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_692.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_692.txt new file mode 100644 index 0000000..354e8c3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_692.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_693.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_693.txt new file mode 100644 index 0000000..90905cd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_693.txt @@ -0,0 +1 @@ +0 0.36923076923076925 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_694.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_694.txt new file mode 100644 index 0000000..4fd98ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_694.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_695.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_695.txt new file mode 100644 index 0000000..f799b68 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_695.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.1375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_696.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_696.txt new file mode 100644 index 0000000..7590d4d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_696.txt @@ -0,0 +1 @@ +0 0.47884615384615387 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_697.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_697.txt new file mode 100644 index 0000000..74e8554 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_697.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.40625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_698.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_698.txt new file mode 100644 index 0000000..62b35f9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_698.txt @@ -0,0 +1 @@ +0 0.425 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_699.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_699.txt new file mode 100644 index 0000000..dbf2e34 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_699.txt @@ -0,0 +1 @@ +0 0.5057692307692307 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_7.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_7.txt new file mode 100644 index 0000000..403b1ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_7.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_70.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_70.txt new file mode 100644 index 0000000..fb2ed00 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_70.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_700.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_700.txt new file mode 100644 index 0000000..d077071 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_700.txt @@ -0,0 +1 @@ +0 0.575 0.41875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_701.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_701.txt new file mode 100644 index 0000000..37ca185 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_701.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_702.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_702.txt new file mode 100644 index 0000000..e2d73c9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_702.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.228125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_703.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_703.txt new file mode 100644 index 0000000..8b1497b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_703.txt @@ -0,0 +1 @@ +0 0.6576923076923077 0.221875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_704.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_704.txt new file mode 100644 index 0000000..ed6a265 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_704.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.55625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_705.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_705.txt new file mode 100644 index 0000000..c172b52 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_705.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_706.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_706.txt new file mode 100644 index 0000000..8556242 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_706.txt @@ -0,0 +1 @@ +0 0.6884615384615385 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_707.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_707.txt new file mode 100644 index 0000000..eb39e9c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_707.txt @@ -0,0 +1 @@ +0 0.6538461538461539 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_708.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_708.txt new file mode 100644 index 0000000..34e2920 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_708.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_709.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_709.txt new file mode 100644 index 0000000..286debd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_709.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_71.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_71.txt new file mode 100644 index 0000000..be6e1ce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_71.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_710.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_710.txt new file mode 100644 index 0000000..81439bc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_710.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.278125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_711.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_711.txt new file mode 100644 index 0000000..04c0ae9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_711.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_712.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_712.txt new file mode 100644 index 0000000..924a037 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_712.txt @@ -0,0 +1 @@ +0 0.6192307692307693 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_713.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_713.txt new file mode 100644 index 0000000..00c39d7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_713.txt @@ -0,0 +1 @@ +0 0.4230769230769231 0.60625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_714.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_714.txt new file mode 100644 index 0000000..cc16757 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_714.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_715.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_715.txt new file mode 100644 index 0000000..064bab6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_715.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.6 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_716.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_716.txt new file mode 100644 index 0000000..7ab2770 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_716.txt @@ -0,0 +1 @@ +0 0.6519230769230769 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_717.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_717.txt new file mode 100644 index 0000000..f7bb6de --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_717.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_718.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_718.txt new file mode 100644 index 0000000..c4b40ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_718.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.071875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_719.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_719.txt new file mode 100644 index 0000000..4d0122a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_719.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_72.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_72.txt new file mode 100644 index 0000000..8cbe82a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_72.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_720.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_720.txt new file mode 100644 index 0000000..8d54a42 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_720.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_721.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_721.txt new file mode 100644 index 0000000..526ef6e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_721.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_722.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_722.txt new file mode 100644 index 0000000..9196bb5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_722.txt @@ -0,0 +1 @@ +0 0.5634615384615385 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_723.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_723.txt new file mode 100644 index 0000000..fadf546 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_723.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_724.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_724.txt new file mode 100644 index 0000000..7f6ffbe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_724.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_725.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_725.txt new file mode 100644 index 0000000..86c2f4a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_725.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_726.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_726.txt new file mode 100644 index 0000000..f8f0b37 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_726.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.078125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_727.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_727.txt new file mode 100644 index 0000000..1721f4a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_727.txt @@ -0,0 +1 @@ +0 0.4307692307692308 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_728.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_728.txt new file mode 100644 index 0000000..560fdfe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_728.txt @@ -0,0 +1 @@ +0 0.3269230769230769 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_729.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_729.txt new file mode 100644 index 0000000..d612fb2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_729.txt @@ -0,0 +1 @@ +0 0.375 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_73.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_73.txt new file mode 100644 index 0000000..946ca93 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_73.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_730.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_730.txt new file mode 100644 index 0000000..c836be8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_730.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_731.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_731.txt new file mode 100644 index 0000000..c386580 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_731.txt @@ -0,0 +1 @@ +0 0.575 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_732.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_732.txt new file mode 100644 index 0000000..5151bd4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_732.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_733.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_733.txt new file mode 100644 index 0000000..469abf0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_733.txt @@ -0,0 +1 @@ +0 0.5653846153846154 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_734.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_734.txt new file mode 100644 index 0000000..e914a92 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_734.txt @@ -0,0 +1 @@ +0 0.6442307692307693 0.11875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_735.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_735.txt new file mode 100644 index 0000000..770057e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_735.txt @@ -0,0 +1 @@ +0 0.5 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_736.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_736.txt new file mode 100644 index 0000000..b581e62 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_736.txt @@ -0,0 +1 @@ +0 0.6596153846153846 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_737.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_737.txt new file mode 100644 index 0000000..86baa6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_737.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.190625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_738.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_738.txt new file mode 100644 index 0000000..33eef5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_738.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_739.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_739.txt new file mode 100644 index 0000000..4ab4aff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_739.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_74.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_74.txt new file mode 100644 index 0000000..68708f0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_74.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_740.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_740.txt new file mode 100644 index 0000000..abdd3ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_740.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_741.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_741.txt new file mode 100644 index 0000000..3a0258d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_741.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_742.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_742.txt new file mode 100644 index 0000000..8b3caaa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_742.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_743.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_743.txt new file mode 100644 index 0000000..f8946a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_743.txt @@ -0,0 +1 @@ +0 0.5 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_744.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_744.txt new file mode 100644 index 0000000..65a47a0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_744.txt @@ -0,0 +1 @@ +0 0.45 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_745.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_745.txt new file mode 100644 index 0000000..6c11ca8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_745.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_746.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_746.txt new file mode 100644 index 0000000..af09141 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_746.txt @@ -0,0 +1 @@ +0 0.3769230769230769 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_747.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_747.txt new file mode 100644 index 0000000..2e0c7a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_747.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_748.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_748.txt new file mode 100644 index 0000000..388d2e2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_748.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_749.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_749.txt new file mode 100644 index 0000000..0b5aca9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_749.txt @@ -0,0 +1 @@ +0 0.6384615384615384 0.25 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_75.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_75.txt new file mode 100644 index 0000000..84b9a22 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_75.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.1125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_750.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_750.txt new file mode 100644 index 0000000..b6aa83c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_750.txt @@ -0,0 +1 @@ +0 0.525 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_751.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_751.txt new file mode 100644 index 0000000..2f5d45e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_751.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_752.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_752.txt new file mode 100644 index 0000000..13bd218 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_752.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.540625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_753.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_753.txt new file mode 100644 index 0000000..cafc3d3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_753.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_754.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_754.txt new file mode 100644 index 0000000..7d56260 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_754.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_755.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_755.txt new file mode 100644 index 0000000..0246ef8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_755.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.41875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_756.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_756.txt new file mode 100644 index 0000000..f30ae71 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_756.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_757.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_757.txt new file mode 100644 index 0000000..1c535c9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_757.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_758.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_758.txt new file mode 100644 index 0000000..250ddd0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_758.txt @@ -0,0 +1 @@ +0 0.5980769230769231 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_759.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_759.txt new file mode 100644 index 0000000..ea1db6a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_759.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.265625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_76.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_76.txt new file mode 100644 index 0000000..d47d26e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_76.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_760.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_760.txt new file mode 100644 index 0000000..7f35054 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_760.txt @@ -0,0 +1 @@ +0 0.6 0.140625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_761.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_761.txt new file mode 100644 index 0000000..5014e26 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_761.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.3 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_762.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_762.txt new file mode 100644 index 0000000..dab120a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_762.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_763.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_763.txt new file mode 100644 index 0000000..f80aab1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_763.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_764.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_764.txt new file mode 100644 index 0000000..d98d49b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_764.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_765.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_765.txt new file mode 100644 index 0000000..cb9e7a7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_765.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.58125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_766.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_766.txt new file mode 100644 index 0000000..ee87e75 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_766.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_767.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_767.txt new file mode 100644 index 0000000..3809a7f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_767.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_768.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_768.txt new file mode 100644 index 0000000..c236265 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_768.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_769.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_769.txt new file mode 100644 index 0000000..422c571 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_769.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_77.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_77.txt new file mode 100644 index 0000000..657791b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_77.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_770.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_770.txt new file mode 100644 index 0000000..43e1f7a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_770.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_771.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_771.txt new file mode 100644 index 0000000..b9f8996 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_771.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_772.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_772.txt new file mode 100644 index 0000000..df20c94 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_772.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.659375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_773.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_773.txt new file mode 100644 index 0000000..03d1630 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_773.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_774.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_774.txt new file mode 100644 index 0000000..0d4dcc1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_774.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.6375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_775.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_775.txt new file mode 100644 index 0000000..c3c8fd3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_775.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_776.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_776.txt new file mode 100644 index 0000000..368cac0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_776.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_777.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_777.txt new file mode 100644 index 0000000..2fcc412 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_777.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_778.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_778.txt new file mode 100644 index 0000000..56397ff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_778.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_779.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_779.txt new file mode 100644 index 0000000..61b80a2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_779.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.43125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_78.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_78.txt new file mode 100644 index 0000000..99284ae --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_78.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_780.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_780.txt new file mode 100644 index 0000000..86c2748 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_780.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_781.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_781.txt new file mode 100644 index 0000000..4044a1e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_781.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_782.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_782.txt new file mode 100644 index 0000000..a932ca1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_782.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_783.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_783.txt new file mode 100644 index 0000000..b47f917 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_783.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.621875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_784.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_784.txt new file mode 100644 index 0000000..4a8976b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_784.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_785.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_785.txt new file mode 100644 index 0000000..93148fc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_785.txt @@ -0,0 +1 @@ +0 0.65 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_786.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_786.txt new file mode 100644 index 0000000..3502ea0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_786.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_787.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_787.txt new file mode 100644 index 0000000..fd7c418 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_787.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_788.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_788.txt new file mode 100644 index 0000000..9b18d23 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_788.txt @@ -0,0 +1 @@ +0 0.5269230769230769 0.384375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_789.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_789.txt new file mode 100644 index 0000000..053cb0a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_789.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_79.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_79.txt new file mode 100644 index 0000000..6348780 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_79.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_790.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_790.txt new file mode 100644 index 0000000..4cf9122 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_790.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_791.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_791.txt new file mode 100644 index 0000000..20cacd9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_791.txt @@ -0,0 +1 @@ +0 0.5 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_792.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_792.txt new file mode 100644 index 0000000..3ea952f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_792.txt @@ -0,0 +1 @@ +0 0.425 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_793.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_793.txt new file mode 100644 index 0000000..b5a1671 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_793.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.315625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_794.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_794.txt new file mode 100644 index 0000000..8c3e2ff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_794.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.109375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_795.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_795.txt new file mode 100644 index 0000000..d03f43e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_795.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_796.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_796.txt new file mode 100644 index 0000000..7b76a32 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_796.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.6 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_797.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_797.txt new file mode 100644 index 0000000..9035b73 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_797.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_798.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_798.txt new file mode 100644 index 0000000..1619297 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_798.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.25 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_799.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_799.txt new file mode 100644 index 0000000..6f337d3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_799.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_8.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_8.txt new file mode 100644 index 0000000..500dc77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_8.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_80.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_80.txt new file mode 100644 index 0000000..0b2922a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_80.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.634375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_800.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_800.txt new file mode 100644 index 0000000..cea322f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_800.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_801.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_801.txt new file mode 100644 index 0000000..0246ef8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_801.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.41875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_802.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_802.txt new file mode 100644 index 0000000..1459da5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_802.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_803.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_803.txt new file mode 100644 index 0000000..5b1deb1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_803.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_804.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_804.txt new file mode 100644 index 0000000..97d51d6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_804.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_805.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_805.txt new file mode 100644 index 0000000..3a87724 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_805.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.4625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_806.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_806.txt new file mode 100644 index 0000000..799de13 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_806.txt @@ -0,0 +1 @@ +0 0.35192307692307695 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_807.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_807.txt new file mode 100644 index 0000000..d49e705 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_807.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_808.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_808.txt new file mode 100644 index 0000000..76fac5d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_808.txt @@ -0,0 +1 @@ +0 0.3211538461538462 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_809.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_809.txt new file mode 100644 index 0000000..fa1255a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_809.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_81.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_81.txt new file mode 100644 index 0000000..b8da217 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_81.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.553125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_810.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_810.txt new file mode 100644 index 0000000..ccf6ee9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_810.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_811.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_811.txt new file mode 100644 index 0000000..d6bc6a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_811.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_812.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_812.txt new file mode 100644 index 0000000..88e37df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_812.txt @@ -0,0 +1 @@ +0 0.3596153846153846 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_813.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_813.txt new file mode 100644 index 0000000..990de50 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_813.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.28125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_814.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_814.txt new file mode 100644 index 0000000..0492f2c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_814.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.30625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_815.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_815.txt new file mode 100644 index 0000000..21c0b8b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_815.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.571875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_816.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_816.txt new file mode 100644 index 0000000..648e148 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_816.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_817.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_817.txt new file mode 100644 index 0000000..4398fe1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_817.txt @@ -0,0 +1 @@ +0 0.65 0.409375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_818.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_818.txt new file mode 100644 index 0000000..fef25bc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_818.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_819.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_819.txt new file mode 100644 index 0000000..cf87658 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_819.txt @@ -0,0 +1 @@ +0 0.45384615384615384 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_82.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_82.txt new file mode 100644 index 0000000..b4a3d92 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_82.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_820.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_820.txt new file mode 100644 index 0000000..ab0988f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_820.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_821.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_821.txt new file mode 100644 index 0000000..25a5167 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_821.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_822.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_822.txt new file mode 100644 index 0000000..f4c7869 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_822.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_823.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_823.txt new file mode 100644 index 0000000..2236925 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_823.txt @@ -0,0 +1 @@ +0 0.575 0.2875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_824.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_824.txt new file mode 100644 index 0000000..57370bf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_824.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_825.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_825.txt new file mode 100644 index 0000000..9f8e9af --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_825.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_826.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_826.txt new file mode 100644 index 0000000..22ba662 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_826.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_827.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_827.txt new file mode 100644 index 0000000..053f612 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_827.txt @@ -0,0 +1 @@ +0 0.35 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_828.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_828.txt new file mode 100644 index 0000000..f9c67f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_828.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_829.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_829.txt new file mode 100644 index 0000000..87e6bd2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_829.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_83.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_83.txt new file mode 100644 index 0000000..4a7a367 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_83.txt @@ -0,0 +1 @@ +0 0.5192307692307693 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_830.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_830.txt new file mode 100644 index 0000000..00c7e3b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_830.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.203125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_831.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_831.txt new file mode 100644 index 0000000..4d49b97 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_831.txt @@ -0,0 +1 @@ +0 0.4461538461538462 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_832.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_832.txt new file mode 100644 index 0000000..c46e4f6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_832.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_833.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_833.txt new file mode 100644 index 0000000..252635b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_833.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_834.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_834.txt new file mode 100644 index 0000000..7a54855 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_834.txt @@ -0,0 +1 @@ +0 0.573076923076923 0.63125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_835.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_835.txt new file mode 100644 index 0000000..f48109b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_835.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.675 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_836.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_836.txt new file mode 100644 index 0000000..eba80a5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_836.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_837.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_837.txt new file mode 100644 index 0000000..2c3c638 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_837.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_838.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_838.txt new file mode 100644 index 0000000..4ce380e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_838.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_839.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_839.txt new file mode 100644 index 0000000..a2fbe1c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_839.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_84.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_84.txt new file mode 100644 index 0000000..182d059 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_84.txt @@ -0,0 +1 @@ +0 0.4461538461538462 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_840.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_840.txt new file mode 100644 index 0000000..23f5fbc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_840.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_841.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_841.txt new file mode 100644 index 0000000..26df00f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_841.txt @@ -0,0 +1 @@ +0 0.35384615384615387 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_842.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_842.txt new file mode 100644 index 0000000..66529c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_842.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_843.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_843.txt new file mode 100644 index 0000000..b7fb5c5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_843.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_844.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_844.txt new file mode 100644 index 0000000..8a49f4d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_844.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.36875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_845.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_845.txt new file mode 100644 index 0000000..3001658 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_845.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_846.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_846.txt new file mode 100644 index 0000000..9da2efd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_846.txt @@ -0,0 +1 @@ +0 0.5557692307692308 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_847.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_847.txt new file mode 100644 index 0000000..0dc930b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_847.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_848.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_848.txt new file mode 100644 index 0000000..9f2acb3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_848.txt @@ -0,0 +1 @@ +0 0.6865384615384615 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_849.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_849.txt new file mode 100644 index 0000000..8d0a686 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_849.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_85.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_85.txt new file mode 100644 index 0000000..e469e68 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_85.txt @@ -0,0 +1 @@ +0 0.4 0.2875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_850.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_850.txt new file mode 100644 index 0000000..c1674e6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_850.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_851.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_851.txt new file mode 100644 index 0000000..03bacef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_851.txt @@ -0,0 +1 @@ +0 0.6615384615384615 0.675 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_852.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_852.txt new file mode 100644 index 0000000..532b7ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_852.txt @@ -0,0 +1 @@ +0 0.6269230769230769 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_853.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_853.txt new file mode 100644 index 0000000..655c38d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_853.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_854.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_854.txt new file mode 100644 index 0000000..ca57efc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_854.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_855.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_855.txt new file mode 100644 index 0000000..0ebe589 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_855.txt @@ -0,0 +1 @@ +0 0.3576923076923077 0.56875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_856.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_856.txt new file mode 100644 index 0000000..b310ce8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_856.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_857.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_857.txt new file mode 100644 index 0000000..31ce9a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_857.txt @@ -0,0 +1 @@ +0 0.5538461538461539 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_858.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_858.txt new file mode 100644 index 0000000..b2a796d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_858.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_859.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_859.txt new file mode 100644 index 0000000..73dc958 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_859.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_86.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_86.txt new file mode 100644 index 0000000..b62a51a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_86.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_860.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_860.txt new file mode 100644 index 0000000..3f05bb1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_860.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_861.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_861.txt new file mode 100644 index 0000000..b11cfb7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_861.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.55 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_862.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_862.txt new file mode 100644 index 0000000..d6cb984 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_862.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_863.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_863.txt new file mode 100644 index 0000000..6c1805c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_863.txt @@ -0,0 +1 @@ +0 0.5057692307692307 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_864.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_864.txt new file mode 100644 index 0000000..79c88b4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_864.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.1 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_865.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_865.txt new file mode 100644 index 0000000..af6d5d6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_865.txt @@ -0,0 +1 @@ +0 0.4634615384615385 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_866.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_866.txt new file mode 100644 index 0000000..8c64abf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_866.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_867.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_867.txt new file mode 100644 index 0000000..ebda7b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_867.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.090625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_868.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_868.txt new file mode 100644 index 0000000..b3c0102 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_868.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.196875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_869.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_869.txt new file mode 100644 index 0000000..1db1c89 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_869.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.18125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_87.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_87.txt new file mode 100644 index 0000000..00e2b1f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_87.txt @@ -0,0 +1 @@ +0 0.4307692307692308 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_870.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_870.txt new file mode 100644 index 0000000..d431e9a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_870.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_871.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_871.txt new file mode 100644 index 0000000..7fadbdd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_871.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_872.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_872.txt new file mode 100644 index 0000000..621c704 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_872.txt @@ -0,0 +1 @@ +0 0.5807692307692308 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_873.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_873.txt new file mode 100644 index 0000000..0b8928c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_873.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.48125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_874.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_874.txt new file mode 100644 index 0000000..6012cf3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_874.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_875.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_875.txt new file mode 100644 index 0000000..b799c4e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_875.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_876.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_876.txt new file mode 100644 index 0000000..e939c1e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_876.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_877.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_877.txt new file mode 100644 index 0000000..54a92db --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_877.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_878.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_878.txt new file mode 100644 index 0000000..25c0ea4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_878.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_879.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_879.txt new file mode 100644 index 0000000..d129ed8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_879.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_88.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_88.txt new file mode 100644 index 0000000..88ebfac --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_88.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_880.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_880.txt new file mode 100644 index 0000000..bbb3034 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_880.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_881.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_881.txt new file mode 100644 index 0000000..b41cf7a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_881.txt @@ -0,0 +1 @@ +0 0.4 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_882.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_882.txt new file mode 100644 index 0000000..9f6dddf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_882.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_883.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_883.txt new file mode 100644 index 0000000..3fabb09 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_883.txt @@ -0,0 +1 @@ +0 0.5019230769230769 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_884.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_884.txt new file mode 100644 index 0000000..788869d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_884.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_885.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_885.txt new file mode 100644 index 0000000..d11bc6d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_885.txt @@ -0,0 +1 @@ +0 0.4461538461538462 0.265625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_886.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_886.txt new file mode 100644 index 0000000..c7d8886 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_886.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_887.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_887.txt new file mode 100644 index 0000000..e956178 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_887.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_888.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_888.txt new file mode 100644 index 0000000..26a8a6d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_888.txt @@ -0,0 +1 @@ +0 0.5807692307692308 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_889.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_889.txt new file mode 100644 index 0000000..7a9a449 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_889.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_89.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_89.txt new file mode 100644 index 0000000..edb1725 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_89.txt @@ -0,0 +1 @@ +0 0.48653846153846153 0.28125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_890.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_890.txt new file mode 100644 index 0000000..6133eb8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_890.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.109375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_891.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_891.txt new file mode 100644 index 0000000..89694af --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_891.txt @@ -0,0 +1 @@ +0 0.65 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_892.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_892.txt new file mode 100644 index 0000000..23dad62 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_892.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_893.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_893.txt new file mode 100644 index 0000000..7ed814b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_893.txt @@ -0,0 +1 @@ +0 0.6596153846153846 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_894.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_894.txt new file mode 100644 index 0000000..733dd93 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_894.txt @@ -0,0 +1 @@ +0 0.6384615384615384 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_895.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_895.txt new file mode 100644 index 0000000..388155f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_895.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_896.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_896.txt new file mode 100644 index 0000000..2632d3b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_896.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.4375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_897.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_897.txt new file mode 100644 index 0000000..f065af9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_897.txt @@ -0,0 +1 @@ +0 0.3596153846153846 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_898.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_898.txt new file mode 100644 index 0000000..e24b894 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_898.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_899.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_899.txt new file mode 100644 index 0000000..7d5f97c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_899.txt @@ -0,0 +1 @@ +0 0.5980769230769231 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_9.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_9.txt new file mode 100644 index 0000000..0227e94 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_9.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_90.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_90.txt new file mode 100644 index 0000000..8428034 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_90.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.4375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_900.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_900.txt new file mode 100644 index 0000000..d3fe802 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_900.txt @@ -0,0 +1 @@ +0 0.325 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_901.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_901.txt new file mode 100644 index 0000000..8755512 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_901.txt @@ -0,0 +1 @@ +0 0.3211538461538462 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_902.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_902.txt new file mode 100644 index 0000000..375cb97 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_902.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_903.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_903.txt new file mode 100644 index 0000000..adf3beb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_903.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_904.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_904.txt new file mode 100644 index 0000000..e3521eb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_904.txt @@ -0,0 +1 @@ +0 0.6557692307692308 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_905.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_905.txt new file mode 100644 index 0000000..fde0ee3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_905.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_906.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_906.txt new file mode 100644 index 0000000..e42640b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_906.txt @@ -0,0 +1 @@ +0 0.6596153846153846 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_907.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_907.txt new file mode 100644 index 0000000..62b5c4c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_907.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_908.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_908.txt new file mode 100644 index 0000000..d5e76ae --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_908.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.68125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_909.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_909.txt new file mode 100644 index 0000000..41d37ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_909.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_91.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_91.txt new file mode 100644 index 0000000..7f3c8aa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_91.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_910.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_910.txt new file mode 100644 index 0000000..80d17ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_910.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_911.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_911.txt new file mode 100644 index 0000000..536f488 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_911.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_912.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_912.txt new file mode 100644 index 0000000..63836e5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_912.txt @@ -0,0 +1 @@ +0 0.5288461538461539 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_913.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_913.txt new file mode 100644 index 0000000..3140f2e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_913.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_914.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_914.txt new file mode 100644 index 0000000..87629a3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_914.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.421875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_915.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_915.txt new file mode 100644 index 0000000..49829a6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_915.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.109375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_916.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_916.txt new file mode 100644 index 0000000..b4bda47 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_916.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_917.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_917.txt new file mode 100644 index 0000000..0b4a5b4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_917.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_918.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_918.txt new file mode 100644 index 0000000..83e0a93 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_918.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_919.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_919.txt new file mode 100644 index 0000000..acd3c1e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_919.txt @@ -0,0 +1 @@ +0 0.35192307692307695 0.590625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_92.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_92.txt new file mode 100644 index 0000000..154c688 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_92.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_920.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_920.txt new file mode 100644 index 0000000..cbdafcd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_920.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_921.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_921.txt new file mode 100644 index 0000000..7107c5f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_921.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_922.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_922.txt new file mode 100644 index 0000000..52a0aff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_922.txt @@ -0,0 +1 @@ +0 0.5230769230769231 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_923.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_923.txt new file mode 100644 index 0000000..033e420 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_923.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_924.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_924.txt new file mode 100644 index 0000000..99ee2f9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_924.txt @@ -0,0 +1 @@ +0 0.41346153846153844 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_925.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_925.txt new file mode 100644 index 0000000..2f4bea6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_925.txt @@ -0,0 +1 @@ +0 0.5788461538461539 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_926.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_926.txt new file mode 100644 index 0000000..38e9525 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_926.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_927.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_927.txt new file mode 100644 index 0000000..531b6fd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_927.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.253125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_928.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_928.txt new file mode 100644 index 0000000..56ce869 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_928.txt @@ -0,0 +1 @@ +0 0.475 0.315625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_929.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_929.txt new file mode 100644 index 0000000..d66a768 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_929.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_93.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_93.txt new file mode 100644 index 0000000..b877faf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_93.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_930.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_930.txt new file mode 100644 index 0000000..d068ef2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_930.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_931.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_931.txt new file mode 100644 index 0000000..607ab10 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_931.txt @@ -0,0 +1 @@ +0 0.6576923076923077 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_932.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_932.txt new file mode 100644 index 0000000..ff21521 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_932.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_933.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_933.txt new file mode 100644 index 0000000..b107b38 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_933.txt @@ -0,0 +1 @@ +0 0.6 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_934.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_934.txt new file mode 100644 index 0000000..7729c73 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_934.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.090625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_935.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_935.txt new file mode 100644 index 0000000..875d61c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_935.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_936.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_936.txt new file mode 100644 index 0000000..a3b2810 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_936.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.68125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_937.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_937.txt new file mode 100644 index 0000000..00ec6d0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_937.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_938.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_938.txt new file mode 100644 index 0000000..c401031 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_938.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_939.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_939.txt new file mode 100644 index 0000000..a377249 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_939.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.240625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_94.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_94.txt new file mode 100644 index 0000000..1106651 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_94.txt @@ -0,0 +1 @@ +0 0.5230769230769231 0.209375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_940.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_940.txt new file mode 100644 index 0000000..0c8f6c1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_940.txt @@ -0,0 +1 @@ +0 0.675 0.209375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_941.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_941.txt new file mode 100644 index 0000000..a32f1a2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_941.txt @@ -0,0 +1 @@ +0 0.5557692307692308 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_942.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_942.txt new file mode 100644 index 0000000..1146691 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_942.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_943.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_943.txt new file mode 100644 index 0000000..8f6b61b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_943.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_944.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_944.txt new file mode 100644 index 0000000..1cbf797 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_944.txt @@ -0,0 +1 @@ +0 0.4173076923076923 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_945.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_945.txt new file mode 100644 index 0000000..e2fe276 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_945.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_946.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_946.txt new file mode 100644 index 0000000..f547cb7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_946.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_947.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_947.txt new file mode 100644 index 0000000..c7d8886 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_947.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_948.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_948.txt new file mode 100644 index 0000000..4bb71a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_948.txt @@ -0,0 +1 @@ +0 0.5019230769230769 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_949.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_949.txt new file mode 100644 index 0000000..7d98220 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_949.txt @@ -0,0 +1 @@ +0 0.6653846153846154 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_95.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_95.txt new file mode 100644 index 0000000..ec3b8e9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_95.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_950.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_950.txt new file mode 100644 index 0000000..6ce886d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_950.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.378125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_951.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_951.txt new file mode 100644 index 0000000..07d8620 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_951.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_952.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_952.txt new file mode 100644 index 0000000..3a1fb0b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_952.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.621875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_953.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_953.txt new file mode 100644 index 0000000..3677870 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_953.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_954.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_954.txt new file mode 100644 index 0000000..b16f0a9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_954.txt @@ -0,0 +1 @@ +0 0.551923076923077 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_955.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_955.txt new file mode 100644 index 0000000..d4bf5f3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_955.txt @@ -0,0 +1 @@ +0 0.5057692307692307 0.440625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_956.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_956.txt new file mode 100644 index 0000000..c4648f0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_956.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_957.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_957.txt new file mode 100644 index 0000000..e101403 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_957.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_958.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_958.txt new file mode 100644 index 0000000..fe76793 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_958.txt @@ -0,0 +1 @@ +0 0.575 0.54375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_959.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_959.txt new file mode 100644 index 0000000..2fbb838 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_959.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_96.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_96.txt new file mode 100644 index 0000000..cda155c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_96.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_960.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_960.txt new file mode 100644 index 0000000..b3e95e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_960.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_961.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_961.txt new file mode 100644 index 0000000..425641f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_961.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.090625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_962.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_962.txt new file mode 100644 index 0000000..afd1e99 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_962.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.640625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_963.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_963.txt new file mode 100644 index 0000000..51567e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_963.txt @@ -0,0 +1 @@ +0 0.5365384615384615 0.36875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_964.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_964.txt new file mode 100644 index 0000000..6a61333 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_964.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_965.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_965.txt new file mode 100644 index 0000000..c6d2205 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_965.txt @@ -0,0 +1 @@ +0 0.6057692307692307 0.315625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_966.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_966.txt new file mode 100644 index 0000000..f2bd385 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_966.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_967.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_967.txt new file mode 100644 index 0000000..e0e8758 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_967.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_968.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_968.txt new file mode 100644 index 0000000..b196b47 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_968.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_969.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_969.txt new file mode 100644 index 0000000..4eb9d42 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_969.txt @@ -0,0 +1 @@ +0 0.551923076923077 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_97.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_97.txt new file mode 100644 index 0000000..d23f68f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_97.txt @@ -0,0 +1 @@ +0 0.3211538461538462 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_970.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_970.txt new file mode 100644 index 0000000..c37d3ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_970.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_971.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_971.txt new file mode 100644 index 0000000..93f4dcd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_971.txt @@ -0,0 +1 @@ +0 0.475 0.634375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_972.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_972.txt new file mode 100644 index 0000000..1360b57 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_972.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_973.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_973.txt new file mode 100644 index 0000000..bd36157 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_973.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_974.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_974.txt new file mode 100644 index 0000000..791f0ac --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_974.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_975.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_975.txt new file mode 100644 index 0000000..be69d91 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_975.txt @@ -0,0 +1 @@ +0 0.49038461538461536 0.421875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_976.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_976.txt new file mode 100644 index 0000000..f161a05 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_976.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.415625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_977.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_977.txt new file mode 100644 index 0000000..379d5ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_977.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.25 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_978.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_978.txt new file mode 100644 index 0000000..d8181b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_978.txt @@ -0,0 +1 @@ +0 0.5 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_979.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_979.txt new file mode 100644 index 0000000..f2605ad --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_979.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_98.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_98.txt new file mode 100644 index 0000000..85c03ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_98.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_980.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_980.txt new file mode 100644 index 0000000..194ff9f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_980.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_981.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_981.txt new file mode 100644 index 0000000..bfa7e45 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_981.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.440625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_982.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_982.txt new file mode 100644 index 0000000..292d0a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_982.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_983.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_983.txt new file mode 100644 index 0000000..b943b98 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_983.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.30625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_984.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_984.txt new file mode 100644 index 0000000..92cafe3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_984.txt @@ -0,0 +1 @@ +0 0.4288461538461538 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_985.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_985.txt new file mode 100644 index 0000000..2a9c762 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_985.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_986.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_986.txt new file mode 100644 index 0000000..b614353 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_986.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_987.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_987.txt new file mode 100644 index 0000000..4038842 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_987.txt @@ -0,0 +1 @@ +0 0.3211538461538462 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_988.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_988.txt new file mode 100644 index 0000000..9702c79 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_988.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.08125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_989.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_989.txt new file mode 100644 index 0000000..23f9b8a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_989.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_99.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_99.txt new file mode 100644 index 0000000..c92021c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_99.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_990.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_990.txt new file mode 100644 index 0000000..feb6772 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_990.txt @@ -0,0 +1 @@ +0 0.45 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_991.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_991.txt new file mode 100644 index 0000000..5256bcc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_991.txt @@ -0,0 +1 @@ +0 0.5634615384615385 0.14375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_992.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_992.txt new file mode 100644 index 0000000..7491b79 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_992.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.440625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_993.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_993.txt new file mode 100644 index 0000000..1f3ca2a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_993.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_994.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_994.txt new file mode 100644 index 0000000..9871909 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_994.txt @@ -0,0 +1 @@ +0 0.4653846153846154 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_995.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_995.txt new file mode 100644 index 0000000..d5bdbc7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_995.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_996.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_996.txt new file mode 100644 index 0000000..6d53084 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_996.txt @@ -0,0 +1 @@ +0 0.6 0.303125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_997.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_997.txt new file mode 100644 index 0000000..f6d139b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_997.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_998.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_998.txt new file mode 100644 index 0000000..27007d2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_998.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_999.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_999.txt new file mode 100644 index 0000000..9f9f1da --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/labels/captcha_999.txt @@ -0,0 +1 @@ +0 0.6230769230769231 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/1.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/1.png new file mode 100644 index 0000000..022b5c5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/1.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/2.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/2.png new file mode 100644 index 0000000..7d347b9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/2.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_288.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_288.png new file mode 100644 index 0000000..07f364d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_288.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_354.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_354.png new file mode 100644 index 0000000..7227663 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_354.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_435.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_435.png new file mode 100644 index 0000000..bd024c7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/result/captcha_435.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/1.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/1.png new file mode 100644 index 0000000..26f6506 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/1.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/2.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/2.png new file mode 100644 index 0000000..9b685e9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/2.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_288.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_288.png new file mode 100644 index 0000000..e5096c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_288.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_354.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_354.png new file mode 100644 index 0000000..25c3b87 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_354.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_435.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_435.png new file mode 100644 index 0000000..794d641 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/test/captcha_435.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/train.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/train.txt new file mode 100644 index 0000000..e079c29 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/train.txt @@ -0,0 +1,800 @@ +data/captcha/images/captcha_625.png +data/captcha/images/captcha_109.png +data/captcha/images/captcha_983.png +data/captcha/images/captcha_788.png +data/captcha/images/captcha_882.png +data/captcha/images/captcha_840.png +data/captcha/images/captcha_947.png +data/captcha/images/captcha_125.png +data/captcha/images/captcha_10.png +data/captcha/images/captcha_531.png +data/captcha/images/captcha_315.png +data/captcha/images/captcha_685.png +data/captcha/images/captcha_836.png +data/captcha/images/captcha_257.png +data/captcha/images/captcha_199.png +data/captcha/images/captcha_106.png +data/captcha/images/captcha_380.png +data/captcha/images/captcha_795.png +data/captcha/images/captcha_459.png +data/captcha/images/captcha_31.png +data/captcha/images/captcha_338.png +data/captcha/images/captcha_888.png +data/captcha/images/captcha_529.png +data/captcha/images/captcha_739.png +data/captcha/images/captcha_499.png +data/captcha/images/captcha_210.png +data/captcha/images/captcha_628.png +data/captcha/images/captcha_389.png +data/captcha/images/captcha_19.png +data/captcha/images/captcha_742.png +data/captcha/images/captcha_827.png +data/captcha/images/captcha_515.png +data/captcha/images/captcha_6.png +data/captcha/images/captcha_787.png +data/captcha/images/captcha_684.png +data/captcha/images/captcha_639.png +data/captcha/images/captcha_324.png +data/captcha/images/captcha_945.png +data/captcha/images/captcha_228.png +data/captcha/images/captcha_877.png +data/captcha/images/captcha_87.png +data/captcha/images/captcha_674.png +data/captcha/images/captcha_950.png +data/captcha/images/captcha_669.png +data/captcha/images/captcha_643.png +data/captcha/images/captcha_191.png +data/captcha/images/captcha_769.png +data/captcha/images/captcha_660.png +data/captcha/images/captcha_738.png +data/captcha/images/captcha_309.png +data/captcha/images/captcha_830.png +data/captcha/images/captcha_916.png +data/captcha/images/captcha_812.png +data/captcha/images/captcha_78.png +data/captcha/images/captcha_603.png +data/captcha/images/captcha_712.png +data/captcha/images/captcha_227.png +data/captcha/images/captcha_502.png +data/captcha/images/captcha_381.png +data/captcha/images/captcha_113.png +data/captcha/images/captcha_487.png +data/captcha/images/captcha_932.png +data/captcha/images/captcha_954.png +data/captcha/images/captcha_392.png +data/captcha/images/captcha_151.png +data/captcha/images/captcha_11.png +data/captcha/images/captcha_462.png +data/captcha/images/captcha_746.png +data/captcha/images/captcha_928.png +data/captcha/images/captcha_967.png +data/captcha/images/captcha_232.png +data/captcha/images/captcha_845.png +data/captcha/images/captcha_375.png +data/captcha/images/captcha_588.png +data/captcha/images/captcha_185.png +data/captcha/images/captcha_792.png +data/captcha/images/captcha_201.png +data/captcha/images/captcha_133.png +data/captcha/images/captcha_146.png +data/captcha/images/captcha_519.png +data/captcha/images/captcha_490.png +data/captcha/images/captcha_810.png +data/captcha/images/captcha_461.png +data/captcha/images/captcha_373.png +data/captcha/images/captcha_866.png +data/captcha/images/captcha_841.png +data/captcha/images/captcha_789.png +data/captcha/images/captcha_301.png +data/captcha/images/captcha_469.png +data/captcha/images/captcha_81.png +data/captcha/images/captcha_640.png +data/captcha/images/captcha_267.png +data/captcha/images/captcha_396.png +data/captcha/images/captcha_148.png +data/captcha/images/captcha_771.png +data/captcha/images/captcha_200.png +data/captcha/images/captcha_521.png +data/captcha/images/captcha_572.png +data/captcha/images/captcha_532.png +data/captcha/images/captcha_465.png +data/captcha/images/captcha_17.png +data/captcha/images/captcha_480.png +data/captcha/images/captcha_471.png +data/captcha/images/captcha_155.png +data/captcha/images/captcha_388.png +data/captcha/images/captcha_546.png +data/captcha/images/captcha_548.png +data/captcha/images/captcha_209.png +data/captcha/images/captcha_22.png +data/captcha/images/captcha_101.png +data/captcha/images/captcha_686.png +data/captcha/images/captcha_359.png +data/captcha/images/captcha_207.png +data/captcha/images/captcha_761.png +data/captcha/images/captcha_567.png +data/captcha/images/captcha_906.png +data/captcha/images/captcha_667.png +data/captcha/images/captcha_858.png +data/captcha/images/captcha_264.png +data/captcha/images/captcha_855.png +data/captcha/images/captcha_946.png +data/captcha/images/captcha_722.png +data/captcha/images/captcha_446.png +data/captcha/images/captcha_892.png +data/captcha/images/captcha_293.png +data/captcha/images/captcha_590.png +data/captcha/images/captcha_764.png +data/captcha/images/captcha_750.png +data/captcha/images/captcha_451.png +data/captcha/images/captcha_426.png +data/captcha/images/captcha_294.png +data/captcha/images/captcha_544.png +data/captcha/images/captcha_985.png +data/captcha/images/captcha_370.png +data/captcha/images/captcha_178.png +data/captcha/images/captcha_415.png +data/captcha/images/captcha_922.png +data/captcha/images/captcha_36.png +data/captcha/images/captcha_491.png +data/captcha/images/captcha_617.png +data/captcha/images/captcha_936.png +data/captcha/images/captcha_384.png +data/captcha/images/captcha_774.png +data/captcha/images/captcha_401.png +data/captcha/images/captcha_900.png +data/captcha/images/captcha_0.png +data/captcha/images/captcha_693.png +data/captcha/images/captcha_52.png +data/captcha/images/captcha_759.png +data/captcha/images/captcha_295.png +data/captcha/images/captcha_40.png +data/captcha/images/captcha_307.png +data/captcha/images/captcha_796.png +data/captcha/images/captcha_478.png +data/captcha/images/captcha_202.png +data/captcha/images/captcha_535.png +data/captcha/images/captcha_162.png +data/captcha/images/captcha_254.png +data/captcha/images/captcha_555.png +data/captcha/images/captcha_843.png +data/captcha/images/captcha_921.png +data/captcha/images/captcha_322.png +data/captcha/images/captcha_233.png +data/captcha/images/captcha_604.png +data/captcha/images/captcha_901.png +data/captcha/images/captcha_452.png +data/captcha/images/captcha_18.png +data/captcha/images/captcha_831.png +data/captcha/images/captcha_797.png +data/captcha/images/captcha_798.png +data/captcha/images/captcha_171.png +data/captcha/images/captcha_350.png +data/captcha/images/captcha_929.png +data/captcha/images/captcha_842.png +data/captcha/images/captcha_838.png +data/captcha/images/captcha_780.png +data/captcha/images/captcha_614.png +data/captcha/images/captcha_62.png +data/captcha/images/captcha_941.png +data/captcha/images/captcha_629.png +data/captcha/images/captcha_766.png +data/captcha/images/captcha_408.png +data/captcha/images/captcha_387.png +data/captcha/images/captcha_175.png +data/captcha/images/captcha_420.png +data/captcha/images/captcha_269.png +data/captcha/images/captcha_80.png +data/captcha/images/captcha_237.png +data/captcha/images/captcha_467.png +data/captcha/images/captcha_559.png +data/captcha/images/captcha_957.png +data/captcha/images/captcha_136.png +data/captcha/images/captcha_411.png +data/captcha/images/captcha_917.png +data/captcha/images/captcha_311.png +data/captcha/images/captcha_698.png +data/captcha/images/captcha_517.png +data/captcha/images/captcha_336.png +data/captcha/images/captcha_231.png +data/captcha/images/captcha_297.png +data/captcha/images/captcha_608.png +data/captcha/images/captcha_41.png +data/captcha/images/captcha_500.png +data/captcha/images/captcha_364.png +data/captcha/images/captcha_82.png +data/captcha/images/captcha_728.png +data/captcha/images/captcha_126.png +data/captcha/images/captcha_122.png +data/captcha/images/captcha_205.png +data/captcha/images/captcha_73.png +data/captcha/images/captcha_421.png +data/captcha/images/captcha_54.png +data/captcha/images/captcha_607.png +data/captcha/images/captcha_212.png +data/captcha/images/captcha_990.png +data/captcha/images/captcha_89.png +data/captcha/images/captcha_206.png +data/captcha/images/captcha_879.png +data/captcha/images/captcha_344.png +data/captcha/images/captcha_161.png +data/captcha/images/captcha_971.png +data/captcha/images/captcha_606.png +data/captcha/images/captcha_913.png +data/captcha/images/captcha_383.png +data/captcha/images/captcha_852.png +data/captcha/images/captcha_561.png +data/captcha/images/captcha_486.png +data/captcha/images/captcha_341.png +data/captcha/images/captcha_250.png +data/captcha/images/captcha_940.png +data/captcha/images/captcha_974.png +data/captcha/images/captcha_286.png +data/captcha/images/captcha_751.png +data/captcha/images/captcha_681.png +data/captcha/images/captcha_552.png +data/captcha/images/captcha_305.png +data/captcha/images/captcha_26.png +data/captcha/images/captcha_71.png +data/captcha/images/captcha_262.png +data/captcha/images/captcha_453.png +data/captcha/images/captcha_554.png +data/captcha/images/captcha_820.png +data/captcha/images/captcha_46.png +data/captcha/images/captcha_91.png +data/captcha/images/captcha_4.png +data/captcha/images/captcha_69.png +data/captcha/images/captcha_851.png +data/captcha/images/captcha_351.png +data/captcha/images/captcha_697.png +data/captcha/images/captcha_419.png +data/captcha/images/captcha_433.png +data/captcha/images/captcha_332.png +data/captcha/images/captcha_809.png +data/captcha/images/captcha_839.png +data/captcha/images/captcha_575.png +data/captcha/images/captcha_188.png +data/captcha/images/captcha_910.png +data/captcha/images/captcha_14.png +data/captcha/images/captcha_179.png +data/captcha/images/captcha_543.png +data/captcha/images/captcha_287.png +data/captcha/images/captcha_12.png +data/captcha/images/captcha_184.png +data/captcha/images/captcha_412.png +data/captcha/images/captcha_163.png +data/captcha/images/captcha_621.png +data/captcha/images/captcha_483.png +data/captcha/images/captcha_330.png +data/captcha/images/captcha_321.png +data/captcha/images/captcha_382.png +data/captcha/images/captcha_53.png +data/captcha/images/captcha_814.png +data/captcha/images/captcha_730.png +data/captcha/images/captcha_214.png +data/captcha/images/captcha_245.png +data/captcha/images/captcha_56.png +data/captcha/images/captcha_32.png +data/captcha/images/captcha_431.png +data/captcha/images/captcha_503.png +data/captcha/images/captcha_677.png +data/captcha/images/captcha_432.png +data/captcha/images/captcha_748.png +data/captcha/images/captcha_450.png +data/captcha/images/captcha_887.png +data/captcha/images/captcha_74.png +data/captcha/images/captcha_886.png +data/captcha/images/captcha_715.png +data/captcha/images/captcha_860.png +data/captcha/images/captcha_777.png +data/captcha/images/captcha_243.png +data/captcha/images/captcha_569.png +data/captcha/images/captcha_174.png +data/captcha/images/captcha_525.png +data/captcha/images/captcha_447.png +data/captcha/images/captcha_318.png +data/captcha/images/captcha_568.png +data/captcha/images/captcha_703.png +data/captcha/images/captcha_605.png +data/captcha/images/captcha_197.png +data/captcha/images/captcha_140.png +data/captcha/images/captcha_427.png +data/captcha/images/captcha_907.png +data/captcha/images/captcha_881.png +data/captcha/images/captcha_584.png +data/captcha/images/captcha_75.png +data/captcha/images/captcha_319.png +data/captcha/images/captcha_824.png +data/captcha/images/captcha_580.png +data/captcha/images/captcha_88.png +data/captcha/images/captcha_79.png +data/captcha/images/captcha_699.png +data/captcha/images/captcha_268.png +data/captcha/images/captcha_115.png +data/captcha/images/captcha_951.png +data/captcha/images/captcha_694.png +data/captcha/images/captcha_753.png +data/captcha/images/captcha_909.png +data/captcha/images/captcha_374.png +data/captcha/images/captcha_440.png +data/captcha/images/captcha_883.png +data/captcha/images/captcha_573.png +data/captcha/images/captcha_801.png +data/captcha/images/captcha_919.png +data/captcha/images/captcha_158.png +data/captcha/images/captcha_998.png +data/captcha/images/captcha_50.png +data/captcha/images/captcha_166.png +data/captcha/images/captcha_586.png +data/captcha/images/captcha_93.png +data/captcha/images/captcha_270.png +data/captcha/images/captcha_258.png +data/captcha/images/captcha_299.png +data/captcha/images/captcha_758.png +data/captcha/images/captcha_652.png +data/captcha/images/captcha_110.png +data/captcha/images/captcha_626.png +data/captcha/images/captcha_458.png +data/captcha/images/captcha_277.png +data/captcha/images/captcha_650.png +data/captcha/images/captcha_688.png +data/captcha/images/captcha_790.png +data/captcha/images/captcha_943.png +data/captcha/images/captcha_935.png +data/captcha/images/captcha_736.png +data/captcha/images/captcha_734.png +data/captcha/images/captcha_710.png +data/captcha/images/captcha_61.png +data/captcha/images/captcha_402.png +data/captcha/images/captcha_893.png +data/captcha/images/captcha_104.png +data/captcha/images/captcha_911.png +data/captcha/images/captcha_713.png +data/captcha/images/captcha_147.png +data/captcha/images/captcha_948.png +data/captcha/images/captcha_826.png +data/captcha/images/captcha_714.png +data/captcha/images/captcha_434.png +data/captcha/images/captcha_95.png +data/captcha/images/captcha_377.png +data/captcha/images/captcha_846.png +data/captcha/images/captcha_663.png +data/captcha/images/captcha_968.png +data/captcha/images/captcha_596.png +data/captcha/images/captcha_844.png +data/captcha/images/captcha_339.png +data/captcha/images/captcha_124.png +data/captcha/images/captcha_752.png +data/captcha/images/captcha_312.png +data/captcha/images/captcha_204.png +data/captcha/images/captcha_482.png +data/captcha/images/captcha_59.png +data/captcha/images/captcha_520.png +data/captcha/images/captcha_538.png +data/captcha/images/captcha_442.png +data/captcha/images/captcha_980.png +data/captcha/images/captcha_225.png +data/captcha/images/captcha_428.png +data/captcha/images/captcha_857.png +data/captcha/images/captcha_740.png +data/captcha/images/captcha_960.png +data/captcha/images/captcha_638.png +data/captcha/images/captcha_897.png +data/captcha/images/captcha_242.png +data/captcha/images/captcha_923.png +data/captcha/images/captcha_58.png +data/captcha/images/captcha_861.png +data/captcha/images/captcha_856.png +data/captcha/images/captcha_189.png +data/captcha/images/captcha_25.png +data/captcha/images/captcha_915.png +data/captcha/images/captcha_400.png +data/captcha/images/captcha_298.png +data/captcha/images/captcha_310.png +data/captcha/images/captcha_265.png +data/captcha/images/captcha_176.png +data/captcha/images/captcha_327.png +data/captcha/images/captcha_653.png +data/captcha/images/captcha_216.png +data/captcha/images/captcha_272.png +data/captcha/images/captcha_355.png +data/captcha/images/captcha_514.png +data/captcha/images/captcha_562.png +data/captcha/images/captcha_992.png +data/captcha/images/captcha_579.png +data/captcha/images/captcha_849.png +data/captcha/images/captcha_547.png +data/captcha/images/captcha_865.png +data/captcha/images/captcha_230.png +data/captcha/images/captcha_273.png +data/captcha/images/captcha_195.png +data/captcha/images/captcha_44.png +data/captcha/images/captcha_328.png +data/captcha/images/captcha_834.png +data/captcha/images/captcha_867.png +data/captcha/images/captcha_726.png +data/captcha/images/captcha_409.png +data/captcha/images/captcha_24.png +data/captcha/images/captcha_246.png +data/captcha/images/captcha_597.png +data/captcha/images/captcha_770.png +data/captcha/images/captcha_168.png +data/captcha/images/captcha_405.png +data/captcha/images/captcha_448.png +data/captcha/images/captcha_690.png +data/captcha/images/captcha_963.png +data/captcha/images/captcha_429.png +data/captcha/images/captcha_719.png +data/captcha/images/captcha_403.png +data/captcha/images/captcha_536.png +data/captcha/images/captcha_436.png +data/captcha/images/captcha_142.png +data/captcha/images/captcha_702.png +data/captcha/images/captcha_566.png +data/captcha/images/captcha_156.png +data/captcha/images/captcha_417.png +data/captcha/images/captcha_664.png +data/captcha/images/captcha_476.png +data/captcha/images/captcha_472.png +data/captcha/images/captcha_464.png +data/captcha/images/captcha_828.png +data/captcha/images/captcha_813.png +data/captcha/images/captcha_542.png +data/captcha/images/captcha_988.png +data/captcha/images/captcha_337.png +data/captcha/images/captcha_896.png +data/captcha/images/captcha_473.png +data/captcha/images/captcha_300.png +data/captcha/images/captcha_105.png +data/captcha/images/captcha_292.png +data/captcha/images/captcha_942.png +data/captcha/images/captcha_821.png +data/captcha/images/captcha_815.png +data/captcha/images/captcha_394.png +data/captcha/images/captcha_306.png +data/captcha/images/captcha_407.png +data/captcha/images/captcha_754.png +data/captcha/images/captcha_404.png +data/captcha/images/captcha_260.png +data/captcha/images/captcha_768.png +data/captcha/images/captcha_732.png +data/captcha/images/captcha_51.png +data/captcha/images/captcha_767.png +data/captcha/images/captcha_505.png +data/captcha/images/captcha_72.png +data/captcha/images/captcha_116.png +data/captcha/images/captcha_602.png +data/captcha/images/captcha_187.png +data/captcha/images/captcha_397.png +data/captcha/images/captcha_244.png +data/captcha/images/captcha_622.png +data/captcha/images/captcha_986.png +data/captcha/images/captcha_422.png +data/captcha/images/captcha_627.png +data/captcha/images/captcha_190.png +data/captcha/images/captcha_234.png +data/captcha/images/captcha_466.png +data/captcha/images/captcha_772.png +data/captcha/images/captcha_805.png +data/captcha/images/captcha_648.png +data/captcha/images/captcha_485.png +data/captcha/images/captcha_128.png +data/captcha/images/captcha_183.png +data/captcha/images/captcha_541.png +data/captcha/images/captcha_563.png +data/captcha/images/captcha_152.png +data/captcha/images/captcha_438.png +data/captcha/images/captcha_410.png +data/captcha/images/captcha_76.png +data/captcha/images/captcha_644.png +data/captcha/images/captcha_526.png +data/captcha/images/captcha_600.png +data/captcha/images/captcha_987.png +data/captcha/images/captcha_66.png +data/captcha/images/captcha_962.png +data/captcha/images/captcha_139.png +data/captcha/images/captcha_120.png +data/captcha/images/captcha_325.png +data/captcha/images/captcha_875.png +data/captcha/images/captcha_90.png +data/captcha/images/captcha_775.png +data/captcha/images/captcha_425.png +data/captcha/images/captcha_329.png +data/captcha/images/captcha_944.png +data/captcha/images/captcha_226.png +data/captcha/images/captcha_616.png +data/captcha/images/captcha_489.png +data/captcha/images/captcha_361.png +data/captcha/images/captcha_989.png +data/captcha/images/captcha_835.png +data/captcha/images/captcha_23.png +data/captcha/images/captcha_589.png +data/captcha/images/captcha_591.png +data/captcha/images/captcha_144.png +data/captcha/images/captcha_762.png +data/captcha/images/captcha_778.png +data/captcha/images/captcha_255.png +data/captcha/images/captcha_67.png +data/captcha/images/captcha_123.png +data/captcha/images/captcha_895.png +data/captcha/images/captcha_47.png +data/captcha/images/captcha_278.png +data/captcha/images/captcha_973.png +data/captcha/images/captcha_181.png +data/captcha/images/captcha_537.png +data/captcha/images/captcha_372.png +data/captcha/images/captcha_203.png +data/captcha/images/captcha_825.png +data/captcha/images/captcha_782.png +data/captcha/images/captcha_13.png +data/captcha/images/captcha_982.png +data/captcha/images/captcha_630.png +data/captcha/images/captcha_654.png +data/captcha/images/captcha_864.png +data/captcha/images/captcha_186.png +data/captcha/images/captcha_863.png +data/captcha/images/captcha_773.png +data/captcha/images/captcha_779.png +data/captcha/images/captcha_3.png +data/captcha/images/captcha_349.png +data/captcha/images/captcha_956.png +data/captcha/images/captcha_807.png +data/captcha/images/captcha_474.png +data/captcha/images/captcha_613.png +data/captcha/images/captcha_687.png +data/captcha/images/captcha_439.png +data/captcha/images/captcha_587.png +data/captcha/images/captcha_413.png +data/captcha/images/captcha_376.png +data/captcha/images/captcha_763.png +data/captcha/images/captcha_540.png +data/captcha/images/captcha_98.png +data/captcha/images/captcha_704.png +data/captcha/images/captcha_457.png +data/captcha/images/captcha_931.png +data/captcha/images/captcha_853.png +data/captcha/images/captcha_631.png +data/captcha/images/captcha_177.png +data/captcha/images/captcha_360.png +data/captcha/images/captcha_343.png +data/captcha/images/captcha_256.png +data/captcha/images/captcha_938.png +data/captcha/images/captcha_623.png +data/captcha/images/captcha_592.png +data/captcha/images/captcha_117.png +data/captcha/images/captcha_366.png +data/captcha/images/captcha_121.png +data/captcha/images/captcha_850.png +data/captcha/images/captcha_868.png +data/captcha/images/captcha_37.png +data/captcha/images/captcha_369.png +data/captcha/images/captcha_222.png +data/captcha/images/captcha_609.png +data/captcha/images/captcha_683.png +data/captcha/images/captcha_63.png +data/captcha/images/captcha_637.png +data/captcha/images/captcha_130.png +data/captcha/images/captcha_455.png +data/captcha/images/captcha_799.png +data/captcha/images/captcha_159.png +data/captcha/images/captcha_335.png +data/captcha/images/captcha_898.png +data/captcha/images/captcha_55.png +data/captcha/images/captcha_363.png +data/captcha/images/captcha_727.png +data/captcha/images/captcha_735.png +data/captcha/images/captcha_498.png +data/captcha/images/captcha_334.png +data/captcha/images/captcha_904.png +data/captcha/images/captcha_333.png +data/captcha/images/captcha_182.png +data/captcha/images/captcha_793.png +data/captcha/images/captcha_829.png +data/captcha/images/captcha_894.png +data/captcha/images/captcha_418.png +data/captcha/images/captcha_274.png +data/captcha/images/captcha_612.png +data/captcha/images/captcha_599.png +data/captcha/images/captcha_646.png +data/captcha/images/captcha_316.png +data/captcha/images/captcha_979.png +data/captcha/images/captcha_837.png +data/captcha/images/captcha_645.png +data/captcha/images/captcha_695.png +data/captcha/images/captcha_320.png +data/captcha/images/captcha_655.png +data/captcha/images/captcha_416.png +data/captcha/images/captcha_112.png +data/captcha/images/captcha_890.png +data/captcha/images/captcha_662.png +data/captcha/images/captcha_964.png +data/captcha/images/captcha_671.png +data/captcha/images/captcha_284.png +data/captcha/images/captcha_670.png +data/captcha/images/captcha_378.png +data/captcha/images/captcha_539.png +data/captcha/images/captcha_678.png +data/captcha/images/captcha_247.png +data/captcha/images/captcha_876.png +data/captcha/images/captcha_765.png +data/captcha/images/captcha_924.png +data/captcha/images/captcha_345.png +data/captcha/images/captcha_21.png +data/captcha/images/captcha_720.png +data/captcha/images/captcha_35.png +data/captcha/images/captcha_657.png +data/captcha/images/captcha_676.png +data/captcha/images/captcha_791.png +data/captcha/images/captcha_131.png +data/captcha/images/captcha_679.png +data/captcha/images/captcha_49.png +data/captcha/images/captcha_362.png +data/captcha/images/captcha_303.png +data/captcha/images/captcha_460.png +data/captcha/images/captcha_872.png +data/captcha/images/captcha_889.png +data/captcha/images/captcha_641.png +data/captcha/images/captcha_275.png +data/captcha/images/captcha_477.png +data/captcha/images/captcha_523.png +data/captcha/images/captcha_952.png +data/captcha/images/captcha_925.png +data/captcha/images/captcha_854.png +data/captcha/images/captcha_252.png +data/captcha/images/captcha_494.png +data/captcha/images/captcha_760.png +data/captcha/images/captcha_642.png +data/captcha/images/captcha_107.png +data/captcha/images/captcha_443.png +data/captcha/images/captcha_926.png +data/captcha/images/captcha_705.png +data/captcha/images/captcha_632.png +data/captcha/images/captcha_999.png +data/captcha/images/captcha_198.png +data/captcha/images/captcha_635.png +data/captcha/images/captcha_367.png +data/captcha/images/captcha_65.png +data/captcha/images/captcha_211.png +data/captcha/images/captcha_709.png +data/captcha/images/captcha_706.png +data/captcha/images/captcha_96.png +data/captcha/images/captcha_708.png +data/captcha/images/captcha_610.png +data/captcha/images/captcha_885.png +data/captcha/images/captcha_94.png +data/captcha/images/captcha_314.png +data/captcha/images/captcha_261.png +data/captcha/images/captcha_512.png +data/captcha/images/captcha_239.png +data/captcha/images/captcha_618.png +data/captcha/images/captcha_102.png +data/captcha/images/captcha_696.png +data/captcha/images/captcha_884.png +data/captcha/images/captcha_45.png +data/captcha/images/captcha_236.png +data/captcha/images/captcha_263.png +data/captcha/images/captcha_899.png +data/captcha/images/captcha_390.png +data/captcha/images/captcha_819.png +data/captcha/images/captcha_869.png +data/captcha/images/captcha_259.png +data/captcha/images/captcha_955.png +data/captcha/images/captcha_85.png +data/captcha/images/captcha_551.png +data/captcha/images/captcha_496.png +data/captcha/images/captcha_878.png +data/captcha/images/captcha_454.png +data/captcha/images/captcha_167.png +data/captcha/images/captcha_723.png +data/captcha/images/captcha_430.png +data/captcha/images/captcha_585.png +data/captcha/images/captcha_511.png +data/captcha/images/captcha_111.png +data/captcha/images/captcha_365.png +data/captcha/images/captcha_518.png +data/captcha/images/captcha_385.png +data/captcha/images/captcha_194.png +data/captcha/images/captcha_513.png +data/captcha/images/captcha_749.png +data/captcha/images/captcha_27.png +data/captcha/images/captcha_129.png +data/captcha/images/captcha_823.png +data/captcha/images/captcha_598.png +data/captcha/images/captcha_783.png +data/captcha/images/captcha_441.png +data/captcha/images/captcha_937.png +data/captcha/images/captcha_729.png +data/captcha/images/captcha_386.png +data/captcha/images/captcha_620.png +data/captcha/images/captcha_953.png +data/captcha/images/captcha_138.png +data/captcha/images/captcha_352.png +data/captcha/images/captcha_302.png +data/captcha/images/captcha_673.png +data/captcha/images/captcha_501.png +data/captcha/images/captcha_522.png +data/captcha/images/captcha_308.png +data/captcha/images/captcha_289.png +data/captcha/images/captcha_776.png +data/captcha/images/captcha_395.png +data/captcha/images/captcha_423.png +data/captcha/images/captcha_48.png +data/captcha/images/captcha_9.png +data/captcha/images/captcha_169.png +data/captcha/images/captcha_219.png +data/captcha/images/captcha_229.png +data/captcha/images/captcha_574.png +data/captcha/images/captcha_77.png +data/captcha/images/captcha_5.png +data/captcha/images/captcha_822.png +data/captcha/images/captcha_880.png +data/captcha/images/captcha_495.png +data/captcha/images/captcha_507.png +data/captcha/images/captcha_283.png +data/captcha/images/captcha_737.png +data/captcha/images/captcha_993.png +data/captcha/images/captcha_291.png +data/captcha/images/captcha_223.png +data/captcha/images/captcha_504.png +data/captcha/images/captcha_296.png +data/captcha/images/captcha_847.png +data/captcha/images/captcha_510.png +data/captcha/images/captcha_215.png +data/captcha/images/captcha_991.png +data/captcha/images/captcha_611.png +data/captcha/images/captcha_493.png +data/captcha/images/captcha_530.png +data/captcha/images/captcha_449.png +data/captcha/images/captcha_557.png +data/captcha/images/captcha_7.png +data/captcha/images/captcha_506.png +data/captcha/images/captcha_803.png +data/captcha/images/captcha_356.png +data/captcha/images/captcha_470.png +data/captcha/images/captcha_675.png +data/captcha/images/captcha_132.png +data/captcha/images/captcha_100.png +data/captcha/images/captcha_70.png +data/captcha/images/captcha_108.png +data/captcha/images/captcha_118.png +data/captcha/images/captcha_145.png +data/captcha/images/captcha_571.png +data/captcha/images/captcha_60.png +data/captcha/images/captcha_624.png +data/captcha/images/captcha_818.png +data/captcha/images/captcha_781.png +data/captcha/images/captcha_348.png +data/captcha/images/captcha_995.png +data/captcha/images/captcha_808.png +data/captcha/images/captcha_217.png +data/captcha/images/captcha_785.png +data/captcha/images/captcha_756.png +data/captcha/images/captcha_784.png +data/captcha/images/captcha_172.png +data/captcha/images/captcha_196.png +data/captcha/images/captcha_290.png +data/captcha/images/captcha_154.png +data/captcha/images/captcha_619.png +data/captcha/images/captcha_235.png +data/captcha/images/captcha_57.png +data/captcha/images/captcha_978.png +data/captcha/images/captcha_633.png +data/captcha/images/captcha_757.png +data/captcha/images/captcha_634.png +data/captcha/images/captcha_15.png +data/captcha/images/captcha_711.png +data/captcha/images/captcha_601.png +data/captcha/images/captcha_160.png +data/captcha/images/captcha_68.png +data/captcha/images/captcha_578.png +data/captcha/images/captcha_595.png +data/captcha/images/captcha_984.png +data/captcha/images/captcha_38.png +data/captcha/images/captcha_253.png +data/captcha/images/captcha_134.png +data/captcha/images/captcha_509.png +data/captcha/images/captcha_285.png +data/captcha/images/captcha_358.png +data/captcha/images/captcha_733.png +data/captcha/images/captcha_357.png +data/captcha/images/captcha_912.png diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/valid.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/valid.txt new file mode 100644 index 0000000..d607c0c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/data/captcha/valid.txt @@ -0,0 +1,201 @@ +data/captcha/images/captcha_755.png +data/captcha/images/captcha_508.png +data/captcha/images/captcha_961.png +data/captcha/images/captcha_192.png +data/captcha/images/captcha_16.png +data/captcha/images/captcha_391.png +data/captcha/images/captcha_848.png +data/captcha/images/captcha_870.png +data/captcha/images/captcha_560.png +data/captcha/images/captcha_905.png +data/captcha/images/captcha_743.png +data/captcha/images/captcha_516.png +data/captcha/images/captcha_248.png +data/captcha/images/captcha_2.png +data/captcha/images/captcha_636.png +data/captcha/images/captcha_114.png +data/captcha/images/captcha_86.png +data/captcha/images/captcha_279.png +data/captcha/images/captcha_970.png +data/captcha/images/captcha_368.png +data/captcha/images/captcha_371.png +data/captcha/images/captcha_30.png +data/captcha/images/captcha_716.png +data/captcha/images/captcha_33.png +data/captcha/images/captcha_930.png +data/captcha/images/captcha_193.png +data/captcha/images/captcha_920.png +data/captcha/images/captcha_918.png +data/captcha/images/captcha_157.png +data/captcha/images/captcha_816.png +data/captcha/images/captcha_213.png +data/captcha/images/captcha_804.png +data/captcha/images/captcha_276.png +data/captcha/images/captcha_550.png +data/captcha/images/captcha_859.png +data/captcha/images/captcha_353.png +data/captcha/images/captcha_975.png +data/captcha/images/captcha_965.png +data/captcha/images/captcha_577.png +data/captcha/images/captcha_651.png +data/captcha/images/captcha_266.png +data/captcha/images/captcha_833.png +data/captcha/images/captcha_721.png +data/captcha/images/captcha_933.png +data/captcha/images/captcha_832.png +data/captcha/images/captcha_8.png +data/captcha/images/captcha_534.png +data/captcha/images/captcha_718.png +data/captcha/images/captcha_143.png +data/captcha/images/captcha_786.png +data/captcha/images/captcha_347.png +data/captcha/images/captcha_313.png +data/captcha/images/captcha_127.png +data/captcha/images/captcha_28.png +data/captcha/images/captcha_165.png +data/captcha/images/captcha_958.png +data/captcha/images/captcha_666.png +data/captcha/images/captcha_208.png +data/captcha/images/captcha_99.png +data/captcha/images/captcha_340.png +data/captcha/images/captcha_700.png +data/captcha/images/captcha_251.png +data/captcha/images/captcha_527.png +data/captcha/images/captcha_556.png +data/captcha/images/captcha_994.png +data/captcha/images/captcha_43.png +data/captcha/images/captcha_97.png +data/captcha/images/captcha_908.png +data/captcha/images/captcha_20.png +data/captcha/images/captcha_731.png +data/captcha/images/captcha_524.png +data/captcha/images/captcha_475.png +data/captcha/images/captcha_153.png +data/captcha/images/captcha_564.png +data/captcha/images/captcha_996.png +data/captcha/images/captcha_444.png +data/captcha/images/captcha_170.png +data/captcha/images/captcha_84.png +data/captcha/images/captcha_331.png +data/captcha/images/captcha_656.png +data/captcha/images/captcha_141.png +data/captcha/images/captcha_164.png +data/captcha/images/captcha_744.png +data/captcha/images/captcha_747.png +data/captcha/images/captcha_119.png +data/captcha/images/captcha_806.png +data/captcha/images/captcha_658.png +data/captcha/images/captcha_959.png +data/captcha/images/captcha_672.png +data/captcha/images/captcha_149.png +data/captcha/images/captcha_445.png +data/captcha/images/captcha_288.png +data/captcha/images/captcha_435.png +data/captcha/images/captcha_354.png +data/captcha/images/captcha_966.png +data/captcha/images/captcha_707.png +data/captcha/images/captcha_414.png +data/captcha/images/captcha_934.png +data/captcha/images/captcha_581.png +data/captcha/images/captcha_977.png +data/captcha/images/captcha_240.png +data/captcha/images/captcha_682.png +data/captcha/images/captcha_29.png +data/captcha/images/captcha_668.png +data/captcha/images/captcha_583.png +data/captcha/images/captcha_326.png +data/captcha/images/captcha_64.png +data/captcha/images/captcha_456.png +data/captcha/images/captcha_282.png +data/captcha/images/captcha_939.png +data/captcha/images/captcha_665.png +data/captcha/images/captcha_565.png +data/captcha/images/captcha_398.png +data/captcha/images/captcha_241.png +data/captcha/images/captcha_218.png +data/captcha/images/captcha_249.png +data/captcha/images/captcha_689.png +data/captcha/images/captcha_862.png +data/captcha/images/captcha_903.png +data/captcha/images/captcha_468.png +data/captcha/images/captcha_42.png +data/captcha/images/captcha_528.png +data/captcha/images/captcha_891.png +data/captcha/images/captcha_949.png +data/captcha/images/captcha_615.png +data/captcha/images/captcha_871.png +data/captcha/images/captcha_346.png +data/captcha/images/captcha_794.png +data/captcha/images/captcha_533.png +data/captcha/images/captcha_92.png +data/captcha/images/captcha_570.png +data/captcha/images/captcha_393.png +data/captcha/images/captcha_680.png +data/captcha/images/captcha_150.png +data/captcha/images/captcha_103.png +data/captcha/images/captcha_976.png +data/captcha/images/captcha_745.png +data/captcha/images/captcha_800.png +data/captcha/images/captcha_997.png +data/captcha/images/captcha_817.png +data/captcha/images/captcha_649.png +data/captcha/images/captcha_342.png +data/captcha/images/captcha_661.png +data/captcha/images/captcha_497.png +data/captcha/images/captcha_463.png +data/captcha/images/captcha_399.png +data/captcha/images/captcha_488.png +data/captcha/images/captcha_1.png +data/captcha/images/captcha_811.png +data/captcha/images/captcha_553.png +data/captcha/images/captcha_281.png +data/captcha/images/captcha_981.png +data/captcha/images/captcha_576.png +data/captcha/images/captcha_271.png +data/captcha/images/captcha_701.png +data/captcha/images/captcha_317.png +data/captcha/images/captcha_173.png +data/captcha/images/captcha_914.png +data/captcha/images/captcha_659.png +data/captcha/images/captcha_492.png +data/captcha/images/captcha_594.png +data/captcha/images/captcha_83.png +data/captcha/images/captcha_379.png +data/captcha/images/captcha_972.png +data/captcha/images/captcha_647.png +data/captcha/images/captcha_1000.png +data/captcha/images/captcha_406.png +data/captcha/images/captcha_717.png +data/captcha/images/captcha_691.png +data/captcha/images/captcha_424.png +data/captcha/images/captcha_304.png +data/captcha/images/captcha_481.png +data/captcha/images/captcha_39.png +data/captcha/images/captcha_220.png +data/captcha/images/captcha_484.png +data/captcha/images/captcha_280.png +data/captcha/images/captcha_479.png +data/captcha/images/captcha_874.png +data/captcha/images/captcha_902.png +data/captcha/images/captcha_137.png +data/captcha/images/captcha_180.png +data/captcha/images/captcha_593.png +data/captcha/images/captcha_545.png +data/captcha/images/captcha_802.png +data/captcha/images/captcha_969.png +data/captcha/images/captcha_224.png +data/captcha/images/captcha_135.png +data/captcha/images/captcha_873.png +data/captcha/images/captcha_725.png +data/captcha/images/captcha_323.png +data/captcha/images/captcha_221.png +data/captcha/images/captcha_692.png +data/captcha/images/captcha_927.png +data/captcha/images/captcha_34.png +data/captcha/images/captcha_558.png +data/captcha/images/captcha_741.png +data/captcha/images/captcha_437.png +data/captcha/images/captcha_549.png +data/captcha/images/captcha_582.png +data/captcha/images/captcha_724.png +data/captcha/images/captcha_238.png diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/detect.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/detect.py new file mode 100644 index 0000000..76346ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/detect.py @@ -0,0 +1,147 @@ +from __future__ import division + +from models import * +from utils.utils import * +from utils.datasets import * +from os.path import dirname, join +import os +import sys +import time +import datetime +import argparse + +from PIL import Image + +import torch +from torch.utils.data import DataLoader +from torchvision import datasets +from torch.autograd import Variable + +import matplotlib.pyplot as plt +import matplotlib.patches as patches +from matplotlib.ticker import NullLocator +import numpy as np + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--image_folder", type=str, default="data/samples", help="path to dataset") + parser.add_argument("--model_def", type=str, default="config/yolov3.cfg", help="path to model definition file") + parser.add_argument("--weights_path", type=str, default="weights/yolov3.weights", help="path to weights file") + parser.add_argument("--class_path", type=str, default="data/coco.names", help="path to class label file") + parser.add_argument("--conf_thres", type=float, default=0.7, help="object confidence threshold") + parser.add_argument("--nms_thres", type=float, default=0.4, help="iou thresshold for non-maximum suppression") + parser.add_argument("--batch_size", type=int, default=1, help="size of the batches") + parser.add_argument("--n_cpu", type=int, default=0, help="number of cpu threads to use during batch generation") + parser.add_argument("--img_size", type=int, default=416, help="size of each image dimension") + parser.add_argument("--checkpoint_model", type=str, help="path to checkpoint model") + opt = parser.parse_args() + print(opt) + + device = torch.device("cuda" if torch.cuda.is_available() else "cpu") + + output_folder = join(dirname(opt.image_folder), 'result') + + os.makedirs(output_folder, exist_ok=True) + + # Set up model + model = Darknet(opt.model_def, img_size=opt.img_size).to(device) + + if opt.weights_path.endswith(".weights"): + # Load darknet weights + model.load_darknet_weights(opt.weights_path) + else: + # Load checkpoint weights + # model.load_state_dict(torch.load(opt.weights_path)) + model.load_state_dict(torch.load(opt.weights_path, map_location="cuda" if torch.cuda.is_available() else "cpu")) + + + model.eval() # Set in evaluation mode + + dataloader = DataLoader( + ImageFolder(opt.image_folder, img_size=opt.img_size), + batch_size=opt.batch_size, + shuffle=False, + num_workers=opt.n_cpu, + ) + + classes = load_classes(opt.class_path) # Extracts class labels from file + + Tensor = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor + + imgs = [] # Stores image paths + img_detections = [] # Stores detections for each image index + + print("\nPerforming object detection:") + prev_time = time.time() + for batch_i, (img_paths, input_imgs) in enumerate(dataloader): + # Configure input + input_imgs = Variable(input_imgs.type(Tensor)) + + # Get detections + with torch.no_grad(): + detections = model(input_imgs) + detections = non_max_suppression(detections, opt.conf_thres, opt.nms_thres) + + # Log progress + current_time = time.time() + inference_time = datetime.timedelta(seconds=current_time - prev_time) + prev_time = current_time + print("\t+ Batch %d, Inference Time: %s" % (batch_i, inference_time)) + + # Save image and detections + imgs.extend(img_paths) + img_detections.extend(detections) + + # Bounding-box colors + cmap = plt.get_cmap("tab20b") + colors = [cmap(i) for i in np.linspace(0, 1, 20)] + + print("\nSaving images:") + # Iterate through images and save plot of detections + for img_i, (path, detections) in enumerate(zip(imgs, img_detections)): + + print("(%d) Image: '%s'" % (img_i, path)) + + # Create plot + img = np.array(Image.open(path)) + plt.figure() + fig, ax = plt.subplots(1) + ax.imshow(img) + + # Draw bounding boxes and labels of detections + if detections is not None: + # Rescale boxes to original image + detections = rescale_boxes(detections, opt.img_size, img.shape[:2]) + unique_labels = detections[:, -1].cpu().unique() + n_cls_preds = len(unique_labels) + bbox_colors = random.sample(colors, n_cls_preds) + for x1, y1, x2, y2, conf, cls_conf, cls_pred in detections: + print("\t+ Label: %s, Conf: %.5f" % (classes[int(cls_pred)], cls_conf.item())) + + box_w = x2 - x1 + box_h = y2 - y1 + color = bbox_colors[int(np.where(unique_labels == int(cls_pred))[0])] + # Create a Rectangle patch + bbox = patches.Rectangle((x1 + box_w / 2, y1 + box_h / 2), box_w, box_h, linewidth=2, edgecolor=color, facecolor="none") + print('bbox', (x1, y1, box_w, box_h), 'offset', x1) + # Add the bbox to the plot + ax.add_patch(bbox) + # Add label + plt.text( + x1, + y1, + s=classes[int(cls_pred)], + color="white", + verticalalignment="top", + bbox={"color": color, "pad": 0}, + ) + # only one + break + + # Save generated image with detections + plt.axis("off") + plt.gca().xaxis.set_major_locator(NullLocator()) + plt.gca().yaxis.set_major_locator(NullLocator()) + filename = path.split("/")[-1].split(".")[0] + plt.savefig(f"{output_folder}/{filename}.png", bbox_inches="tight", pad_inches=0.0) + plt.close() diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/detect.sh b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/detect.sh new file mode 100644 index 0000000..0a0b94d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/detect.sh @@ -0,0 +1 @@ +python3 detect.py --model_def config/yolov3-captcha.cfg --weights_path checkpoints/yolov3_ckpt_2.pth --image_folder data/captcha/test --class_path data/captcha/classes.names diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/models.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/models.py new file mode 100644 index 0000000..f89ca29 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/models.py @@ -0,0 +1,348 @@ +from __future__ import division + +import torch +import torch.nn as nn +import torch.nn.functional as F +from torch.autograd import Variable +import numpy as np + +from utils.parse_config import * +from utils.utils import build_targets, to_cpu, non_max_suppression + +import matplotlib.pyplot as plt +import matplotlib.patches as patches + + +def create_modules(module_defs): + """ + Constructs module list of layer blocks from module configuration in module_defs + """ + hyperparams = module_defs.pop(0) + output_filters = [int(hyperparams["channels"])] + module_list = nn.ModuleList() + for module_i, module_def in enumerate(module_defs): + modules = nn.Sequential() + + if module_def["type"] == "convolutional": + bn = int(module_def["batch_normalize"]) + filters = int(module_def["filters"]) + kernel_size = int(module_def["size"]) + pad = (kernel_size - 1) // 2 + modules.add_module( + f"conv_{module_i}", + nn.Conv2d( + in_channels=output_filters[-1], + out_channels=filters, + kernel_size=kernel_size, + stride=int(module_def["stride"]), + padding=pad, + bias=not bn, + ), + ) + if bn: + modules.add_module(f"batch_norm_{module_i}", nn.BatchNorm2d(filters, momentum=0.9, eps=1e-5)) + if module_def["activation"] == "leaky": + modules.add_module(f"leaky_{module_i}", nn.LeakyReLU(0.1)) + + elif module_def["type"] == "maxpool": + kernel_size = int(module_def["size"]) + stride = int(module_def["stride"]) + if kernel_size == 2 and stride == 1: + modules.add_module(f"_debug_padding_{module_i}", nn.ZeroPad2d((0, 1, 0, 1))) + maxpool = nn.MaxPool2d(kernel_size=kernel_size, stride=stride, padding=int((kernel_size - 1) // 2)) + modules.add_module(f"maxpool_{module_i}", maxpool) + + elif module_def["type"] == "upsample": + upsample = Upsample(scale_factor=int(module_def["stride"]), mode="nearest") + modules.add_module(f"upsample_{module_i}", upsample) + + elif module_def["type"] == "route": + layers = [int(x) for x in module_def["layers"].split(",")] + filters = sum([output_filters[1:][i] for i in layers]) + modules.add_module(f"route_{module_i}", EmptyLayer()) + + elif module_def["type"] == "shortcut": + filters = output_filters[1:][int(module_def["from"])] + modules.add_module(f"shortcut_{module_i}", EmptyLayer()) + + elif module_def["type"] == "yolo": + anchor_idxs = [int(x) for x in module_def["mask"].split(",")] + # Extract anchors + anchors = [int(x) for x in module_def["anchors"].split(",")] + anchors = [(anchors[i], anchors[i + 1]) for i in range(0, len(anchors), 2)] + anchors = [anchors[i] for i in anchor_idxs] + num_classes = int(module_def["classes"]) + img_size = int(hyperparams["height"]) + # Define detection layer + yolo_layer = YOLOLayer(anchors, num_classes, img_size) + modules.add_module(f"yolo_{module_i}", yolo_layer) + # Register module list and number of output filters + module_list.append(modules) + output_filters.append(filters) + + return hyperparams, module_list + + +class Upsample(nn.Module): + """ nn.Upsample is deprecated """ + + def __init__(self, scale_factor, mode="nearest"): + super(Upsample, self).__init__() + self.scale_factor = scale_factor + self.mode = mode + + def forward(self, x): + x = F.interpolate(x, scale_factor=self.scale_factor, mode=self.mode) + return x + + +class EmptyLayer(nn.Module): + """Placeholder for 'route' and 'shortcut' layers""" + + def __init__(self): + super(EmptyLayer, self).__init__() + + +class YOLOLayer(nn.Module): + """Detection layer""" + + def __init__(self, anchors, num_classes, img_dim=416): + super(YOLOLayer, self).__init__() + self.anchors = anchors + self.num_anchors = len(anchors) + self.num_classes = num_classes + self.ignore_thres = 0.5 + self.mse_loss = nn.MSELoss() + self.bce_loss = nn.BCELoss() + self.obj_scale = 1 + self.noobj_scale = 100 + self.metrics = {} + self.img_dim = img_dim + self.grid_size = 0 # grid size + + def compute_grid_offsets(self, grid_size, cuda=True): + self.grid_size = grid_size + g = self.grid_size + FloatTensor = torch.cuda.FloatTensor if cuda else torch.FloatTensor + self.stride = self.img_dim / self.grid_size + # Calculate offsets for each grid + self.grid_x = torch.arange(g).repeat(g, 1).view([1, 1, g, g]).type(FloatTensor) + self.grid_y = torch.arange(g).repeat(g, 1).t().view([1, 1, g, g]).type(FloatTensor) + self.scaled_anchors = FloatTensor([(a_w / self.stride, a_h / self.stride) for a_w, a_h in self.anchors]) + self.anchor_w = self.scaled_anchors[:, 0:1].view((1, self.num_anchors, 1, 1)) + self.anchor_h = self.scaled_anchors[:, 1:2].view((1, self.num_anchors, 1, 1)) + + def forward(self, x, targets=None, img_dim=None): + + # Tensors for cuda support + FloatTensor = torch.cuda.FloatTensor if x.is_cuda else torch.FloatTensor + LongTensor = torch.cuda.LongTensor if x.is_cuda else torch.LongTensor + ByteTensor = torch.cuda.ByteTensor if x.is_cuda else torch.ByteTensor + + self.img_dim = img_dim + num_samples = x.size(0) + grid_size = x.size(2) + + prediction = ( + x.view(num_samples, self.num_anchors, self.num_classes + 5, grid_size, grid_size) + .permute(0, 1, 3, 4, 2) + .contiguous() + ) + + # Get outputs + x = torch.sigmoid(prediction[..., 0]) # Center x + y = torch.sigmoid(prediction[..., 1]) # Center y + w = prediction[..., 2] # Width + h = prediction[..., 3] # Height + pred_conf = torch.sigmoid(prediction[..., 4]) # Conf + pred_cls = torch.sigmoid(prediction[..., 5:]) # Cls pred. + + # If grid size does not match current we compute new offsets + if grid_size != self.grid_size: + self.compute_grid_offsets(grid_size, cuda=x.is_cuda) + + # Add offset and scale with anchors + pred_boxes = FloatTensor(prediction[..., :4].shape) + pred_boxes[..., 0] = x.data + self.grid_x + pred_boxes[..., 1] = y.data + self.grid_y + pred_boxes[..., 2] = torch.exp(w.data) * self.anchor_w + pred_boxes[..., 3] = torch.exp(h.data) * self.anchor_h + + output = torch.cat( + ( + pred_boxes.view(num_samples, -1, 4) * self.stride, + pred_conf.view(num_samples, -1, 1), + pred_cls.view(num_samples, -1, self.num_classes), + ), + -1, + ) + + if targets is None: + return output, 0 + else: + iou_scores, class_mask, obj_mask, noobj_mask, tx, ty, tw, th, tcls, tconf = build_targets( + pred_boxes=pred_boxes, + pred_cls=pred_cls, + target=targets, + anchors=self.scaled_anchors, + ignore_thres=self.ignore_thres, + ) + + obj_mask = obj_mask.bool() + noobj_mask = noobj_mask.bool() + + # Loss : Mask outputs to ignore non-existing objects (except with conf. loss) + loss_x = self.mse_loss(x[obj_mask], tx[obj_mask]) + loss_y = self.mse_loss(y[obj_mask], ty[obj_mask]) + loss_w = self.mse_loss(w[obj_mask], tw[obj_mask]) + loss_h = self.mse_loss(h[obj_mask], th[obj_mask]) + loss_conf_obj = self.bce_loss(pred_conf[obj_mask], tconf[obj_mask]) + loss_conf_noobj = self.bce_loss(pred_conf[noobj_mask], tconf[noobj_mask]) + loss_conf = self.obj_scale * loss_conf_obj + self.noobj_scale * loss_conf_noobj + loss_cls = self.bce_loss(pred_cls[obj_mask], tcls[obj_mask]) + total_loss = loss_x + loss_y + loss_w + loss_h + loss_conf + loss_cls + + # Metrics + cls_acc = 100 * class_mask[obj_mask].mean() + conf_obj = pred_conf[obj_mask].mean() + conf_noobj = pred_conf[noobj_mask].mean() + conf50 = (pred_conf > 0.5).float() + iou50 = (iou_scores > 0.5).float() + iou75 = (iou_scores > 0.75).float() + detected_mask = conf50 * class_mask * tconf + precision = torch.sum(iou50 * detected_mask) / (conf50.sum() + 1e-16) + recall50 = torch.sum(iou50 * detected_mask) / (obj_mask.sum() + 1e-16) + recall75 = torch.sum(iou75 * detected_mask) / (obj_mask.sum() + 1e-16) + + self.metrics = { + "loss": to_cpu(total_loss).item(), + "x": to_cpu(loss_x).item(), + "y": to_cpu(loss_y).item(), + "w": to_cpu(loss_w).item(), + "h": to_cpu(loss_h).item(), + "conf": to_cpu(loss_conf).item(), + "cls": to_cpu(loss_cls).item(), + "cls_acc": to_cpu(cls_acc).item(), + "recall50": to_cpu(recall50).item(), + "recall75": to_cpu(recall75).item(), + "precision": to_cpu(precision).item(), + "conf_obj": to_cpu(conf_obj).item(), + "conf_noobj": to_cpu(conf_noobj).item(), + "grid_size": grid_size, + } + + return output, total_loss + + +class Darknet(nn.Module): + """YOLOv3 object detection model""" + + def __init__(self, config_path, img_size=416): + super(Darknet, self).__init__() + self.module_defs = parse_model_config(config_path) + self.hyperparams, self.module_list = create_modules(self.module_defs) + self.yolo_layers = [layer[0] for layer in self.module_list if hasattr(layer[0], "metrics")] + self.img_size = img_size + self.seen = 0 + self.header_info = np.array([0, 0, 0, self.seen, 0], dtype=np.int32) + + def forward(self, x, targets=None): + img_dim = x.shape[2] + loss = 0 + layer_outputs, yolo_outputs = [], [] + for i, (module_def, module) in enumerate(zip(self.module_defs, self.module_list)): + if module_def["type"] in ["convolutional", "upsample", "maxpool"]: + x = module(x) + elif module_def["type"] == "route": + x = torch.cat([layer_outputs[int(layer_i)] for layer_i in module_def["layers"].split(",")], 1) + elif module_def["type"] == "shortcut": + layer_i = int(module_def["from"]) + x = layer_outputs[-1] + layer_outputs[layer_i] + elif module_def["type"] == "yolo": + x, layer_loss = module[0](x, targets, img_dim) + loss += layer_loss + yolo_outputs.append(x) + layer_outputs.append(x) + yolo_outputs = to_cpu(torch.cat(yolo_outputs, 1)) + return yolo_outputs if targets is None else (loss, yolo_outputs) + + def load_darknet_weights(self, weights_path): + """Parses and loads the weights stored in 'weights_path'""" + + # Open the weights file + with open(weights_path, "rb") as f: + header = np.fromfile(f, dtype=np.int32, count=5) # First five are header values + self.header_info = header # Needed to write header when saving weights + self.seen = header[3] # number of images seen during training + weights = np.fromfile(f, dtype=np.float32) # The rest are weights + + # Establish cutoff for loading backbone weights + cutoff = None + if "darknet53.conv.74" in weights_path: + cutoff = 75 + + ptr = 0 + for i, (module_def, module) in enumerate(zip(self.module_defs, self.module_list)): + if i == cutoff: + break + if module_def["type"] == "convolutional": + conv_layer = module[0] + if module_def["batch_normalize"]: + # Load BN bias, weights, running mean and running variance + bn_layer = module[1] + num_b = bn_layer.bias.numel() # Number of biases + # Bias + bn_b = torch.from_numpy(weights[ptr : ptr + num_b]).view_as(bn_layer.bias) + bn_layer.bias.data.copy_(bn_b) + ptr += num_b + # Weight + bn_w = torch.from_numpy(weights[ptr : ptr + num_b]).view_as(bn_layer.weight) + bn_layer.weight.data.copy_(bn_w) + ptr += num_b + # Running Mean + bn_rm = torch.from_numpy(weights[ptr : ptr + num_b]).view_as(bn_layer.running_mean) + bn_layer.running_mean.data.copy_(bn_rm) + ptr += num_b + # Running Var + bn_rv = torch.from_numpy(weights[ptr : ptr + num_b]).view_as(bn_layer.running_var) + bn_layer.running_var.data.copy_(bn_rv) + ptr += num_b + else: + # Load conv. bias + num_b = conv_layer.bias.numel() + conv_b = torch.from_numpy(weights[ptr : ptr + num_b]).view_as(conv_layer.bias) + conv_layer.bias.data.copy_(conv_b) + ptr += num_b + # Load conv. weights + num_w = conv_layer.weight.numel() + conv_w = torch.from_numpy(weights[ptr : ptr + num_w]).view_as(conv_layer.weight) + conv_layer.weight.data.copy_(conv_w) + ptr += num_w + + def save_darknet_weights(self, path, cutoff=-1): + """ + @:param path - path of the new weights file + @:param cutoff - save layers between 0 and cutoff (cutoff = -1 -> all are saved) + """ + fp = open(path, "wb") + self.header_info[3] = self.seen + self.header_info.tofile(fp) + + # Iterate through layers + for i, (module_def, module) in enumerate(zip(self.module_defs[:cutoff], self.module_list[:cutoff])): + if module_def["type"] == "convolutional": + conv_layer = module[0] + # If batch norm, load bn first + if module_def["batch_normalize"]: + bn_layer = module[1] + bn_layer.bias.data.cpu().numpy().tofile(fp) + bn_layer.weight.data.cpu().numpy().tofile(fp) + bn_layer.running_mean.data.cpu().numpy().tofile(fp) + bn_layer.running_var.data.cpu().numpy().tofile(fp) + # Load conv bias + else: + conv_layer.bias.data.cpu().numpy().tofile(fp) + # Load conv weights + conv_layer.weight.data.cpu().numpy().tofile(fp) + + fp.close() diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/prepare.sh b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/prepare.sh new file mode 100644 index 0000000..a6ba0ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/prepare.sh @@ -0,0 +1,11 @@ +#!/bin/bash + + +cd weights + +# Download weights for vanilla YOLOv3 +wget -c https://pjreddie.com/media/files/yolov3.weights +# # Download weights for tiny YOLOv3 +wget -c https://pjreddie.com/media/files/yolov3-tiny.weights +# Download weights for backbone network +wget -c https://pjreddie.com/media/files/darknet53.conv.74 diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/block_source.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/block_source.png new file mode 100644 index 0000000..bb5a2c8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/block_source.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/block_target.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/block_target.png new file mode 100644 index 0000000..d14323f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/block_target.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_0.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_0.png new file mode 100644 index 0000000..8c8dcd3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_0.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_1.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_1.png new file mode 100644 index 0000000..63718d7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_1.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_10.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_10.png new file mode 100644 index 0000000..e9f4672 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_10.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_100.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_100.png new file mode 100644 index 0000000..bb216ad Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_100.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_1000.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_1000.png new file mode 100644 index 0000000..1683ce7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_1000.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_101.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_101.png new file mode 100644 index 0000000..005a831 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_101.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_102.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_102.png new file mode 100644 index 0000000..8dd86a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_102.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_103.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_103.png new file mode 100644 index 0000000..efbe795 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_103.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_104.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_104.png new file mode 100644 index 0000000..dde90a1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_104.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_105.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_105.png new file mode 100644 index 0000000..7fc74f8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_105.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_106.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_106.png new file mode 100644 index 0000000..78d57fb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_106.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_107.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_107.png new file mode 100644 index 0000000..4a5102c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_107.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_108.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_108.png new file mode 100644 index 0000000..d6266cb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_108.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_109.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_109.png new file mode 100644 index 0000000..90b25cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_109.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_11.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_11.png new file mode 100644 index 0000000..6e4b9ed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_11.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_110.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_110.png new file mode 100644 index 0000000..b066399 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_110.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_111.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_111.png new file mode 100644 index 0000000..77a3849 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_111.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_112.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_112.png new file mode 100644 index 0000000..78167fb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_112.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_113.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_113.png new file mode 100644 index 0000000..c29b5af Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_113.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_114.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_114.png new file mode 100644 index 0000000..8241cfb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_114.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_115.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_115.png new file mode 100644 index 0000000..a492c7c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_115.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_116.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_116.png new file mode 100644 index 0000000..04dbd40 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_116.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_117.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_117.png new file mode 100644 index 0000000..8939762 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_117.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_118.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_118.png new file mode 100644 index 0000000..b2dce44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_118.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_119.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_119.png new file mode 100644 index 0000000..00429e1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_119.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_12.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_12.png new file mode 100644 index 0000000..55c198b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_12.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_120.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_120.png new file mode 100644 index 0000000..a091ae9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_120.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_121.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_121.png new file mode 100644 index 0000000..b477e01 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_121.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_122.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_122.png new file mode 100644 index 0000000..b870f79 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_122.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_123.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_123.png new file mode 100644 index 0000000..1bc07f7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_123.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_124.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_124.png new file mode 100644 index 0000000..6933fca Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_124.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_125.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_125.png new file mode 100644 index 0000000..7f0eb8f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_125.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_126.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_126.png new file mode 100644 index 0000000..720d376 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_126.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_127.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_127.png new file mode 100644 index 0000000..f118db5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_127.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_128.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_128.png new file mode 100644 index 0000000..12eefd6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_128.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_129.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_129.png new file mode 100644 index 0000000..53143d5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_129.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_13.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_13.png new file mode 100644 index 0000000..d4e7e09 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_13.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_130.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_130.png new file mode 100644 index 0000000..e4e757f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_130.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_131.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_131.png new file mode 100644 index 0000000..a6d0b7b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_131.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_132.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_132.png new file mode 100644 index 0000000..f836299 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_132.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_133.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_133.png new file mode 100644 index 0000000..851cc6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_133.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_134.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_134.png new file mode 100644 index 0000000..772321d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_134.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_135.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_135.png new file mode 100644 index 0000000..fd5f9ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_135.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_136.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_136.png new file mode 100644 index 0000000..447c455 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_136.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_137.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_137.png new file mode 100644 index 0000000..69938e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_137.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_138.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_138.png new file mode 100644 index 0000000..9858214 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_138.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_139.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_139.png new file mode 100644 index 0000000..82f781e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_139.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_14.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_14.png new file mode 100644 index 0000000..fddd57d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_14.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_140.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_140.png new file mode 100644 index 0000000..b01ed26 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_140.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_141.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_141.png new file mode 100644 index 0000000..329fdd2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_141.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_142.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_142.png new file mode 100644 index 0000000..bd8f8a0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_142.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_143.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_143.png new file mode 100644 index 0000000..01a5dd2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_143.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_144.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_144.png new file mode 100644 index 0000000..e95123b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_144.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_145.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_145.png new file mode 100644 index 0000000..1d2ea3a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_145.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_146.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_146.png new file mode 100644 index 0000000..79f9933 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_146.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_147.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_147.png new file mode 100644 index 0000000..b8cdad3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_147.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_148.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_148.png new file mode 100644 index 0000000..e9c6196 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_148.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_149.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_149.png new file mode 100644 index 0000000..49e7e49 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_149.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_15.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_15.png new file mode 100644 index 0000000..15d38d6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_15.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_150.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_150.png new file mode 100644 index 0000000..c26f554 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_150.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_151.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_151.png new file mode 100644 index 0000000..b4c9907 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_151.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_152.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_152.png new file mode 100644 index 0000000..ca2ec08 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_152.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_153.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_153.png new file mode 100644 index 0000000..0cc9233 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_153.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_154.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_154.png new file mode 100644 index 0000000..7d80659 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_154.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_155.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_155.png new file mode 100644 index 0000000..e9282bf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_155.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_156.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_156.png new file mode 100644 index 0000000..317b998 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_156.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_157.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_157.png new file mode 100644 index 0000000..51b8d94 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_157.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_158.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_158.png new file mode 100644 index 0000000..e4b54c0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_158.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_159.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_159.png new file mode 100644 index 0000000..dd62cb4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_159.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_16.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_16.png new file mode 100644 index 0000000..390ba94 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_16.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_160.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_160.png new file mode 100644 index 0000000..cb993ae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_160.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_161.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_161.png new file mode 100644 index 0000000..ec1994c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_161.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_162.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_162.png new file mode 100644 index 0000000..c822a15 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_162.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_163.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_163.png new file mode 100644 index 0000000..0f39a7e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_163.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_164.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_164.png new file mode 100644 index 0000000..80e24e1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_164.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_165.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_165.png new file mode 100644 index 0000000..917f379 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_165.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_166.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_166.png new file mode 100644 index 0000000..bb84a3a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_166.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_167.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_167.png new file mode 100644 index 0000000..706b497 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_167.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_168.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_168.png new file mode 100644 index 0000000..ad1c6a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_168.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_169.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_169.png new file mode 100644 index 0000000..82a3cb7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_169.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_17.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_17.png new file mode 100644 index 0000000..87e4ecf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_17.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_170.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_170.png new file mode 100644 index 0000000..613b27c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_170.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_171.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_171.png new file mode 100644 index 0000000..4686471 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_171.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_172.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_172.png new file mode 100644 index 0000000..53c6f91 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_172.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_173.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_173.png new file mode 100644 index 0000000..d07399d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_173.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_174.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_174.png new file mode 100644 index 0000000..6ff09e8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_174.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_175.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_175.png new file mode 100644 index 0000000..b2c7da7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_175.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_176.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_176.png new file mode 100644 index 0000000..cdd9db1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_176.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_177.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_177.png new file mode 100644 index 0000000..095ed38 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_177.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_178.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_178.png new file mode 100644 index 0000000..76806f7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_178.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_179.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_179.png new file mode 100644 index 0000000..fca37ee Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_179.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_18.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_18.png new file mode 100644 index 0000000..514edaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_18.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_180.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_180.png new file mode 100644 index 0000000..162fb29 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_180.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_181.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_181.png new file mode 100644 index 0000000..097f58a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_181.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_182.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_182.png new file mode 100644 index 0000000..8e9463b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_182.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_183.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_183.png new file mode 100644 index 0000000..3ca7f60 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_183.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_184.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_184.png new file mode 100644 index 0000000..d96aa7d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_184.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_185.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_185.png new file mode 100644 index 0000000..a0c1a1e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_185.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_186.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_186.png new file mode 100644 index 0000000..e44083d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_186.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_187.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_187.png new file mode 100644 index 0000000..be3f2ba Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_187.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_188.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_188.png new file mode 100644 index 0000000..13d80e8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_188.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_189.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_189.png new file mode 100644 index 0000000..8638f76 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_189.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_19.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_19.png new file mode 100644 index 0000000..a56d900 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_19.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_190.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_190.png new file mode 100644 index 0000000..45fb970 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_190.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_191.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_191.png new file mode 100644 index 0000000..175c721 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_191.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_192.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_192.png new file mode 100644 index 0000000..7ca2dd0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_192.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_193.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_193.png new file mode 100644 index 0000000..62602eb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_193.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_194.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_194.png new file mode 100644 index 0000000..3447cf7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_194.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_195.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_195.png new file mode 100644 index 0000000..849d4e1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_195.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_196.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_196.png new file mode 100644 index 0000000..2c86e66 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_196.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_197.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_197.png new file mode 100644 index 0000000..eab092e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_197.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_198.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_198.png new file mode 100644 index 0000000..ea3c601 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_198.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_199.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_199.png new file mode 100644 index 0000000..0fd8d28 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_199.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_2.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_2.png new file mode 100644 index 0000000..cdde274 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_2.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_20.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_20.png new file mode 100644 index 0000000..714dd47 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_20.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_200.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_200.png new file mode 100644 index 0000000..b094e7d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_200.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_201.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_201.png new file mode 100644 index 0000000..60c0660 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_201.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_202.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_202.png new file mode 100644 index 0000000..2db9cda Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_202.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_203.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_203.png new file mode 100644 index 0000000..388ca94 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_203.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_204.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_204.png new file mode 100644 index 0000000..0ad0d2a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_204.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_205.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_205.png new file mode 100644 index 0000000..0800a77 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_205.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_206.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_206.png new file mode 100644 index 0000000..5b37b4f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_206.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_207.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_207.png new file mode 100644 index 0000000..5b8e996 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_207.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_208.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_208.png new file mode 100644 index 0000000..745ff14 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_208.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_209.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_209.png new file mode 100644 index 0000000..709ae63 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_209.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_21.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_21.png new file mode 100644 index 0000000..4f71111 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_21.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_210.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_210.png new file mode 100644 index 0000000..761da54 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_210.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_211.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_211.png new file mode 100644 index 0000000..0e7ca89 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_211.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_212.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_212.png new file mode 100644 index 0000000..b76005d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_212.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_213.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_213.png new file mode 100644 index 0000000..25fd6ff Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_213.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_214.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_214.png new file mode 100644 index 0000000..b392767 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_214.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_215.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_215.png new file mode 100644 index 0000000..ee1209b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_215.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_216.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_216.png new file mode 100644 index 0000000..af35f44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_216.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_217.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_217.png new file mode 100644 index 0000000..b7f4e9e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_217.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_218.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_218.png new file mode 100644 index 0000000..1fbfb65 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_218.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_219.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_219.png new file mode 100644 index 0000000..a72688a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_219.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_22.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_22.png new file mode 100644 index 0000000..62bfcac Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_22.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_220.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_220.png new file mode 100644 index 0000000..da10d48 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_220.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_221.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_221.png new file mode 100644 index 0000000..c25486f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_221.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_222.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_222.png new file mode 100644 index 0000000..37d0be9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_222.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_223.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_223.png new file mode 100644 index 0000000..52742f0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_223.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_224.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_224.png new file mode 100644 index 0000000..c663473 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_224.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_225.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_225.png new file mode 100644 index 0000000..acb8416 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_225.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_226.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_226.png new file mode 100644 index 0000000..eb01551 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_226.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_227.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_227.png new file mode 100644 index 0000000..8b9bcaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_227.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_228.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_228.png new file mode 100644 index 0000000..6e08407 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_228.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_229.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_229.png new file mode 100644 index 0000000..3f2e10e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_229.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_23.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_23.png new file mode 100644 index 0000000..8ca1088 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_23.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_230.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_230.png new file mode 100644 index 0000000..f0bbdac Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_230.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_231.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_231.png new file mode 100644 index 0000000..fdaeb33 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_231.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_232.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_232.png new file mode 100644 index 0000000..7f0df40 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_232.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_233.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_233.png new file mode 100644 index 0000000..63912fe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_233.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_234.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_234.png new file mode 100644 index 0000000..422b2e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_234.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_235.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_235.png new file mode 100644 index 0000000..bea5966 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_235.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_236.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_236.png new file mode 100644 index 0000000..115e40a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_236.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_237.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_237.png new file mode 100644 index 0000000..df30435 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_237.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_238.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_238.png new file mode 100644 index 0000000..5ddf576 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_238.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_239.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_239.png new file mode 100644 index 0000000..2f6bec3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_239.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_24.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_24.png new file mode 100644 index 0000000..cc8a2b3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_24.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_240.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_240.png new file mode 100644 index 0000000..b61b120 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_240.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_241.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_241.png new file mode 100644 index 0000000..2708a71 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_241.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_242.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_242.png new file mode 100644 index 0000000..58237ab Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_242.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_243.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_243.png new file mode 100644 index 0000000..e92bfa3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_243.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_244.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_244.png new file mode 100644 index 0000000..32f5010 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_244.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_245.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_245.png new file mode 100644 index 0000000..5989025 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_245.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_246.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_246.png new file mode 100644 index 0000000..55003e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_246.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_247.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_247.png new file mode 100644 index 0000000..90a8880 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_247.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_248.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_248.png new file mode 100644 index 0000000..32f2447 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_248.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_249.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_249.png new file mode 100644 index 0000000..67eb314 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_249.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_25.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_25.png new file mode 100644 index 0000000..271b816 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_25.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_250.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_250.png new file mode 100644 index 0000000..a216d29 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_250.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_251.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_251.png new file mode 100644 index 0000000..1f50ff1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_251.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_252.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_252.png new file mode 100644 index 0000000..cbda673 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_252.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_253.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_253.png new file mode 100644 index 0000000..b477457 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_253.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_254.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_254.png new file mode 100644 index 0000000..24265a1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_254.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_255.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_255.png new file mode 100644 index 0000000..3fd75be Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_255.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_256.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_256.png new file mode 100644 index 0000000..a23f440 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_256.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_257.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_257.png new file mode 100644 index 0000000..c3ab7db Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_257.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_258.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_258.png new file mode 100644 index 0000000..92290ae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_258.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_259.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_259.png new file mode 100644 index 0000000..20d8ba4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_259.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_26.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_26.png new file mode 100644 index 0000000..0f105e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_26.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_260.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_260.png new file mode 100644 index 0000000..fcc8f98 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_260.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_261.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_261.png new file mode 100644 index 0000000..7c4fb2c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_261.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_262.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_262.png new file mode 100644 index 0000000..22d40d6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_262.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_263.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_263.png new file mode 100644 index 0000000..8f541f2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_263.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_264.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_264.png new file mode 100644 index 0000000..d6b9b6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_264.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_265.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_265.png new file mode 100644 index 0000000..59a182b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_265.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_266.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_266.png new file mode 100644 index 0000000..0561f35 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_266.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_267.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_267.png new file mode 100644 index 0000000..560fde4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_267.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_268.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_268.png new file mode 100644 index 0000000..64e4625 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_268.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_269.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_269.png new file mode 100644 index 0000000..5564b8c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_269.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_27.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_27.png new file mode 100644 index 0000000..4e5699e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_27.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_270.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_270.png new file mode 100644 index 0000000..bc162a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_270.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_271.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_271.png new file mode 100644 index 0000000..b7a1173 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_271.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_272.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_272.png new file mode 100644 index 0000000..10c3fae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_272.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_273.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_273.png new file mode 100644 index 0000000..240fc12 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_273.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_274.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_274.png new file mode 100644 index 0000000..a14eb9b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_274.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_275.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_275.png new file mode 100644 index 0000000..f19c35c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_275.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_276.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_276.png new file mode 100644 index 0000000..1608246 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_276.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_277.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_277.png new file mode 100644 index 0000000..f9ba2ff Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_277.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_278.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_278.png new file mode 100644 index 0000000..635f080 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_278.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_279.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_279.png new file mode 100644 index 0000000..06300ba Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_279.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_28.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_28.png new file mode 100644 index 0000000..528edb5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_28.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_280.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_280.png new file mode 100644 index 0000000..d8d4eba Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_280.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_281.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_281.png new file mode 100644 index 0000000..8c4c30d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_281.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_282.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_282.png new file mode 100644 index 0000000..b81a83d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_282.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_283.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_283.png new file mode 100644 index 0000000..c8172b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_283.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_284.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_284.png new file mode 100644 index 0000000..0a52ace Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_284.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_285.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_285.png new file mode 100644 index 0000000..5c703a5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_285.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_286.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_286.png new file mode 100644 index 0000000..d8cfc6a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_286.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_287.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_287.png new file mode 100644 index 0000000..1d2ce9f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_287.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_288.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_288.png new file mode 100644 index 0000000..e5096c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_288.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_289.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_289.png new file mode 100644 index 0000000..d00db0a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_289.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_29.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_29.png new file mode 100644 index 0000000..fd1be6e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_29.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_290.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_290.png new file mode 100644 index 0000000..01ab05e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_290.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_291.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_291.png new file mode 100644 index 0000000..fadffc9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_291.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_292.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_292.png new file mode 100644 index 0000000..573f798 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_292.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_293.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_293.png new file mode 100644 index 0000000..b0d8da8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_293.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_294.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_294.png new file mode 100644 index 0000000..8fa40ed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_294.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_295.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_295.png new file mode 100644 index 0000000..cbc19ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_295.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_296.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_296.png new file mode 100644 index 0000000..e11e20f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_296.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_297.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_297.png new file mode 100644 index 0000000..c632a86 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_297.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_298.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_298.png new file mode 100644 index 0000000..8b28329 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_298.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_299.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_299.png new file mode 100644 index 0000000..b30ba5a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_299.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_3.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_3.png new file mode 100644 index 0000000..f76fa51 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_3.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_30.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_30.png new file mode 100644 index 0000000..29265d1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_30.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_300.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_300.png new file mode 100644 index 0000000..f23049e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_300.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_301.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_301.png new file mode 100644 index 0000000..def18aa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_301.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_302.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_302.png new file mode 100644 index 0000000..39bcdd9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_302.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_303.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_303.png new file mode 100644 index 0000000..911f1ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_303.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_304.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_304.png new file mode 100644 index 0000000..7e447ec Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_304.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_305.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_305.png new file mode 100644 index 0000000..6589a2c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_305.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_306.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_306.png new file mode 100644 index 0000000..af284c8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_306.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_307.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_307.png new file mode 100644 index 0000000..afe273c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_307.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_308.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_308.png new file mode 100644 index 0000000..a1bc95a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_308.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_309.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_309.png new file mode 100644 index 0000000..ec66ea3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_309.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_31.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_31.png new file mode 100644 index 0000000..7b5d91e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_31.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_310.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_310.png new file mode 100644 index 0000000..e7aef5d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_310.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_311.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_311.png new file mode 100644 index 0000000..db2b454 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_311.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_312.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_312.png new file mode 100644 index 0000000..d877e8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_312.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_313.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_313.png new file mode 100644 index 0000000..cf05e40 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_313.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_314.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_314.png new file mode 100644 index 0000000..98d7666 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_314.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_315.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_315.png new file mode 100644 index 0000000..c958c52 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_315.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_316.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_316.png new file mode 100644 index 0000000..edc6c2e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_316.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_317.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_317.png new file mode 100644 index 0000000..f7b70aa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_317.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_318.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_318.png new file mode 100644 index 0000000..cbdd561 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_318.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_319.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_319.png new file mode 100644 index 0000000..347f482 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_319.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_32.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_32.png new file mode 100644 index 0000000..a9ce79e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_32.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_320.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_320.png new file mode 100644 index 0000000..b411b5e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_320.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_321.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_321.png new file mode 100644 index 0000000..6cdf157 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_321.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_322.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_322.png new file mode 100644 index 0000000..e0f2e03 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_322.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_323.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_323.png new file mode 100644 index 0000000..6565022 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_323.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_324.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_324.png new file mode 100644 index 0000000..202f6d0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_324.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_325.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_325.png new file mode 100644 index 0000000..3f56f1a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_325.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_326.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_326.png new file mode 100644 index 0000000..491be3c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_326.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_327.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_327.png new file mode 100644 index 0000000..a59b910 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_327.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_328.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_328.png new file mode 100644 index 0000000..9e2f972 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_328.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_329.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_329.png new file mode 100644 index 0000000..b9b101f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_329.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_33.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_33.png new file mode 100644 index 0000000..9f3de21 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_33.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_330.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_330.png new file mode 100644 index 0000000..725ef87 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_330.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_331.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_331.png new file mode 100644 index 0000000..ad4602a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_331.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_332.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_332.png new file mode 100644 index 0000000..07a5def Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_332.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_333.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_333.png new file mode 100644 index 0000000..863e8b0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_333.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_334.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_334.png new file mode 100644 index 0000000..ae18767 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_334.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_335.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_335.png new file mode 100644 index 0000000..343f210 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_335.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_336.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_336.png new file mode 100644 index 0000000..4b16cef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_336.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_337.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_337.png new file mode 100644 index 0000000..f5b5d7b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_337.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_338.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_338.png new file mode 100644 index 0000000..b54aec2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_338.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_339.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_339.png new file mode 100644 index 0000000..8f283a2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_339.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_34.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_34.png new file mode 100644 index 0000000..6246bcb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_34.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_340.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_340.png new file mode 100644 index 0000000..700f91f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_340.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_341.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_341.png new file mode 100644 index 0000000..7595799 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_341.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_342.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_342.png new file mode 100644 index 0000000..e849d06 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_342.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_343.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_343.png new file mode 100644 index 0000000..3ab9d45 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_343.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_344.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_344.png new file mode 100644 index 0000000..7858974 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_344.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_345.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_345.png new file mode 100644 index 0000000..9f9caed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_345.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_346.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_346.png new file mode 100644 index 0000000..28b5427 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_346.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_347.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_347.png new file mode 100644 index 0000000..c9bf8e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_347.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_348.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_348.png new file mode 100644 index 0000000..95fe6c2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_348.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_349.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_349.png new file mode 100644 index 0000000..7b58ff0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_349.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_35.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_35.png new file mode 100644 index 0000000..61ba6c8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_35.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_350.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_350.png new file mode 100644 index 0000000..9c4b3bf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_350.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_351.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_351.png new file mode 100644 index 0000000..c896371 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_351.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_352.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_352.png new file mode 100644 index 0000000..08ee615 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_352.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_353.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_353.png new file mode 100644 index 0000000..ede64f0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_353.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_354.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_354.png new file mode 100644 index 0000000..25c3b87 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_354.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_355.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_355.png new file mode 100644 index 0000000..38f6488 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_355.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_356.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_356.png new file mode 100644 index 0000000..f8e350a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_356.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_357.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_357.png new file mode 100644 index 0000000..e0f5268 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_357.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_358.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_358.png new file mode 100644 index 0000000..3a976c3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_358.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_359.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_359.png new file mode 100644 index 0000000..9294113 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_359.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_36.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_36.png new file mode 100644 index 0000000..206d6d0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_36.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_360.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_360.png new file mode 100644 index 0000000..9f4df66 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_360.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_361.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_361.png new file mode 100644 index 0000000..db29524 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_361.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_362.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_362.png new file mode 100644 index 0000000..18c40ca Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_362.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_363.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_363.png new file mode 100644 index 0000000..c6a0edc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_363.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_364.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_364.png new file mode 100644 index 0000000..33e73c0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_364.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_365.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_365.png new file mode 100644 index 0000000..96ecc78 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_365.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_366.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_366.png new file mode 100644 index 0000000..2d61ed2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_366.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_367.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_367.png new file mode 100644 index 0000000..ee16302 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_367.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_368.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_368.png new file mode 100644 index 0000000..6ae9d9c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_368.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_369.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_369.png new file mode 100644 index 0000000..147b63d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_369.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_37.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_37.png new file mode 100644 index 0000000..fc30754 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_37.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_370.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_370.png new file mode 100644 index 0000000..44d0086 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_370.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_371.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_371.png new file mode 100644 index 0000000..28ef221 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_371.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_372.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_372.png new file mode 100644 index 0000000..e1cacfe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_372.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_373.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_373.png new file mode 100644 index 0000000..128448a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_373.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_374.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_374.png new file mode 100644 index 0000000..d86290a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_374.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_375.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_375.png new file mode 100644 index 0000000..496b761 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_375.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_376.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_376.png new file mode 100644 index 0000000..10e159a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_376.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_377.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_377.png new file mode 100644 index 0000000..60555f4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_377.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_378.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_378.png new file mode 100644 index 0000000..19483af Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_378.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_379.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_379.png new file mode 100644 index 0000000..377ce35 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_379.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_38.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_38.png new file mode 100644 index 0000000..59f2654 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_38.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_380.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_380.png new file mode 100644 index 0000000..a37e0a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_380.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_381.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_381.png new file mode 100644 index 0000000..7ac8d5c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_381.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_382.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_382.png new file mode 100644 index 0000000..57bbd0e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_382.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_383.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_383.png new file mode 100644 index 0000000..7d204fa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_383.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_384.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_384.png new file mode 100644 index 0000000..9ca813a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_384.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_385.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_385.png new file mode 100644 index 0000000..0028a3c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_385.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_386.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_386.png new file mode 100644 index 0000000..f567d6a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_386.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_387.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_387.png new file mode 100644 index 0000000..0edf974 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_387.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_388.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_388.png new file mode 100644 index 0000000..f7c581e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_388.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_389.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_389.png new file mode 100644 index 0000000..9cfd3d5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_389.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_39.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_39.png new file mode 100644 index 0000000..5dc7be5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_39.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_390.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_390.png new file mode 100644 index 0000000..4849fb4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_390.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_391.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_391.png new file mode 100644 index 0000000..b934f2c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_391.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_392.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_392.png new file mode 100644 index 0000000..173a35f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_392.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_393.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_393.png new file mode 100644 index 0000000..9ff49b7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_393.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_394.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_394.png new file mode 100644 index 0000000..92aa49e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_394.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_395.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_395.png new file mode 100644 index 0000000..f209dc2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_395.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_396.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_396.png new file mode 100644 index 0000000..b7a80e6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_396.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_397.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_397.png new file mode 100644 index 0000000..89aa3fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_397.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_398.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_398.png new file mode 100644 index 0000000..730a90a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_398.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_399.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_399.png new file mode 100644 index 0000000..44c3459 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_399.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_4.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_4.png new file mode 100644 index 0000000..8c3b4a4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_4.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_40.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_40.png new file mode 100644 index 0000000..0a8d69a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_40.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_400.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_400.png new file mode 100644 index 0000000..3a32f35 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_400.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_401.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_401.png new file mode 100644 index 0000000..7a46d3b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_401.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_402.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_402.png new file mode 100644 index 0000000..ad277cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_402.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_403.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_403.png new file mode 100644 index 0000000..ab61ca5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_403.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_404.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_404.png new file mode 100644 index 0000000..7da8680 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_404.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_405.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_405.png new file mode 100644 index 0000000..5807ea4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_405.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_406.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_406.png new file mode 100644 index 0000000..ff6b589 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_406.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_407.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_407.png new file mode 100644 index 0000000..a846242 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_407.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_408.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_408.png new file mode 100644 index 0000000..b74ce44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_408.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_409.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_409.png new file mode 100644 index 0000000..d53454a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_409.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_41.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_41.png new file mode 100644 index 0000000..4eaff8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_41.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_410.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_410.png new file mode 100644 index 0000000..4a38b06 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_410.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_411.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_411.png new file mode 100644 index 0000000..9e4bb26 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_411.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_412.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_412.png new file mode 100644 index 0000000..cb7a4b7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_412.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_413.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_413.png new file mode 100644 index 0000000..f4bfd53 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_413.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_414.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_414.png new file mode 100644 index 0000000..8024259 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_414.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_415.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_415.png new file mode 100644 index 0000000..785f2a4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_415.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_416.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_416.png new file mode 100644 index 0000000..ffb3a46 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_416.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_417.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_417.png new file mode 100644 index 0000000..52bb77f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_417.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_418.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_418.png new file mode 100644 index 0000000..91fd206 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_418.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_419.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_419.png new file mode 100644 index 0000000..b891804 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_419.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_42.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_42.png new file mode 100644 index 0000000..16dc114 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_42.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_420.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_420.png new file mode 100644 index 0000000..603b1d4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_420.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_421.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_421.png new file mode 100644 index 0000000..a1d0daa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_421.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_422.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_422.png new file mode 100644 index 0000000..d1199fe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_422.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_423.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_423.png new file mode 100644 index 0000000..83572ce Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_423.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_424.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_424.png new file mode 100644 index 0000000..b589e9c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_424.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_425.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_425.png new file mode 100644 index 0000000..a7533c9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_425.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_426.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_426.png new file mode 100644 index 0000000..8583a25 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_426.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_427.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_427.png new file mode 100644 index 0000000..194e3d1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_427.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_428.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_428.png new file mode 100644 index 0000000..d85f9df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_428.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_429.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_429.png new file mode 100644 index 0000000..cd85fe3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_429.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_43.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_43.png new file mode 100644 index 0000000..107aa29 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_43.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_430.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_430.png new file mode 100644 index 0000000..a3e7772 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_430.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_431.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_431.png new file mode 100644 index 0000000..6440a60 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_431.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_432.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_432.png new file mode 100644 index 0000000..89f082c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_432.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_433.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_433.png new file mode 100644 index 0000000..07c1098 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_433.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_434.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_434.png new file mode 100644 index 0000000..b21b5cc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_434.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_435.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_435.png new file mode 100644 index 0000000..794d641 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_435.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_436.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_436.png new file mode 100644 index 0000000..9cd3269 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_436.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_437.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_437.png new file mode 100644 index 0000000..72892e8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_437.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_438.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_438.png new file mode 100644 index 0000000..b1e53fa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_438.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_439.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_439.png new file mode 100644 index 0000000..9cd3da9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_439.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_44.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_44.png new file mode 100644 index 0000000..9cbf5e3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_44.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_440.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_440.png new file mode 100644 index 0000000..edd316c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_440.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_441.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_441.png new file mode 100644 index 0000000..82fc22a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_441.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_442.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_442.png new file mode 100644 index 0000000..c0a7123 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_442.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_443.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_443.png new file mode 100644 index 0000000..01bc6ff Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_443.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_444.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_444.png new file mode 100644 index 0000000..1715230 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_444.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_445.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_445.png new file mode 100644 index 0000000..276af8d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_445.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_446.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_446.png new file mode 100644 index 0000000..daf7e7d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_446.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_447.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_447.png new file mode 100644 index 0000000..d1e6858 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_447.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_448.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_448.png new file mode 100644 index 0000000..cc1e355 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_448.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_449.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_449.png new file mode 100644 index 0000000..6dc36f7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_449.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_45.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_45.png new file mode 100644 index 0000000..d1a5dce Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_45.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_450.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_450.png new file mode 100644 index 0000000..6263ab0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_450.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_451.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_451.png new file mode 100644 index 0000000..aa5f999 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_451.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_452.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_452.png new file mode 100644 index 0000000..f7a3b74 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_452.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_453.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_453.png new file mode 100644 index 0000000..79216b3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_453.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_454.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_454.png new file mode 100644 index 0000000..74c4aa9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_454.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_455.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_455.png new file mode 100644 index 0000000..7777af3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_455.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_456.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_456.png new file mode 100644 index 0000000..75aee44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_456.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_457.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_457.png new file mode 100644 index 0000000..15bbc64 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_457.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_458.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_458.png new file mode 100644 index 0000000..a9c3a67 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_458.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_459.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_459.png new file mode 100644 index 0000000..c9b3c1e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_459.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_46.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_46.png new file mode 100644 index 0000000..43e79f6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_46.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_460.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_460.png new file mode 100644 index 0000000..7e52be8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_460.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_461.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_461.png new file mode 100644 index 0000000..bf88a4a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_461.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_462.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_462.png new file mode 100644 index 0000000..92ed52b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_462.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_463.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_463.png new file mode 100644 index 0000000..1bab5bc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_463.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_464.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_464.png new file mode 100644 index 0000000..c1dc992 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_464.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_465.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_465.png new file mode 100644 index 0000000..02ee83a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_465.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_466.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_466.png new file mode 100644 index 0000000..759ae05 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_466.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_467.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_467.png new file mode 100644 index 0000000..730c3c1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_467.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_468.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_468.png new file mode 100644 index 0000000..ac596a9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_468.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_469.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_469.png new file mode 100644 index 0000000..1ed940b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_469.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_47.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_47.png new file mode 100644 index 0000000..2d3b1a2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_47.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_470.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_470.png new file mode 100644 index 0000000..d847a0f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_470.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_471.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_471.png new file mode 100644 index 0000000..a04d79c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_471.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_472.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_472.png new file mode 100644 index 0000000..cc6d160 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_472.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_473.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_473.png new file mode 100644 index 0000000..2af8949 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_473.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_474.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_474.png new file mode 100644 index 0000000..e1fad41 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_474.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_475.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_475.png new file mode 100644 index 0000000..523a192 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_475.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_476.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_476.png new file mode 100644 index 0000000..f1c805f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_476.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_477.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_477.png new file mode 100644 index 0000000..22bbf8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_477.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_478.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_478.png new file mode 100644 index 0000000..25b34bb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_478.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_479.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_479.png new file mode 100644 index 0000000..e4d96df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_479.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_48.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_48.png new file mode 100644 index 0000000..858562f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_48.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_480.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_480.png new file mode 100644 index 0000000..d22c43f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_480.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_481.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_481.png new file mode 100644 index 0000000..43b4de5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_481.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_482.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_482.png new file mode 100644 index 0000000..24dcb39 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_482.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_483.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_483.png new file mode 100644 index 0000000..f6fb25a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_483.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_484.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_484.png new file mode 100644 index 0000000..1bc8983 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_484.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_485.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_485.png new file mode 100644 index 0000000..1034b12 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_485.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_486.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_486.png new file mode 100644 index 0000000..b7da245 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_486.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_487.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_487.png new file mode 100644 index 0000000..f0b81d3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_487.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_488.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_488.png new file mode 100644 index 0000000..128390a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_488.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_489.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_489.png new file mode 100644 index 0000000..c111e76 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_489.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_49.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_49.png new file mode 100644 index 0000000..8f3794f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_49.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_490.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_490.png new file mode 100644 index 0000000..f38b750 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_490.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_491.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_491.png new file mode 100644 index 0000000..516d5ac Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_491.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_492.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_492.png new file mode 100644 index 0000000..8729b5b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_492.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_493.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_493.png new file mode 100644 index 0000000..95f8237 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_493.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_494.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_494.png new file mode 100644 index 0000000..3e7a335 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_494.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_495.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_495.png new file mode 100644 index 0000000..473b832 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_495.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_496.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_496.png new file mode 100644 index 0000000..224250f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_496.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_497.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_497.png new file mode 100644 index 0000000..7b9c9b4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_497.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_498.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_498.png new file mode 100644 index 0000000..55a0dff Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_498.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_499.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_499.png new file mode 100644 index 0000000..8e06ac7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_499.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_5.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_5.png new file mode 100644 index 0000000..25b7e6a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_5.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_50.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_50.png new file mode 100644 index 0000000..395f6cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_50.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_500.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_500.png new file mode 100644 index 0000000..5e883b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_500.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_501.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_501.png new file mode 100644 index 0000000..bfc4d9b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_501.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_502.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_502.png new file mode 100644 index 0000000..edc3eb8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_502.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_503.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_503.png new file mode 100644 index 0000000..631df1e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_503.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_504.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_504.png new file mode 100644 index 0000000..4b49e7b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_504.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_505.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_505.png new file mode 100644 index 0000000..eca3377 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_505.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_506.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_506.png new file mode 100644 index 0000000..62f478c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_506.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_507.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_507.png new file mode 100644 index 0000000..4299fc2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_507.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_508.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_508.png new file mode 100644 index 0000000..847f654 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_508.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_509.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_509.png new file mode 100644 index 0000000..41c11b7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_509.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_51.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_51.png new file mode 100644 index 0000000..c7d693d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_51.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_510.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_510.png new file mode 100644 index 0000000..fbf259d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_510.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_511.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_511.png new file mode 100644 index 0000000..b69cb37 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_511.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_512.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_512.png new file mode 100644 index 0000000..bdee5c3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_512.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_513.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_513.png new file mode 100644 index 0000000..bcc710b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_513.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_514.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_514.png new file mode 100644 index 0000000..a87926f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_514.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_515.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_515.png new file mode 100644 index 0000000..3b430f2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_515.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_516.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_516.png new file mode 100644 index 0000000..1327e59 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_516.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_517.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_517.png new file mode 100644 index 0000000..d2ff1c1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_517.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_518.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_518.png new file mode 100644 index 0000000..2bd9953 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_518.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_519.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_519.png new file mode 100644 index 0000000..3ff7158 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_519.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_52.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_52.png new file mode 100644 index 0000000..1b3fc11 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_52.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_520.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_520.png new file mode 100644 index 0000000..ba317a3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_520.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_521.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_521.png new file mode 100644 index 0000000..0feec08 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_521.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_522.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_522.png new file mode 100644 index 0000000..417fce6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_522.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_523.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_523.png new file mode 100644 index 0000000..0d4a1b7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_523.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_524.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_524.png new file mode 100644 index 0000000..0ae6227 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_524.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_525.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_525.png new file mode 100644 index 0000000..00b6bbb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_525.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_526.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_526.png new file mode 100644 index 0000000..49ea27e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_526.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_527.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_527.png new file mode 100644 index 0000000..e95b646 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_527.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_528.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_528.png new file mode 100644 index 0000000..4f2be0b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_528.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_529.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_529.png new file mode 100644 index 0000000..cbffade Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_529.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_53.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_53.png new file mode 100644 index 0000000..78c5baa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_53.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_530.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_530.png new file mode 100644 index 0000000..8956fdb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_530.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_531.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_531.png new file mode 100644 index 0000000..dae2f3d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_531.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_532.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_532.png new file mode 100644 index 0000000..0f8917d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_532.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_533.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_533.png new file mode 100644 index 0000000..53e4751 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_533.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_534.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_534.png new file mode 100644 index 0000000..48ed6a3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_534.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_535.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_535.png new file mode 100644 index 0000000..14eb5f8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_535.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_536.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_536.png new file mode 100644 index 0000000..f4566ca Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_536.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_537.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_537.png new file mode 100644 index 0000000..43c42e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_537.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_538.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_538.png new file mode 100644 index 0000000..1f34d31 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_538.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_539.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_539.png new file mode 100644 index 0000000..006fe6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_539.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_54.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_54.png new file mode 100644 index 0000000..87e67dd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_54.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_540.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_540.png new file mode 100644 index 0000000..5c3788e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_540.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_541.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_541.png new file mode 100644 index 0000000..3fbae38 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_541.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_542.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_542.png new file mode 100644 index 0000000..14a02ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_542.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_543.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_543.png new file mode 100644 index 0000000..cd13734 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_543.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_544.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_544.png new file mode 100644 index 0000000..598d399 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_544.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_545.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_545.png new file mode 100644 index 0000000..ef59452 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_545.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_546.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_546.png new file mode 100644 index 0000000..fc71e87 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_546.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_547.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_547.png new file mode 100644 index 0000000..1fb1f9a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_547.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_548.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_548.png new file mode 100644 index 0000000..67da888 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_548.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_549.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_549.png new file mode 100644 index 0000000..fdc51b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_549.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_55.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_55.png new file mode 100644 index 0000000..c086a21 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_55.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_550.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_550.png new file mode 100644 index 0000000..160574f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_550.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_551.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_551.png new file mode 100644 index 0000000..f4f3656 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_551.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_552.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_552.png new file mode 100644 index 0000000..5ff7c83 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_552.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_553.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_553.png new file mode 100644 index 0000000..6377bec Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_553.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_554.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_554.png new file mode 100644 index 0000000..6f7ccb7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_554.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_555.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_555.png new file mode 100644 index 0000000..82538ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_555.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_556.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_556.png new file mode 100644 index 0000000..cff7fe5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_556.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_557.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_557.png new file mode 100644 index 0000000..2c295bd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_557.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_558.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_558.png new file mode 100644 index 0000000..0a88b00 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_558.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_559.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_559.png new file mode 100644 index 0000000..9f66797 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_559.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_56.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_56.png new file mode 100644 index 0000000..f021498 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_56.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_560.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_560.png new file mode 100644 index 0000000..8b2f605 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_560.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_561.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_561.png new file mode 100644 index 0000000..424dd2a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_561.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_562.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_562.png new file mode 100644 index 0000000..c10a56c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_562.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_563.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_563.png new file mode 100644 index 0000000..37a2833 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_563.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_564.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_564.png new file mode 100644 index 0000000..8246212 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_564.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_565.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_565.png new file mode 100644 index 0000000..6253362 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_565.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_566.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_566.png new file mode 100644 index 0000000..0f26af2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_566.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_567.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_567.png new file mode 100644 index 0000000..d678cd3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_567.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_568.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_568.png new file mode 100644 index 0000000..eeeea05 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_568.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_569.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_569.png new file mode 100644 index 0000000..ba2f8b0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_569.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_57.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_57.png new file mode 100644 index 0000000..4729e3f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_57.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_570.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_570.png new file mode 100644 index 0000000..aa1817c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_570.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_571.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_571.png new file mode 100644 index 0000000..9d03f91 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_571.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_572.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_572.png new file mode 100644 index 0000000..53d45cb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_572.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_573.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_573.png new file mode 100644 index 0000000..9e9f718 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_573.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_574.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_574.png new file mode 100644 index 0000000..cd19697 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_574.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_575.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_575.png new file mode 100644 index 0000000..8a23b9c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_575.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_576.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_576.png new file mode 100644 index 0000000..b714798 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_576.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_577.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_577.png new file mode 100644 index 0000000..e6227df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_577.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_578.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_578.png new file mode 100644 index 0000000..92cdb8c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_578.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_579.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_579.png new file mode 100644 index 0000000..f7e3075 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_579.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_58.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_58.png new file mode 100644 index 0000000..cf48f3c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_58.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_580.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_580.png new file mode 100644 index 0000000..858337c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_580.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_581.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_581.png new file mode 100644 index 0000000..b641d6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_581.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_582.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_582.png new file mode 100644 index 0000000..3b71897 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_582.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_583.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_583.png new file mode 100644 index 0000000..f7d078b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_583.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_584.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_584.png new file mode 100644 index 0000000..3e694a7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_584.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_585.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_585.png new file mode 100644 index 0000000..fd1fde5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_585.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_586.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_586.png new file mode 100644 index 0000000..e4f20a7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_586.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_587.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_587.png new file mode 100644 index 0000000..297a7ed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_587.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_588.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_588.png new file mode 100644 index 0000000..a66f0a2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_588.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_589.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_589.png new file mode 100644 index 0000000..9133c81 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_589.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_59.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_59.png new file mode 100644 index 0000000..01790fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_59.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_590.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_590.png new file mode 100644 index 0000000..a74edaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_590.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_591.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_591.png new file mode 100644 index 0000000..1d333c7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_591.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_592.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_592.png new file mode 100644 index 0000000..66e79e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_592.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_593.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_593.png new file mode 100644 index 0000000..c8da488 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_593.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_594.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_594.png new file mode 100644 index 0000000..afadabb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_594.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_595.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_595.png new file mode 100644 index 0000000..880d6cb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_595.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_596.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_596.png new file mode 100644 index 0000000..cba3aaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_596.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_597.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_597.png new file mode 100644 index 0000000..20964da Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_597.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_598.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_598.png new file mode 100644 index 0000000..6b8435f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_598.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_599.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_599.png new file mode 100644 index 0000000..cc6136c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_599.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_6.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_6.png new file mode 100644 index 0000000..6fcf944 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_6.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_60.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_60.png new file mode 100644 index 0000000..770e88c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_60.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_600.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_600.png new file mode 100644 index 0000000..89b39b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_600.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_601.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_601.png new file mode 100644 index 0000000..b2d5326 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_601.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_602.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_602.png new file mode 100644 index 0000000..f2aac09 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_602.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_603.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_603.png new file mode 100644 index 0000000..2d26f53 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_603.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_604.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_604.png new file mode 100644 index 0000000..21fc7f1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_604.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_605.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_605.png new file mode 100644 index 0000000..b213640 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_605.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_606.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_606.png new file mode 100644 index 0000000..e44083a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_606.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_607.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_607.png new file mode 100644 index 0000000..1323af6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_607.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_608.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_608.png new file mode 100644 index 0000000..e19bb6f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_608.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_609.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_609.png new file mode 100644 index 0000000..5ff811e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_609.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_61.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_61.png new file mode 100644 index 0000000..27c0ec3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_61.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_610.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_610.png new file mode 100644 index 0000000..04ec700 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_610.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_611.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_611.png new file mode 100644 index 0000000..b1383c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_611.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_612.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_612.png new file mode 100644 index 0000000..94743d3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_612.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_613.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_613.png new file mode 100644 index 0000000..55f7fbe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_613.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_614.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_614.png new file mode 100644 index 0000000..dff3323 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_614.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_615.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_615.png new file mode 100644 index 0000000..d97cab3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_615.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_616.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_616.png new file mode 100644 index 0000000..ad0e431 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_616.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_617.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_617.png new file mode 100644 index 0000000..c4d69b2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_617.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_618.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_618.png new file mode 100644 index 0000000..464db0e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_618.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_619.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_619.png new file mode 100644 index 0000000..d6c61d3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_619.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_62.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_62.png new file mode 100644 index 0000000..38ff066 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_62.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_620.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_620.png new file mode 100644 index 0000000..78e8106 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_620.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_621.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_621.png new file mode 100644 index 0000000..5bd68e4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_621.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_622.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_622.png new file mode 100644 index 0000000..45c2d61 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_622.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_623.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_623.png new file mode 100644 index 0000000..d0d946a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_623.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_624.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_624.png new file mode 100644 index 0000000..d5e972a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_624.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_625.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_625.png new file mode 100644 index 0000000..9c69144 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_625.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_626.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_626.png new file mode 100644 index 0000000..b3887d1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_626.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_627.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_627.png new file mode 100644 index 0000000..11607e7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_627.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_628.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_628.png new file mode 100644 index 0000000..5b6346d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_628.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_629.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_629.png new file mode 100644 index 0000000..a5213b8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_629.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_63.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_63.png new file mode 100644 index 0000000..43f7570 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_63.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_630.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_630.png new file mode 100644 index 0000000..50932db Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_630.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_631.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_631.png new file mode 100644 index 0000000..19ee12c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_631.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_632.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_632.png new file mode 100644 index 0000000..52b73fc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_632.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_633.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_633.png new file mode 100644 index 0000000..5496471 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_633.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_634.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_634.png new file mode 100644 index 0000000..b8d8d77 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_634.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_635.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_635.png new file mode 100644 index 0000000..43dc231 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_635.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_636.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_636.png new file mode 100644 index 0000000..ae30b1c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_636.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_637.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_637.png new file mode 100644 index 0000000..f22eca6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_637.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_638.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_638.png new file mode 100644 index 0000000..754cd2d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_638.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_639.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_639.png new file mode 100644 index 0000000..1d69d59 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_639.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_64.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_64.png new file mode 100644 index 0000000..6661abd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_64.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_640.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_640.png new file mode 100644 index 0000000..be6d7e9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_640.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_641.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_641.png new file mode 100644 index 0000000..9b8b218 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_641.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_642.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_642.png new file mode 100644 index 0000000..bcfb633 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_642.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_643.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_643.png new file mode 100644 index 0000000..7353ca5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_643.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_644.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_644.png new file mode 100644 index 0000000..607ee4d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_644.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_645.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_645.png new file mode 100644 index 0000000..d54665f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_645.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_646.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_646.png new file mode 100644 index 0000000..bbb5909 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_646.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_647.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_647.png new file mode 100644 index 0000000..182be1f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_647.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_648.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_648.png new file mode 100644 index 0000000..8803eaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_648.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_649.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_649.png new file mode 100644 index 0000000..e0550a5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_649.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_65.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_65.png new file mode 100644 index 0000000..f746fe8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_65.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_650.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_650.png new file mode 100644 index 0000000..8dd6b17 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_650.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_651.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_651.png new file mode 100644 index 0000000..5c6b048 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_651.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_652.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_652.png new file mode 100644 index 0000000..22efe46 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_652.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_653.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_653.png new file mode 100644 index 0000000..dbe670d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_653.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_654.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_654.png new file mode 100644 index 0000000..ab95435 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_654.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_655.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_655.png new file mode 100644 index 0000000..89775b0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_655.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_656.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_656.png new file mode 100644 index 0000000..5836842 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_656.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_657.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_657.png new file mode 100644 index 0000000..435d080 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_657.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_658.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_658.png new file mode 100644 index 0000000..5fbf6f8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_658.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_659.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_659.png new file mode 100644 index 0000000..a2f111d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_659.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_66.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_66.png new file mode 100644 index 0000000..571042b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_66.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_660.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_660.png new file mode 100644 index 0000000..c8d9a43 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_660.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_661.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_661.png new file mode 100644 index 0000000..dccc583 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_661.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_662.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_662.png new file mode 100644 index 0000000..a1e9cc8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_662.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_663.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_663.png new file mode 100644 index 0000000..9607f0b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_663.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_664.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_664.png new file mode 100644 index 0000000..c3496af Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_664.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_665.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_665.png new file mode 100644 index 0000000..9456ce3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_665.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_666.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_666.png new file mode 100644 index 0000000..66aa8ce Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_666.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_667.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_667.png new file mode 100644 index 0000000..0171cc0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_667.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_668.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_668.png new file mode 100644 index 0000000..d500701 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_668.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_669.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_669.png new file mode 100644 index 0000000..ee861a1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_669.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_67.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_67.png new file mode 100644 index 0000000..d608799 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_67.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_670.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_670.png new file mode 100644 index 0000000..20c885d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_670.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_671.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_671.png new file mode 100644 index 0000000..6ad82e6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_671.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_672.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_672.png new file mode 100644 index 0000000..891f0bd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_672.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_673.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_673.png new file mode 100644 index 0000000..f4e21fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_673.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_674.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_674.png new file mode 100644 index 0000000..953ecd7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_674.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_675.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_675.png new file mode 100644 index 0000000..2afff39 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_675.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_676.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_676.png new file mode 100644 index 0000000..3d23977 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_676.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_677.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_677.png new file mode 100644 index 0000000..f81e62f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_677.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_678.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_678.png new file mode 100644 index 0000000..957ec4b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_678.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_679.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_679.png new file mode 100644 index 0000000..7892dbb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_679.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_68.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_68.png new file mode 100644 index 0000000..62da4c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_68.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_680.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_680.png new file mode 100644 index 0000000..c728d6e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_680.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_681.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_681.png new file mode 100644 index 0000000..a71cf46 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_681.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_682.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_682.png new file mode 100644 index 0000000..eabb015 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_682.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_683.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_683.png new file mode 100644 index 0000000..8090b29 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_683.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_684.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_684.png new file mode 100644 index 0000000..a6c9ffe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_684.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_685.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_685.png new file mode 100644 index 0000000..f9e3f19 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_685.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_686.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_686.png new file mode 100644 index 0000000..ab47e16 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_686.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_687.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_687.png new file mode 100644 index 0000000..10035f9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_687.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_688.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_688.png new file mode 100644 index 0000000..bcae4df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_688.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_689.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_689.png new file mode 100644 index 0000000..dd5b521 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_689.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_69.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_69.png new file mode 100644 index 0000000..6fea73d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_69.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_690.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_690.png new file mode 100644 index 0000000..abde0c9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_690.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_691.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_691.png new file mode 100644 index 0000000..4ac3160 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_691.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_692.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_692.png new file mode 100644 index 0000000..4ceec7a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_692.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_693.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_693.png new file mode 100644 index 0000000..28a0377 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_693.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_694.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_694.png new file mode 100644 index 0000000..1eb208c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_694.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_695.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_695.png new file mode 100644 index 0000000..5171419 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_695.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_696.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_696.png new file mode 100644 index 0000000..877d797 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_696.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_697.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_697.png new file mode 100644 index 0000000..99ea83d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_697.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_698.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_698.png new file mode 100644 index 0000000..7bfb160 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_698.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_699.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_699.png new file mode 100644 index 0000000..cd3c3ae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_699.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_7.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_7.png new file mode 100644 index 0000000..603f5f5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_7.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_70.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_70.png new file mode 100644 index 0000000..7f93703 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_70.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_700.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_700.png new file mode 100644 index 0000000..96eb34a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_700.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_701.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_701.png new file mode 100644 index 0000000..daa8870 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_701.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_702.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_702.png new file mode 100644 index 0000000..273ec7d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_702.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_703.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_703.png new file mode 100644 index 0000000..a5c8828 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_703.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_704.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_704.png new file mode 100644 index 0000000..cb96429 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_704.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_705.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_705.png new file mode 100644 index 0000000..85ca2eb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_705.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_706.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_706.png new file mode 100644 index 0000000..aedabf4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_706.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_707.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_707.png new file mode 100644 index 0000000..65c0fbc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_707.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_708.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_708.png new file mode 100644 index 0000000..4e7a93e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_708.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_709.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_709.png new file mode 100644 index 0000000..c0826c0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_709.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_71.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_71.png new file mode 100644 index 0000000..4b1e8bb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_71.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_710.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_710.png new file mode 100644 index 0000000..895c5c6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_710.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_711.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_711.png new file mode 100644 index 0000000..9254952 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_711.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_712.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_712.png new file mode 100644 index 0000000..1c1a328 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_712.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_713.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_713.png new file mode 100644 index 0000000..ceeb401 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_713.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_714.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_714.png new file mode 100644 index 0000000..85d9ba3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_714.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_715.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_715.png new file mode 100644 index 0000000..b981ee5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_715.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_716.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_716.png new file mode 100644 index 0000000..f03e458 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_716.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_717.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_717.png new file mode 100644 index 0000000..a8d7711 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_717.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_718.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_718.png new file mode 100644 index 0000000..f81ce6c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_718.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_719.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_719.png new file mode 100644 index 0000000..55e5cf2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_719.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_72.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_72.png new file mode 100644 index 0000000..242cc2e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_72.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_720.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_720.png new file mode 100644 index 0000000..f6dbfaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_720.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_721.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_721.png new file mode 100644 index 0000000..45eb028 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_721.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_722.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_722.png new file mode 100644 index 0000000..f17ea70 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_722.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_723.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_723.png new file mode 100644 index 0000000..0d1fefa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_723.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_724.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_724.png new file mode 100644 index 0000000..a5063db Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_724.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_725.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_725.png new file mode 100644 index 0000000..ab26809 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_725.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_726.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_726.png new file mode 100644 index 0000000..b0e8cbe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_726.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_727.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_727.png new file mode 100644 index 0000000..75b1151 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_727.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_728.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_728.png new file mode 100644 index 0000000..6d80030 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_728.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_729.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_729.png new file mode 100644 index 0000000..a5f0c45 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_729.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_73.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_73.png new file mode 100644 index 0000000..6dc6bad Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_73.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_730.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_730.png new file mode 100644 index 0000000..eea680f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_730.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_731.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_731.png new file mode 100644 index 0000000..45779f9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_731.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_732.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_732.png new file mode 100644 index 0000000..5199741 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_732.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_733.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_733.png new file mode 100644 index 0000000..3177f9a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_733.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_734.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_734.png new file mode 100644 index 0000000..9c6d91a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_734.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_735.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_735.png new file mode 100644 index 0000000..422d13c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_735.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_736.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_736.png new file mode 100644 index 0000000..41b2b4d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_736.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_737.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_737.png new file mode 100644 index 0000000..b0b2d21 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_737.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_738.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_738.png new file mode 100644 index 0000000..56e1937 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_738.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_739.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_739.png new file mode 100644 index 0000000..da8c293 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_739.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_74.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_74.png new file mode 100644 index 0000000..9791d57 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_74.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_740.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_740.png new file mode 100644 index 0000000..10747ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_740.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_741.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_741.png new file mode 100644 index 0000000..0f5c816 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_741.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_742.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_742.png new file mode 100644 index 0000000..894e6b4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_742.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_743.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_743.png new file mode 100644 index 0000000..edd3f78 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_743.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_744.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_744.png new file mode 100644 index 0000000..81f2b1c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_744.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_745.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_745.png new file mode 100644 index 0000000..03c3988 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_745.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_746.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_746.png new file mode 100644 index 0000000..52d9aad Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_746.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_747.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_747.png new file mode 100644 index 0000000..d0bc5f4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_747.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_748.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_748.png new file mode 100644 index 0000000..abe1ee2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_748.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_749.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_749.png new file mode 100644 index 0000000..c773e7e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_749.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_75.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_75.png new file mode 100644 index 0000000..8f4720d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_75.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_750.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_750.png new file mode 100644 index 0000000..7a2ffb0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_750.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_751.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_751.png new file mode 100644 index 0000000..2de08ae Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_751.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_752.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_752.png new file mode 100644 index 0000000..af1a14a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_752.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_753.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_753.png new file mode 100644 index 0000000..81b3d1e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_753.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_754.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_754.png new file mode 100644 index 0000000..eb25cf9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_754.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_755.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_755.png new file mode 100644 index 0000000..f736d14 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_755.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_756.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_756.png new file mode 100644 index 0000000..0276779 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_756.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_757.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_757.png new file mode 100644 index 0000000..4b24683 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_757.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_758.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_758.png new file mode 100644 index 0000000..080e01c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_758.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_759.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_759.png new file mode 100644 index 0000000..b581d60 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_759.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_76.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_76.png new file mode 100644 index 0000000..ba6f64c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_76.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_760.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_760.png new file mode 100644 index 0000000..a2663d2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_760.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_761.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_761.png new file mode 100644 index 0000000..52cfe98 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_761.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_762.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_762.png new file mode 100644 index 0000000..cfb9664 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_762.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_763.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_763.png new file mode 100644 index 0000000..1d5fe0d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_763.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_764.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_764.png new file mode 100644 index 0000000..c484744 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_764.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_765.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_765.png new file mode 100644 index 0000000..0bfaf45 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_765.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_766.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_766.png new file mode 100644 index 0000000..d420758 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_766.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_767.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_767.png new file mode 100644 index 0000000..5cdc6f5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_767.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_768.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_768.png new file mode 100644 index 0000000..cb076e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_768.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_769.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_769.png new file mode 100644 index 0000000..3307fc3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_769.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_77.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_77.png new file mode 100644 index 0000000..1a61ed3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_77.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_770.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_770.png new file mode 100644 index 0000000..a76fb5d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_770.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_771.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_771.png new file mode 100644 index 0000000..557c71a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_771.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_772.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_772.png new file mode 100644 index 0000000..25659fb Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_772.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_773.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_773.png new file mode 100644 index 0000000..8f16002 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_773.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_774.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_774.png new file mode 100644 index 0000000..69ecae9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_774.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_775.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_775.png new file mode 100644 index 0000000..d3be414 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_775.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_776.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_776.png new file mode 100644 index 0000000..1fb428c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_776.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_777.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_777.png new file mode 100644 index 0000000..c58185a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_777.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_778.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_778.png new file mode 100644 index 0000000..805eb0b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_778.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_779.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_779.png new file mode 100644 index 0000000..d9a2136 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_779.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_78.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_78.png new file mode 100644 index 0000000..66f9f32 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_78.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_780.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_780.png new file mode 100644 index 0000000..cce5e31 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_780.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_781.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_781.png new file mode 100644 index 0000000..5a6226e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_781.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_782.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_782.png new file mode 100644 index 0000000..0d27505 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_782.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_783.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_783.png new file mode 100644 index 0000000..0216504 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_783.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_784.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_784.png new file mode 100644 index 0000000..bc542c4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_784.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_785.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_785.png new file mode 100644 index 0000000..870f865 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_785.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_786.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_786.png new file mode 100644 index 0000000..cb4c6bd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_786.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_787.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_787.png new file mode 100644 index 0000000..07c4cf7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_787.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_788.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_788.png new file mode 100644 index 0000000..78d6924 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_788.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_789.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_789.png new file mode 100644 index 0000000..96e1ed4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_789.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_79.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_79.png new file mode 100644 index 0000000..32a96fc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_79.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_790.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_790.png new file mode 100644 index 0000000..4f3e9db Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_790.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_791.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_791.png new file mode 100644 index 0000000..07c091d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_791.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_792.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_792.png new file mode 100644 index 0000000..0592fc8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_792.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_793.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_793.png new file mode 100644 index 0000000..8724f90 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_793.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_794.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_794.png new file mode 100644 index 0000000..60e7108 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_794.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_795.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_795.png new file mode 100644 index 0000000..0cc89bd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_795.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_796.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_796.png new file mode 100644 index 0000000..e774840 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_796.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_797.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_797.png new file mode 100644 index 0000000..c8ec3cd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_797.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_798.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_798.png new file mode 100644 index 0000000..f90007d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_798.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_799.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_799.png new file mode 100644 index 0000000..ca11c5a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_799.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_8.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_8.png new file mode 100644 index 0000000..6bbc2cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_8.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_80.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_80.png new file mode 100644 index 0000000..29f0188 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_80.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_800.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_800.png new file mode 100644 index 0000000..08d720e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_800.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_801.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_801.png new file mode 100644 index 0000000..cea4fa9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_801.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_802.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_802.png new file mode 100644 index 0000000..6dfe74a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_802.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_803.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_803.png new file mode 100644 index 0000000..d0862f5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_803.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_804.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_804.png new file mode 100644 index 0000000..a5dc860 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_804.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_805.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_805.png new file mode 100644 index 0000000..ab057ea Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_805.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_806.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_806.png new file mode 100644 index 0000000..77dd090 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_806.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_807.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_807.png new file mode 100644 index 0000000..35da302 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_807.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_808.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_808.png new file mode 100644 index 0000000..fd8f75c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_808.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_809.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_809.png new file mode 100644 index 0000000..df8d315 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_809.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_81.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_81.png new file mode 100644 index 0000000..1680b8d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_81.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_810.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_810.png new file mode 100644 index 0000000..466b557 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_810.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_811.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_811.png new file mode 100644 index 0000000..3138dd5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_811.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_812.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_812.png new file mode 100644 index 0000000..89c91f6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_812.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_813.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_813.png new file mode 100644 index 0000000..03e1990 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_813.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_814.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_814.png new file mode 100644 index 0000000..ca93249 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_814.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_815.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_815.png new file mode 100644 index 0000000..4dd7636 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_815.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_816.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_816.png new file mode 100644 index 0000000..5719a83 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_816.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_817.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_817.png new file mode 100644 index 0000000..8ff58f8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_817.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_818.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_818.png new file mode 100644 index 0000000..f9007d6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_818.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_819.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_819.png new file mode 100644 index 0000000..a922ba4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_819.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_82.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_82.png new file mode 100644 index 0000000..32ba2df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_82.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_820.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_820.png new file mode 100644 index 0000000..36af458 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_820.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_821.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_821.png new file mode 100644 index 0000000..9ff7235 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_821.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_822.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_822.png new file mode 100644 index 0000000..504fc0f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_822.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_823.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_823.png new file mode 100644 index 0000000..fbb5a22 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_823.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_824.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_824.png new file mode 100644 index 0000000..a4f3948 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_824.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_825.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_825.png new file mode 100644 index 0000000..d0f2536 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_825.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_826.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_826.png new file mode 100644 index 0000000..94da81a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_826.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_827.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_827.png new file mode 100644 index 0000000..f68b122 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_827.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_828.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_828.png new file mode 100644 index 0000000..27ba67e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_828.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_829.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_829.png new file mode 100644 index 0000000..b6d33ad Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_829.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_83.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_83.png new file mode 100644 index 0000000..b1e2536 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_83.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_830.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_830.png new file mode 100644 index 0000000..dd0da37 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_830.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_831.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_831.png new file mode 100644 index 0000000..8ab10a8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_831.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_832.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_832.png new file mode 100644 index 0000000..6803261 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_832.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_833.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_833.png new file mode 100644 index 0000000..2299531 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_833.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_834.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_834.png new file mode 100644 index 0000000..439b331 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_834.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_835.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_835.png new file mode 100644 index 0000000..40c3e61 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_835.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_836.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_836.png new file mode 100644 index 0000000..aac8f23 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_836.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_837.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_837.png new file mode 100644 index 0000000..f502f9e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_837.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_838.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_838.png new file mode 100644 index 0000000..ff9ca66 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_838.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_839.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_839.png new file mode 100644 index 0000000..bb82e77 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_839.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_84.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_84.png new file mode 100644 index 0000000..3b62def Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_84.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_840.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_840.png new file mode 100644 index 0000000..7e7aad4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_840.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_841.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_841.png new file mode 100644 index 0000000..31897ed Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_841.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_842.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_842.png new file mode 100644 index 0000000..83fa398 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_842.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_843.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_843.png new file mode 100644 index 0000000..d7dd853 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_843.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_844.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_844.png new file mode 100644 index 0000000..a792d95 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_844.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_845.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_845.png new file mode 100644 index 0000000..57bbe38 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_845.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_846.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_846.png new file mode 100644 index 0000000..5c8e7e0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_846.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_847.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_847.png new file mode 100644 index 0000000..e7d3cab Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_847.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_848.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_848.png new file mode 100644 index 0000000..d6b0795 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_848.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_849.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_849.png new file mode 100644 index 0000000..06381fe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_849.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_85.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_85.png new file mode 100644 index 0000000..1256f0e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_85.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_850.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_850.png new file mode 100644 index 0000000..1ad3a08 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_850.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_851.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_851.png new file mode 100644 index 0000000..3539469 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_851.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_852.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_852.png new file mode 100644 index 0000000..24eafaf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_852.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_853.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_853.png new file mode 100644 index 0000000..7b2816d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_853.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_854.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_854.png new file mode 100644 index 0000000..d5d2d78 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_854.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_855.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_855.png new file mode 100644 index 0000000..e67f9c3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_855.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_856.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_856.png new file mode 100644 index 0000000..d22bcbe Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_856.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_857.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_857.png new file mode 100644 index 0000000..c45cef9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_857.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_858.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_858.png new file mode 100644 index 0000000..84ffeb7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_858.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_859.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_859.png new file mode 100644 index 0000000..846b4c0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_859.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_86.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_86.png new file mode 100644 index 0000000..ae84a1b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_86.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_860.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_860.png new file mode 100644 index 0000000..536522e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_860.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_861.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_861.png new file mode 100644 index 0000000..f6e718a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_861.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_862.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_862.png new file mode 100644 index 0000000..025a608 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_862.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_863.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_863.png new file mode 100644 index 0000000..d97e970 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_863.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_864.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_864.png new file mode 100644 index 0000000..1be2555 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_864.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_865.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_865.png new file mode 100644 index 0000000..18efb18 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_865.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_866.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_866.png new file mode 100644 index 0000000..16be896 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_866.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_867.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_867.png new file mode 100644 index 0000000..2fff8f1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_867.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_868.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_868.png new file mode 100644 index 0000000..6a2bf06 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_868.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_869.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_869.png new file mode 100644 index 0000000..e54f5a0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_869.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_87.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_87.png new file mode 100644 index 0000000..7d18d4e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_87.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_870.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_870.png new file mode 100644 index 0000000..a34ba2c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_870.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_871.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_871.png new file mode 100644 index 0000000..a262127 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_871.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_872.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_872.png new file mode 100644 index 0000000..88d25ab Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_872.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_873.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_873.png new file mode 100644 index 0000000..635e5c1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_873.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_874.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_874.png new file mode 100644 index 0000000..09b296f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_874.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_875.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_875.png new file mode 100644 index 0000000..ce83e59 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_875.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_876.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_876.png new file mode 100644 index 0000000..1c90866 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_876.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_877.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_877.png new file mode 100644 index 0000000..181efda Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_877.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_878.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_878.png new file mode 100644 index 0000000..c983837 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_878.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_879.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_879.png new file mode 100644 index 0000000..ebe8514 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_879.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_88.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_88.png new file mode 100644 index 0000000..9114eaa Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_88.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_880.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_880.png new file mode 100644 index 0000000..b735168 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_880.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_881.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_881.png new file mode 100644 index 0000000..f020dce Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_881.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_882.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_882.png new file mode 100644 index 0000000..b24592f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_882.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_883.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_883.png new file mode 100644 index 0000000..9d55038 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_883.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_884.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_884.png new file mode 100644 index 0000000..cb09a4d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_884.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_885.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_885.png new file mode 100644 index 0000000..be3d609 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_885.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_886.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_886.png new file mode 100644 index 0000000..9fefff4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_886.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_887.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_887.png new file mode 100644 index 0000000..60b8545 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_887.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_888.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_888.png new file mode 100644 index 0000000..9eaa721 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_888.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_889.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_889.png new file mode 100644 index 0000000..a214823 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_889.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_89.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_89.png new file mode 100644 index 0000000..f15a2d7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_89.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_890.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_890.png new file mode 100644 index 0000000..9aca291 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_890.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_891.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_891.png new file mode 100644 index 0000000..1e49d4b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_891.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_892.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_892.png new file mode 100644 index 0000000..5002d3b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_892.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_893.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_893.png new file mode 100644 index 0000000..169c183 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_893.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_894.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_894.png new file mode 100644 index 0000000..3e38c1b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_894.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_895.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_895.png new file mode 100644 index 0000000..3886b23 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_895.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_896.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_896.png new file mode 100644 index 0000000..5b15b44 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_896.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_897.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_897.png new file mode 100644 index 0000000..d45ba0c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_897.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_898.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_898.png new file mode 100644 index 0000000..583ab23 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_898.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_899.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_899.png new file mode 100644 index 0000000..b2bb5a4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_899.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_9.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_9.png new file mode 100644 index 0000000..afd0166 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_9.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_90.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_90.png new file mode 100644 index 0000000..15f27e2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_90.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_900.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_900.png new file mode 100644 index 0000000..fa307d9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_900.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_901.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_901.png new file mode 100644 index 0000000..ce95449 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_901.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_902.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_902.png new file mode 100644 index 0000000..bfdb2dc Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_902.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_903.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_903.png new file mode 100644 index 0000000..06d44f2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_903.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_904.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_904.png new file mode 100644 index 0000000..b8eba75 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_904.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_905.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_905.png new file mode 100644 index 0000000..f86a592 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_905.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_906.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_906.png new file mode 100644 index 0000000..1edb4f0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_906.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_907.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_907.png new file mode 100644 index 0000000..6696494 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_907.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_908.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_908.png new file mode 100644 index 0000000..158a6e3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_908.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_909.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_909.png new file mode 100644 index 0000000..e0dfd63 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_909.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_91.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_91.png new file mode 100644 index 0000000..45e238a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_91.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_910.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_910.png new file mode 100644 index 0000000..c37bbb9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_910.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_911.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_911.png new file mode 100644 index 0000000..bb16c1c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_911.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_912.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_912.png new file mode 100644 index 0000000..81bd3cf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_912.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_913.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_913.png new file mode 100644 index 0000000..319c8e3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_913.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_914.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_914.png new file mode 100644 index 0000000..1d6d347 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_914.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_915.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_915.png new file mode 100644 index 0000000..b353418 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_915.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_916.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_916.png new file mode 100644 index 0000000..979a680 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_916.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_917.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_917.png new file mode 100644 index 0000000..f972eee Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_917.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_918.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_918.png new file mode 100644 index 0000000..db5a190 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_918.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_919.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_919.png new file mode 100644 index 0000000..2dfcf2f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_919.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_92.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_92.png new file mode 100644 index 0000000..e31dcbd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_92.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_920.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_920.png new file mode 100644 index 0000000..b8a328e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_920.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_921.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_921.png new file mode 100644 index 0000000..550cfc6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_921.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_922.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_922.png new file mode 100644 index 0000000..c6e411a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_922.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_923.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_923.png new file mode 100644 index 0000000..049a948 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_923.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_924.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_924.png new file mode 100644 index 0000000..44324b5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_924.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_925.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_925.png new file mode 100644 index 0000000..c307573 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_925.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_926.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_926.png new file mode 100644 index 0000000..358706e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_926.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_927.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_927.png new file mode 100644 index 0000000..7a62be2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_927.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_928.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_928.png new file mode 100644 index 0000000..24ed967 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_928.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_929.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_929.png new file mode 100644 index 0000000..d3f2c58 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_929.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_93.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_93.png new file mode 100644 index 0000000..54d6de1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_93.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_930.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_930.png new file mode 100644 index 0000000..53487ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_930.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_931.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_931.png new file mode 100644 index 0000000..ebbc1c2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_931.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_932.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_932.png new file mode 100644 index 0000000..03de80f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_932.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_933.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_933.png new file mode 100644 index 0000000..0f1e8ec Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_933.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_934.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_934.png new file mode 100644 index 0000000..78f2e97 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_934.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_935.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_935.png new file mode 100644 index 0000000..d86bc0e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_935.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_936.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_936.png new file mode 100644 index 0000000..51b2cbf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_936.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_937.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_937.png new file mode 100644 index 0000000..9c34b25 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_937.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_938.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_938.png new file mode 100644 index 0000000..5a0a9e9 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_938.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_939.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_939.png new file mode 100644 index 0000000..5c547fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_939.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_94.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_94.png new file mode 100644 index 0000000..120bb9e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_94.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_940.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_940.png new file mode 100644 index 0000000..d2c0288 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_940.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_941.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_941.png new file mode 100644 index 0000000..619ef13 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_941.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_942.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_942.png new file mode 100644 index 0000000..c36271b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_942.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_943.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_943.png new file mode 100644 index 0000000..8dc67d6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_943.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_944.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_944.png new file mode 100644 index 0000000..531fd0d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_944.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_945.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_945.png new file mode 100644 index 0000000..8a3dc4c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_945.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_946.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_946.png new file mode 100644 index 0000000..2e23148 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_946.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_947.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_947.png new file mode 100644 index 0000000..3ed8188 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_947.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_948.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_948.png new file mode 100644 index 0000000..fad1b99 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_948.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_949.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_949.png new file mode 100644 index 0000000..4940179 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_949.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_95.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_95.png new file mode 100644 index 0000000..3aa82a7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_95.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_950.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_950.png new file mode 100644 index 0000000..d9698c8 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_950.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_951.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_951.png new file mode 100644 index 0000000..149fd73 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_951.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_952.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_952.png new file mode 100644 index 0000000..e9d6a8f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_952.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_953.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_953.png new file mode 100644 index 0000000..3317d2d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_953.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_954.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_954.png new file mode 100644 index 0000000..0c48fa6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_954.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_955.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_955.png new file mode 100644 index 0000000..51fe9ea Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_955.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_956.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_956.png new file mode 100644 index 0000000..ed6daf4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_956.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_957.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_957.png new file mode 100644 index 0000000..de4f673 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_957.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_958.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_958.png new file mode 100644 index 0000000..695d6bf Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_958.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_959.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_959.png new file mode 100644 index 0000000..aa4ff17 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_959.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_96.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_96.png new file mode 100644 index 0000000..8f165e3 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_96.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_960.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_960.png new file mode 100644 index 0000000..cddaeda Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_960.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_961.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_961.png new file mode 100644 index 0000000..1b82865 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_961.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_962.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_962.png new file mode 100644 index 0000000..247bd0b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_962.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_963.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_963.png new file mode 100644 index 0000000..ddcec8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_963.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_964.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_964.png new file mode 100644 index 0000000..73c8156 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_964.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_965.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_965.png new file mode 100644 index 0000000..ee21119 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_965.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_966.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_966.png new file mode 100644 index 0000000..f6c2519 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_966.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_967.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_967.png new file mode 100644 index 0000000..0908739 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_967.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_968.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_968.png new file mode 100644 index 0000000..1f78f60 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_968.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_969.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_969.png new file mode 100644 index 0000000..817d8fd Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_969.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_97.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_97.png new file mode 100644 index 0000000..b96519e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_97.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_970.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_970.png new file mode 100644 index 0000000..c50228e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_970.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_971.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_971.png new file mode 100644 index 0000000..16f9c10 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_971.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_972.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_972.png new file mode 100644 index 0000000..eee298f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_972.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_973.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_973.png new file mode 100644 index 0000000..592fb67 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_973.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_974.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_974.png new file mode 100644 index 0000000..36e391f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_974.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_975.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_975.png new file mode 100644 index 0000000..68ecc78 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_975.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_976.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_976.png new file mode 100644 index 0000000..0eb8493 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_976.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_977.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_977.png new file mode 100644 index 0000000..95334a1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_977.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_978.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_978.png new file mode 100644 index 0000000..517df69 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_978.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_979.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_979.png new file mode 100644 index 0000000..49eef41 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_979.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_98.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_98.png new file mode 100644 index 0000000..7b9e70e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_98.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_980.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_980.png new file mode 100644 index 0000000..47e7b3a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_980.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_981.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_981.png new file mode 100644 index 0000000..ccd829d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_981.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_982.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_982.png new file mode 100644 index 0000000..adf0ef2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_982.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_983.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_983.png new file mode 100644 index 0000000..61283f4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_983.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_984.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_984.png new file mode 100644 index 0000000..b73751c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_984.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_985.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_985.png new file mode 100644 index 0000000..75ba1ef Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_985.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_986.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_986.png new file mode 100644 index 0000000..d64a309 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_986.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_987.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_987.png new file mode 100644 index 0000000..5581516 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_987.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_988.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_988.png new file mode 100644 index 0000000..65b6eb6 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_988.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_989.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_989.png new file mode 100644 index 0000000..b5969d5 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_989.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_99.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_99.png new file mode 100644 index 0000000..2735848 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_99.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_990.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_990.png new file mode 100644 index 0000000..ce80e8e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_990.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_991.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_991.png new file mode 100644 index 0000000..0db3ec1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_991.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_992.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_992.png new file mode 100644 index 0000000..5228b49 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_992.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_993.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_993.png new file mode 100644 index 0000000..f76ab63 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_993.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_994.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_994.png new file mode 100644 index 0000000..e415c1d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_994.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_995.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_995.png new file mode 100644 index 0000000..46af11f Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_995.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_996.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_996.png new file mode 100644 index 0000000..1ff7ab0 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_996.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_997.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_997.png new file mode 100644 index 0000000..c1b5c84 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_997.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_998.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_998.png new file mode 100644 index 0000000..ced9d6d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_998.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_999.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_999.png new file mode 100644 index 0000000..1012640 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/images/captcha_999.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_0.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_0.txt new file mode 100644 index 0000000..12beefe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_0.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_1.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_1.txt new file mode 100644 index 0000000..c054805 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_1.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_10.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_10.txt new file mode 100644 index 0000000..54b2eaa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_10.txt @@ -0,0 +1 @@ +0 0.35 0.271875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_100.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_100.txt new file mode 100644 index 0000000..699eba8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_100.txt @@ -0,0 +1 @@ +0 0.5346153846153846 0.521875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_1000.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_1000.txt new file mode 100644 index 0000000..5c61787 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_1000.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.540625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_101.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_101.txt new file mode 100644 index 0000000..ae5cb85 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_101.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_102.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_102.txt new file mode 100644 index 0000000..11a1663 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_102.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_103.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_103.txt new file mode 100644 index 0000000..2ed7cb7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_103.txt @@ -0,0 +1 @@ +0 0.5346153846153846 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_104.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_104.txt new file mode 100644 index 0000000..5c0b4f1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_104.txt @@ -0,0 +1 @@ +0 0.5557692307692308 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_105.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_105.txt new file mode 100644 index 0000000..46b1b89 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_105.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_106.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_106.txt new file mode 100644 index 0000000..9d0be29 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_106.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_107.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_107.txt new file mode 100644 index 0000000..51db49a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_107.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_108.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_108.txt new file mode 100644 index 0000000..6bbd89c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_108.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_109.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_109.txt new file mode 100644 index 0000000..8355674 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_109.txt @@ -0,0 +1 @@ +0 0.46923076923076923 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_11.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_11.txt new file mode 100644 index 0000000..3613a4f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_11.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_110.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_110.txt new file mode 100644 index 0000000..f4ecef8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_110.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.146875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_111.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_111.txt new file mode 100644 index 0000000..8bc2bf0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_111.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_112.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_112.txt new file mode 100644 index 0000000..60fb234 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_112.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.628125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_113.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_113.txt new file mode 100644 index 0000000..4a5718d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_113.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_114.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_114.txt new file mode 100644 index 0000000..50ff5f1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_114.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_115.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_115.txt new file mode 100644 index 0000000..520e716 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_115.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.54375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_116.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_116.txt new file mode 100644 index 0000000..3f9ca4d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_116.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.228125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_117.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_117.txt new file mode 100644 index 0000000..1f0b3f6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_117.txt @@ -0,0 +1 @@ +0 0.6230769230769231 0.18125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_118.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_118.txt new file mode 100644 index 0000000..a3154e5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_118.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_119.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_119.txt new file mode 100644 index 0000000..050a301 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_119.txt @@ -0,0 +1 @@ +0 0.6865384615384615 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_12.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_12.txt new file mode 100644 index 0000000..14a88cb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_12.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_120.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_120.txt new file mode 100644 index 0000000..c37f55a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_120.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.34375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_121.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_121.txt new file mode 100644 index 0000000..7d5e10d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_121.txt @@ -0,0 +1 @@ +0 0.5365384615384615 0.33125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_122.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_122.txt new file mode 100644 index 0000000..2022da2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_122.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_123.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_123.txt new file mode 100644 index 0000000..cd07f11 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_123.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_124.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_124.txt new file mode 100644 index 0000000..2971de1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_124.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_125.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_125.txt new file mode 100644 index 0000000..1f98d09 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_125.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.521875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_126.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_126.txt new file mode 100644 index 0000000..427dad6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_126.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_127.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_127.txt new file mode 100644 index 0000000..0653eb3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_127.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_128.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_128.txt new file mode 100644 index 0000000..c5a3689 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_128.txt @@ -0,0 +1 @@ +0 0.6711538461538461 0.209375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_129.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_129.txt new file mode 100644 index 0000000..5a07582 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_129.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.203125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_13.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_13.txt new file mode 100644 index 0000000..b870c20 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_13.txt @@ -0,0 +1 @@ +0 0.6057692307692307 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_130.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_130.txt new file mode 100644 index 0000000..4d930bf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_130.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.4625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_131.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_131.txt new file mode 100644 index 0000000..77dc521 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_131.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_132.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_132.txt new file mode 100644 index 0000000..75a88ff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_132.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_133.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_133.txt new file mode 100644 index 0000000..e8968e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_133.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.36875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_134.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_134.txt new file mode 100644 index 0000000..4971157 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_134.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_135.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_135.txt new file mode 100644 index 0000000..2744d7c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_135.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.546875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_136.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_136.txt new file mode 100644 index 0000000..faa5585 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_136.txt @@ -0,0 +1 @@ +0 0.4115384615384615 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_137.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_137.txt new file mode 100644 index 0000000..122fada --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_137.txt @@ -0,0 +1 @@ +0 0.5269230769230769 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_138.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_138.txt new file mode 100644 index 0000000..8efd0c6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_138.txt @@ -0,0 +1 @@ +0 0.676923076923077 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_139.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_139.txt new file mode 100644 index 0000000..9ce12c0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_139.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_14.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_14.txt new file mode 100644 index 0000000..844bd09 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_14.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_140.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_140.txt new file mode 100644 index 0000000..b1bf29d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_140.txt @@ -0,0 +1 @@ +0 0.4653846153846154 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_141.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_141.txt new file mode 100644 index 0000000..d14803d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_141.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.278125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_142.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_142.txt new file mode 100644 index 0000000..ecfa39a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_142.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_143.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_143.txt new file mode 100644 index 0000000..e595503 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_143.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.221875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_144.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_144.txt new file mode 100644 index 0000000..1a905d9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_144.txt @@ -0,0 +1 @@ +0 0.3596153846153846 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_145.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_145.txt new file mode 100644 index 0000000..7d11c71 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_145.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.221875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_146.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_146.txt new file mode 100644 index 0000000..08fe145 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_146.txt @@ -0,0 +1 @@ +0 0.325 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_147.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_147.txt new file mode 100644 index 0000000..aeb53ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_147.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_148.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_148.txt new file mode 100644 index 0000000..a95127e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_148.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.58125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_149.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_149.txt new file mode 100644 index 0000000..9ed089f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_149.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_15.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_15.txt new file mode 100644 index 0000000..1e93e01 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_15.txt @@ -0,0 +1 @@ +0 0.325 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_150.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_150.txt new file mode 100644 index 0000000..d591ff2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_150.txt @@ -0,0 +1 @@ +0 0.6538461538461539 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_151.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_151.txt new file mode 100644 index 0000000..cac71f2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_151.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_152.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_152.txt new file mode 100644 index 0000000..7088c08 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_152.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_153.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_153.txt new file mode 100644 index 0000000..db33103 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_153.txt @@ -0,0 +1 @@ +0 0.425 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_154.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_154.txt new file mode 100644 index 0000000..4fe5d65 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_154.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_155.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_155.txt new file mode 100644 index 0000000..39860fa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_155.txt @@ -0,0 +1 @@ +0 0.48653846153846153 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_156.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_156.txt new file mode 100644 index 0000000..ab94693 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_156.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_157.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_157.txt new file mode 100644 index 0000000..6771b35 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_157.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_158.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_158.txt new file mode 100644 index 0000000..0cf2e81 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_158.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_159.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_159.txt new file mode 100644 index 0000000..3547ada --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_159.txt @@ -0,0 +1 @@ +0 0.5346153846153846 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_16.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_16.txt new file mode 100644 index 0000000..9df1347 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_16.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.15 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_160.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_160.txt new file mode 100644 index 0000000..7061df8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_160.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.078125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_161.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_161.txt new file mode 100644 index 0000000..a702321 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_161.txt @@ -0,0 +1 @@ +0 0.625 0.190625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_162.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_162.txt new file mode 100644 index 0000000..dfab0d5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_162.txt @@ -0,0 +1 @@ +0 0.6653846153846154 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_163.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_163.txt new file mode 100644 index 0000000..93df56c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_163.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.571875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_164.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_164.txt new file mode 100644 index 0000000..9a3fe89 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_164.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_165.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_165.txt new file mode 100644 index 0000000..4beae6e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_165.txt @@ -0,0 +1 @@ +0 0.3769230769230769 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_166.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_166.txt new file mode 100644 index 0000000..4bae9f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_166.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_167.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_167.txt new file mode 100644 index 0000000..152de20 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_167.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_168.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_168.txt new file mode 100644 index 0000000..dcee446 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_168.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_169.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_169.txt new file mode 100644 index 0000000..5aa92c5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_169.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_17.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_17.txt new file mode 100644 index 0000000..f76dd9c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_17.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_170.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_170.txt new file mode 100644 index 0000000..2f188b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_170.txt @@ -0,0 +1 @@ +0 0.5807692307692308 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_171.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_171.txt new file mode 100644 index 0000000..9c17619 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_171.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_172.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_172.txt new file mode 100644 index 0000000..eb4b9a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_172.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_173.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_173.txt new file mode 100644 index 0000000..5f0919b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_173.txt @@ -0,0 +1 @@ +0 0.3096153846153846 0.43125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_174.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_174.txt new file mode 100644 index 0000000..e035bd7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_174.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_175.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_175.txt new file mode 100644 index 0000000..c464d2e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_175.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_176.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_176.txt new file mode 100644 index 0000000..75367c6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_176.txt @@ -0,0 +1 @@ +0 0.5788461538461539 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_177.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_177.txt new file mode 100644 index 0000000..59c5a49 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_177.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_178.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_178.txt new file mode 100644 index 0000000..6fbed4a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_178.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_179.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_179.txt new file mode 100644 index 0000000..8443f60 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_179.txt @@ -0,0 +1 @@ +0 0.4 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_18.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_18.txt new file mode 100644 index 0000000..5aaf59f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_18.txt @@ -0,0 +1 @@ +0 0.575 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_180.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_180.txt new file mode 100644 index 0000000..b716af3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_180.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.140625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_181.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_181.txt new file mode 100644 index 0000000..4ab791b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_181.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_182.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_182.txt new file mode 100644 index 0000000..a9180c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_182.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_183.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_183.txt new file mode 100644 index 0000000..6f874ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_183.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_184.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_184.txt new file mode 100644 index 0000000..dc5a7e7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_184.txt @@ -0,0 +1 @@ +0 0.5807692307692308 0.30625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_185.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_185.txt new file mode 100644 index 0000000..9f6e987 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_185.txt @@ -0,0 +1 @@ +0 0.4634615384615385 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_186.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_186.txt new file mode 100644 index 0000000..b55734a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_186.txt @@ -0,0 +1 @@ +0 0.45 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_187.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_187.txt new file mode 100644 index 0000000..e51ecb0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_187.txt @@ -0,0 +1 @@ +0 0.6923076923076923 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_188.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_188.txt new file mode 100644 index 0000000..8cc3dce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_188.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_189.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_189.txt new file mode 100644 index 0000000..56e8dc2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_189.txt @@ -0,0 +1 @@ +0 0.3269230769230769 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_19.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_19.txt new file mode 100644 index 0000000..a85467f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_19.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.56875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_190.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_190.txt new file mode 100644 index 0000000..c0c85e2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_190.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.415625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_191.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_191.txt new file mode 100644 index 0000000..8a1a386 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_191.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.565625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_192.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_192.txt new file mode 100644 index 0000000..f90e6a7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_192.txt @@ -0,0 +1 @@ +0 0.3153846153846154 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_193.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_193.txt new file mode 100644 index 0000000..36072de --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_193.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.55625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_194.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_194.txt new file mode 100644 index 0000000..118684c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_194.txt @@ -0,0 +1 @@ +0 0.6442307692307693 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_195.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_195.txt new file mode 100644 index 0000000..83ff8b5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_195.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_196.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_196.txt new file mode 100644 index 0000000..44e1f21 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_196.txt @@ -0,0 +1 @@ +0 0.49230769230769234 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_197.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_197.txt new file mode 100644 index 0000000..868004d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_197.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_198.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_198.txt new file mode 100644 index 0000000..96665d0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_198.txt @@ -0,0 +1 @@ +0 0.5192307692307693 0.44375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_199.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_199.txt new file mode 100644 index 0000000..61463f4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_199.txt @@ -0,0 +1 @@ +0 0.3153846153846154 0.446875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_2.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_2.txt new file mode 100644 index 0000000..c2672a3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_2.txt @@ -0,0 +1 @@ +0 0.4115384615384615 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_20.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_20.txt new file mode 100644 index 0000000..05deb62 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_20.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.2875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_200.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_200.txt new file mode 100644 index 0000000..7f61fb4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_200.txt @@ -0,0 +1 @@ +0 0.575 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_201.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_201.txt new file mode 100644 index 0000000..95da5a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_201.txt @@ -0,0 +1 @@ +0 0.6807692307692308 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_202.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_202.txt new file mode 100644 index 0000000..98257f3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_202.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_203.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_203.txt new file mode 100644 index 0000000..4bef2cd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_203.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_204.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_204.txt new file mode 100644 index 0000000..9ea86c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_204.txt @@ -0,0 +1 @@ +0 0.41923076923076924 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_205.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_205.txt new file mode 100644 index 0000000..5019a1a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_205.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_206.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_206.txt new file mode 100644 index 0000000..fc19620 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_206.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_207.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_207.txt new file mode 100644 index 0000000..24dad37 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_207.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_208.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_208.txt new file mode 100644 index 0000000..b8b464e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_208.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.634375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_209.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_209.txt new file mode 100644 index 0000000..f6733dc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_209.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.659375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_21.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_21.txt new file mode 100644 index 0000000..accb7df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_21.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.56875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_210.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_210.txt new file mode 100644 index 0000000..98e710c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_210.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_211.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_211.txt new file mode 100644 index 0000000..b7ae955 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_211.txt @@ -0,0 +1 @@ +0 0.5615384615384615 0.14375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_212.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_212.txt new file mode 100644 index 0000000..434702e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_212.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.390625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_213.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_213.txt new file mode 100644 index 0000000..fb9f9a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_213.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_214.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_214.txt new file mode 100644 index 0000000..f1a17ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_214.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.40625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_215.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_215.txt new file mode 100644 index 0000000..11b77ab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_215.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_216.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_216.txt new file mode 100644 index 0000000..11e83ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_216.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_217.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_217.txt new file mode 100644 index 0000000..ab6b152 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_217.txt @@ -0,0 +1 @@ +0 0.40384615384615385 0.571875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_218.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_218.txt new file mode 100644 index 0000000..73368e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_218.txt @@ -0,0 +1 @@ +0 0.5115384615384615 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_219.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_219.txt new file mode 100644 index 0000000..f810725 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_219.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_22.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_22.txt new file mode 100644 index 0000000..f7f3030 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_22.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.565625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_220.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_220.txt new file mode 100644 index 0000000..d73a539 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_220.txt @@ -0,0 +1 @@ +0 0.65 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_221.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_221.txt new file mode 100644 index 0000000..6a4c868 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_221.txt @@ -0,0 +1 @@ +0 0.6711538461538461 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_222.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_222.txt new file mode 100644 index 0000000..537f6da --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_222.txt @@ -0,0 +1 @@ +0 0.3153846153846154 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_223.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_223.txt new file mode 100644 index 0000000..9ed9a1e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_223.txt @@ -0,0 +1 @@ +0 0.3096153846153846 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_224.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_224.txt new file mode 100644 index 0000000..72e2c2a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_224.txt @@ -0,0 +1 @@ +0 0.6269230769230769 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_225.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_225.txt new file mode 100644 index 0000000..4955961 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_225.txt @@ -0,0 +1 @@ +0 0.5557692307692308 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_226.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_226.txt new file mode 100644 index 0000000..c219f6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_226.txt @@ -0,0 +1 @@ +0 0.6442307692307693 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_227.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_227.txt new file mode 100644 index 0000000..7a7709d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_227.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_228.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_228.txt new file mode 100644 index 0000000..8d6008a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_228.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.45 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_229.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_229.txt new file mode 100644 index 0000000..52aeab9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_229.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_23.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_23.txt new file mode 100644 index 0000000..37854fb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_23.txt @@ -0,0 +1 @@ +0 0.3730769230769231 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_230.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_230.txt new file mode 100644 index 0000000..b411f81 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_230.txt @@ -0,0 +1 @@ +0 0.3576923076923077 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_231.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_231.txt new file mode 100644 index 0000000..a8b1476 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_231.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_232.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_232.txt new file mode 100644 index 0000000..2b5782d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_232.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_233.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_233.txt new file mode 100644 index 0000000..0f490c0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_233.txt @@ -0,0 +1 @@ +0 0.55 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_234.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_234.txt new file mode 100644 index 0000000..03e5f54 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_234.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_235.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_235.txt new file mode 100644 index 0000000..d1f70cb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_235.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_236.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_236.txt new file mode 100644 index 0000000..41b038b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_236.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_237.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_237.txt new file mode 100644 index 0000000..53681a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_237.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.590625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_238.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_238.txt new file mode 100644 index 0000000..1de0029 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_238.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.415625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_239.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_239.txt new file mode 100644 index 0000000..b9de947 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_239.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_24.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_24.txt new file mode 100644 index 0000000..711358c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_24.txt @@ -0,0 +1 @@ +0 0.35 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_240.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_240.txt new file mode 100644 index 0000000..76501ca --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_240.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_241.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_241.txt new file mode 100644 index 0000000..98744ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_241.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_242.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_242.txt new file mode 100644 index 0000000..7f7231b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_242.txt @@ -0,0 +1 @@ +0 0.5019230769230769 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_243.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_243.txt new file mode 100644 index 0000000..4ffddce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_243.txt @@ -0,0 +1 @@ +0 0.525 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_244.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_244.txt new file mode 100644 index 0000000..79542f3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_244.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_245.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_245.txt new file mode 100644 index 0000000..0df73ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_245.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_246.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_246.txt new file mode 100644 index 0000000..f637261 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_246.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_247.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_247.txt new file mode 100644 index 0000000..b8224ab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_247.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_248.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_248.txt new file mode 100644 index 0000000..63e21b9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_248.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.565625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_249.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_249.txt new file mode 100644 index 0000000..fa22cdd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_249.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.578125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_25.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_25.txt new file mode 100644 index 0000000..c5deaca --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_25.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_250.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_250.txt new file mode 100644 index 0000000..ae714ce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_250.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.221875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_251.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_251.txt new file mode 100644 index 0000000..6ce886d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_251.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.378125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_252.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_252.txt new file mode 100644 index 0000000..8346e57 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_252.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_253.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_253.txt new file mode 100644 index 0000000..0bba845 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_253.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_254.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_254.txt new file mode 100644 index 0000000..e6f1b0b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_254.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.240625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_255.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_255.txt new file mode 100644 index 0000000..5f27c7f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_255.txt @@ -0,0 +1 @@ +0 0.48653846153846153 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_256.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_256.txt new file mode 100644 index 0000000..d28c02b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_256.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.34375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_257.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_257.txt new file mode 100644 index 0000000..5b9fff2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_257.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_258.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_258.txt new file mode 100644 index 0000000..5cca452 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_258.txt @@ -0,0 +1 @@ +0 0.475 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_259.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_259.txt new file mode 100644 index 0000000..c422330 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_259.txt @@ -0,0 +1 @@ +0 0.4230769230769231 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_26.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_26.txt new file mode 100644 index 0000000..4cd4185 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_26.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_260.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_260.txt new file mode 100644 index 0000000..5159af0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_260.txt @@ -0,0 +1 @@ +0 0.4673076923076923 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_261.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_261.txt new file mode 100644 index 0000000..92da60b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_261.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_262.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_262.txt new file mode 100644 index 0000000..02d55c7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_262.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_263.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_263.txt new file mode 100644 index 0000000..0c9f164 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_263.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_264.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_264.txt new file mode 100644 index 0000000..b9e6952 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_264.txt @@ -0,0 +1 @@ +0 0.475 0.140625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_265.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_265.txt new file mode 100644 index 0000000..10215ad --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_265.txt @@ -0,0 +1 @@ +0 0.45 0.525 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_266.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_266.txt new file mode 100644 index 0000000..7ab2a6b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_266.txt @@ -0,0 +1 @@ +0 0.6673076923076923 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_267.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_267.txt new file mode 100644 index 0000000..ba9a152 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_267.txt @@ -0,0 +1 @@ +0 0.35384615384615387 0.546875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_268.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_268.txt new file mode 100644 index 0000000..c139e9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_268.txt @@ -0,0 +1 @@ +0 0.48846153846153845 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_269.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_269.txt new file mode 100644 index 0000000..b54bc69 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_269.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.24375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_27.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_27.txt new file mode 100644 index 0000000..e45d28a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_27.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.628125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_270.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_270.txt new file mode 100644 index 0000000..7368fb8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_270.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_271.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_271.txt new file mode 100644 index 0000000..c4f80f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_271.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_272.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_272.txt new file mode 100644 index 0000000..657b5c6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_272.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.48125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_273.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_273.txt new file mode 100644 index 0000000..04eae6c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_273.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_274.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_274.txt new file mode 100644 index 0000000..1bf6af4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_274.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.4625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_275.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_275.txt new file mode 100644 index 0000000..e3b2a02 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_275.txt @@ -0,0 +1 @@ +0 0.6269230769230769 0.459375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_276.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_276.txt new file mode 100644 index 0000000..eab8ec0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_276.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_277.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_277.txt new file mode 100644 index 0000000..82c1143 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_277.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_278.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_278.txt new file mode 100644 index 0000000..0439508 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_278.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_279.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_279.txt new file mode 100644 index 0000000..7643b0d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_279.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_28.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_28.txt new file mode 100644 index 0000000..3ad369c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_28.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.390625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_280.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_280.txt new file mode 100644 index 0000000..4c8d4a9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_280.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_281.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_281.txt new file mode 100644 index 0000000..9b487aa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_281.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.6375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_282.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_282.txt new file mode 100644 index 0000000..4531e11 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_282.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_283.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_283.txt new file mode 100644 index 0000000..37c3ede --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_283.txt @@ -0,0 +1 @@ +0 0.575 0.640625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_284.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_284.txt new file mode 100644 index 0000000..7772f65 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_284.txt @@ -0,0 +1 @@ +0 0.6230769230769231 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_285.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_285.txt new file mode 100644 index 0000000..ef548be --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_285.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_286.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_286.txt new file mode 100644 index 0000000..3fde522 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_286.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.65 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_287.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_287.txt new file mode 100644 index 0000000..aff8654 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_287.txt @@ -0,0 +1 @@ +0 0.625 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_288.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_288.txt new file mode 100644 index 0000000..673e13b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_288.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_289.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_289.txt new file mode 100644 index 0000000..03cb0f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_289.txt @@ -0,0 +1 @@ +0 0.573076923076923 0.578125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_29.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_29.txt new file mode 100644 index 0000000..a6466b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_29.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_290.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_290.txt new file mode 100644 index 0000000..90d82a3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_290.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_291.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_291.txt new file mode 100644 index 0000000..ae1182f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_291.txt @@ -0,0 +1 @@ +0 0.3153846153846154 0.58125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_292.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_292.txt new file mode 100644 index 0000000..506aa6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_292.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.540625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_293.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_293.txt new file mode 100644 index 0000000..141195f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_293.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_294.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_294.txt new file mode 100644 index 0000000..9f989c9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_294.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_295.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_295.txt new file mode 100644 index 0000000..002800a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_295.txt @@ -0,0 +1 @@ +0 0.4346153846153846 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_296.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_296.txt new file mode 100644 index 0000000..300e61c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_296.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_297.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_297.txt new file mode 100644 index 0000000..81b79e0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_297.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_298.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_298.txt new file mode 100644 index 0000000..e826550 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_298.txt @@ -0,0 +1 @@ +0 0.6884615384615385 0.278125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_299.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_299.txt new file mode 100644 index 0000000..e2aca35 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_299.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_3.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_3.txt new file mode 100644 index 0000000..d470c30 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_3.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_30.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_30.txt new file mode 100644 index 0000000..da706ce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_30.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_300.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_300.txt new file mode 100644 index 0000000..a5b17d0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_300.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_301.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_301.txt new file mode 100644 index 0000000..1079851 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_301.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_302.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_302.txt new file mode 100644 index 0000000..ee77bfc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_302.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.30625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_303.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_303.txt new file mode 100644 index 0000000..b92df26 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_303.txt @@ -0,0 +1 @@ +0 0.5230769230769231 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_304.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_304.txt new file mode 100644 index 0000000..70813a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_304.txt @@ -0,0 +1 @@ +0 0.46923076923076923 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_305.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_305.txt new file mode 100644 index 0000000..1cc8b3f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_305.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.165625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_306.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_306.txt new file mode 100644 index 0000000..37c3ede --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_306.txt @@ -0,0 +1 @@ +0 0.575 0.640625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_307.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_307.txt new file mode 100644 index 0000000..9e212d7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_307.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_308.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_308.txt new file mode 100644 index 0000000..1550373 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_308.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_309.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_309.txt new file mode 100644 index 0000000..0c1f148 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_309.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_31.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_31.txt new file mode 100644 index 0000000..79792f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_31.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_310.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_310.txt new file mode 100644 index 0000000..f79a7af --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_310.txt @@ -0,0 +1 @@ +0 0.4096153846153846 0.63125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_311.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_311.txt new file mode 100644 index 0000000..25bd653 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_311.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_312.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_312.txt new file mode 100644 index 0000000..73bb1d3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_312.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.43125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_313.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_313.txt new file mode 100644 index 0000000..32ecaab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_313.txt @@ -0,0 +1 @@ +0 0.5192307692307693 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_314.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_314.txt new file mode 100644 index 0000000..ed3461b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_314.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_315.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_315.txt new file mode 100644 index 0000000..f9616fa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_315.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_316.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_316.txt new file mode 100644 index 0000000..d57d0a0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_316.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.365625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_317.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_317.txt new file mode 100644 index 0000000..5d12d3b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_317.txt @@ -0,0 +1 @@ +0 0.4634615384615385 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_318.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_318.txt new file mode 100644 index 0000000..844bd09 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_318.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_319.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_319.txt new file mode 100644 index 0000000..4b368ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_319.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_32.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_32.txt new file mode 100644 index 0000000..df9db74 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_32.txt @@ -0,0 +1 @@ +0 0.5615384615384615 0.521875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_320.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_320.txt new file mode 100644 index 0000000..eb95c53 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_320.txt @@ -0,0 +1 @@ +0 0.6923076923076923 0.271875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_321.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_321.txt new file mode 100644 index 0000000..70b066b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_321.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_322.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_322.txt new file mode 100644 index 0000000..4ef9fe9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_322.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_323.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_323.txt new file mode 100644 index 0000000..dab9016 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_323.txt @@ -0,0 +1 @@ +0 0.41923076923076924 0.68125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_324.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_324.txt new file mode 100644 index 0000000..3e25071 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_324.txt @@ -0,0 +1 @@ +0 0.6923076923076923 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_325.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_325.txt new file mode 100644 index 0000000..b83dde7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_325.txt @@ -0,0 +1 @@ +0 0.6 0.384375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_326.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_326.txt new file mode 100644 index 0000000..1d7c7b5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_326.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.54375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_327.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_327.txt new file mode 100644 index 0000000..41ff8df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_327.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.590625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_328.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_328.txt new file mode 100644 index 0000000..309b42c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_328.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_329.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_329.txt new file mode 100644 index 0000000..f12421b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_329.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_33.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_33.txt new file mode 100644 index 0000000..c5deaca --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_33.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_330.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_330.txt new file mode 100644 index 0000000..d786bc2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_330.txt @@ -0,0 +1 @@ +0 0.325 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_331.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_331.txt new file mode 100644 index 0000000..5ddfd65 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_331.txt @@ -0,0 +1 @@ +0 0.5 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_332.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_332.txt new file mode 100644 index 0000000..c924c58 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_332.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_333.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_333.txt new file mode 100644 index 0000000..d260eab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_333.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.446875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_334.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_334.txt new file mode 100644 index 0000000..a8f7cb6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_334.txt @@ -0,0 +1 @@ +0 0.35384615384615387 0.44375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_335.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_335.txt new file mode 100644 index 0000000..4c55d96 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_335.txt @@ -0,0 +1 @@ +0 0.5192307692307693 0.409375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_336.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_336.txt new file mode 100644 index 0000000..46b56a5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_336.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_337.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_337.txt new file mode 100644 index 0000000..189a66f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_337.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_338.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_338.txt new file mode 100644 index 0000000..9875178 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_338.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.634375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_339.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_339.txt new file mode 100644 index 0000000..c7d8886 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_339.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_34.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_34.txt new file mode 100644 index 0000000..565236e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_34.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_340.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_340.txt new file mode 100644 index 0000000..cb0d0e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_340.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_341.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_341.txt new file mode 100644 index 0000000..98b99c8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_341.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_342.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_342.txt new file mode 100644 index 0000000..2a3bba7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_342.txt @@ -0,0 +1 @@ +0 0.3269230769230769 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_343.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_343.txt new file mode 100644 index 0000000..f3467f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_343.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_344.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_344.txt new file mode 100644 index 0000000..bf174da --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_344.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_345.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_345.txt new file mode 100644 index 0000000..84d80c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_345.txt @@ -0,0 +1 @@ +0 0.45384615384615384 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_346.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_346.txt new file mode 100644 index 0000000..969e9bd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_346.txt @@ -0,0 +1 @@ +0 0.3576923076923077 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_347.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_347.txt new file mode 100644 index 0000000..ecdf74a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_347.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_348.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_348.txt new file mode 100644 index 0000000..c104351 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_348.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_349.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_349.txt new file mode 100644 index 0000000..875d657 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_349.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.434375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_35.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_35.txt new file mode 100644 index 0000000..0eaaff7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_35.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_350.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_350.txt new file mode 100644 index 0000000..06ddc7e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_350.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.4125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_351.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_351.txt new file mode 100644 index 0000000..00d5e31 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_351.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_352.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_352.txt new file mode 100644 index 0000000..eed5531 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_352.txt @@ -0,0 +1 @@ +0 0.6615384615384615 0.365625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_353.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_353.txt new file mode 100644 index 0000000..2a5df5e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_353.txt @@ -0,0 +1 @@ +0 0.5653846153846154 0.36875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_354.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_354.txt new file mode 100644 index 0000000..019b6f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_354.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_355.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_355.txt new file mode 100644 index 0000000..871056a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_355.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_356.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_356.txt new file mode 100644 index 0000000..73fb54a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_356.txt @@ -0,0 +1 @@ +0 0.3269230769230769 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_357.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_357.txt new file mode 100644 index 0000000..efa98ad --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_357.txt @@ -0,0 +1 @@ +0 0.5 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_358.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_358.txt new file mode 100644 index 0000000..55d13fc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_358.txt @@ -0,0 +1 @@ +0 0.6576923076923077 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_359.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_359.txt new file mode 100644 index 0000000..fca2498 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_359.txt @@ -0,0 +1 @@ +0 0.6538461538461539 0.303125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_36.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_36.txt new file mode 100644 index 0000000..fd36b9d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_36.txt @@ -0,0 +1 @@ +0 0.676923076923077 0.340625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_360.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_360.txt new file mode 100644 index 0000000..d824628 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_360.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_361.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_361.txt new file mode 100644 index 0000000..bcf6fda --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_361.txt @@ -0,0 +1 @@ +0 0.6596153846153846 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_362.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_362.txt new file mode 100644 index 0000000..1f19eaf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_362.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_363.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_363.txt new file mode 100644 index 0000000..6ace519 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_363.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_364.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_364.txt new file mode 100644 index 0000000..0698cf8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_364.txt @@ -0,0 +1 @@ +0 0.6057692307692307 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_365.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_365.txt new file mode 100644 index 0000000..af6d2a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_365.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.521875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_366.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_366.txt new file mode 100644 index 0000000..e547b79 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_366.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_367.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_367.txt new file mode 100644 index 0000000..0bf34fd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_367.txt @@ -0,0 +1 @@ +0 0.4346153846153846 0.54375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_368.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_368.txt new file mode 100644 index 0000000..076ada7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_368.txt @@ -0,0 +1 @@ +0 0.5269230769230769 0.540625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_369.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_369.txt new file mode 100644 index 0000000..187efd2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_369.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_37.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_37.txt new file mode 100644 index 0000000..e192d16 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_37.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_370.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_370.txt new file mode 100644 index 0000000..52b43b0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_370.txt @@ -0,0 +1 @@ +0 0.4096153846153846 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_371.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_371.txt new file mode 100644 index 0000000..4420e9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_371.txt @@ -0,0 +1 @@ +0 0.3576923076923077 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_372.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_372.txt new file mode 100644 index 0000000..3791163 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_372.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_373.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_373.txt new file mode 100644 index 0000000..146e650 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_373.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.60625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_374.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_374.txt new file mode 100644 index 0000000..276c682 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_374.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_375.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_375.txt new file mode 100644 index 0000000..29b2b97 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_375.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_376.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_376.txt new file mode 100644 index 0000000..67f7282 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_376.txt @@ -0,0 +1 @@ +0 0.551923076923077 0.4625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_377.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_377.txt new file mode 100644 index 0000000..9332c77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_377.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_378.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_378.txt new file mode 100644 index 0000000..7ff2a1b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_378.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_379.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_379.txt new file mode 100644 index 0000000..87e53f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_379.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.434375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_38.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_38.txt new file mode 100644 index 0000000..bace8b1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_38.txt @@ -0,0 +1 @@ +0 0.425 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_380.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_380.txt new file mode 100644 index 0000000..2f2ec60 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_380.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.578125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_381.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_381.txt new file mode 100644 index 0000000..1a4205f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_381.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_382.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_382.txt new file mode 100644 index 0000000..c386580 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_382.txt @@ -0,0 +1 @@ +0 0.575 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_383.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_383.txt new file mode 100644 index 0000000..c36959f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_383.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_384.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_384.txt new file mode 100644 index 0000000..1a7c094 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_384.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_385.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_385.txt new file mode 100644 index 0000000..b5f76e6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_385.txt @@ -0,0 +1 @@ +0 0.5134615384615384 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_386.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_386.txt new file mode 100644 index 0000000..f12421b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_386.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_387.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_387.txt new file mode 100644 index 0000000..3526530 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_387.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_388.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_388.txt new file mode 100644 index 0000000..f4c8eab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_388.txt @@ -0,0 +1 @@ +0 0.4673076923076923 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_389.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_389.txt new file mode 100644 index 0000000..9aea70c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_389.txt @@ -0,0 +1 @@ +0 0.575 0.28125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_39.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_39.txt new file mode 100644 index 0000000..0faaa15 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_39.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_390.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_390.txt new file mode 100644 index 0000000..2fcdc63 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_390.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.6375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_391.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_391.txt new file mode 100644 index 0000000..22ccd77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_391.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.365625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_392.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_392.txt new file mode 100644 index 0000000..dae9650 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_392.txt @@ -0,0 +1 @@ +0 0.5634615384615385 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_393.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_393.txt new file mode 100644 index 0000000..18e23f2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_393.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_394.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_394.txt new file mode 100644 index 0000000..06b8366 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_394.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_395.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_395.txt new file mode 100644 index 0000000..a8adc08 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_395.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_396.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_396.txt new file mode 100644 index 0000000..ae187e8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_396.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_397.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_397.txt new file mode 100644 index 0000000..ae2ed44 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_397.txt @@ -0,0 +1 @@ +0 0.6826923076923077 0.278125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_398.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_398.txt new file mode 100644 index 0000000..a8dd6b6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_398.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_399.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_399.txt new file mode 100644 index 0000000..56b31b5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_399.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_4.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_4.txt new file mode 100644 index 0000000..416b5cb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_4.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.390625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_40.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_40.txt new file mode 100644 index 0000000..334f385 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_40.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.240625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_400.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_400.txt new file mode 100644 index 0000000..05bc6fe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_400.txt @@ -0,0 +1 @@ +0 0.5615384615384615 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_401.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_401.txt new file mode 100644 index 0000000..1c512ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_401.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_402.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_402.txt new file mode 100644 index 0000000..d53205d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_402.txt @@ -0,0 +1 @@ +0 0.325 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_403.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_403.txt new file mode 100644 index 0000000..f033e7c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_403.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_404.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_404.txt new file mode 100644 index 0000000..cd7addf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_404.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_405.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_405.txt new file mode 100644 index 0000000..34ce950 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_405.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_406.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_406.txt new file mode 100644 index 0000000..5e33568 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_406.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_407.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_407.txt new file mode 100644 index 0000000..3a3ed5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_407.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_408.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_408.txt new file mode 100644 index 0000000..e81880e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_408.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.15 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_409.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_409.txt new file mode 100644 index 0000000..af5eaa4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_409.txt @@ -0,0 +1 @@ +0 0.5980769230769231 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_41.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_41.txt new file mode 100644 index 0000000..e5619b6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_41.txt @@ -0,0 +1 @@ +0 0.5461538461538461 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_410.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_410.txt new file mode 100644 index 0000000..f24dcec --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_410.txt @@ -0,0 +1 @@ +0 0.6346153846153846 0.33125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_411.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_411.txt new file mode 100644 index 0000000..71d06c5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_411.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_412.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_412.txt new file mode 100644 index 0000000..7af0ef9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_412.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_413.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_413.txt new file mode 100644 index 0000000..d8fb839 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_413.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_414.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_414.txt new file mode 100644 index 0000000..1ad44a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_414.txt @@ -0,0 +1 @@ +0 0.5634615384615385 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_415.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_415.txt new file mode 100644 index 0000000..6b042de --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_415.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_416.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_416.txt new file mode 100644 index 0000000..fa3285d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_416.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_417.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_417.txt new file mode 100644 index 0000000..409cf73 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_417.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_418.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_418.txt new file mode 100644 index 0000000..a03149f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_418.txt @@ -0,0 +1 @@ +0 0.3596153846153846 0.459375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_419.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_419.txt new file mode 100644 index 0000000..bb1d337 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_419.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_42.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_42.txt new file mode 100644 index 0000000..fe23d41 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_42.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_420.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_420.txt new file mode 100644 index 0000000..8432eb0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_420.txt @@ -0,0 +1 @@ +0 0.4346153846153846 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_421.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_421.txt new file mode 100644 index 0000000..a87bf60 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_421.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.65 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_422.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_422.txt new file mode 100644 index 0000000..abffae2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_422.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.1125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_423.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_423.txt new file mode 100644 index 0000000..dc5afa5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_423.txt @@ -0,0 +1 @@ +0 0.4307692307692308 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_424.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_424.txt new file mode 100644 index 0000000..a5838ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_424.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_425.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_425.txt new file mode 100644 index 0000000..3bfd9eb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_425.txt @@ -0,0 +1 @@ +0 0.4096153846153846 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_426.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_426.txt new file mode 100644 index 0000000..5a37dfc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_426.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.234375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_427.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_427.txt new file mode 100644 index 0000000..0dcbe78 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_427.txt @@ -0,0 +1 @@ +0 0.6 0.496875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_428.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_428.txt new file mode 100644 index 0000000..3ec7e33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_428.txt @@ -0,0 +1 @@ +0 0.5538461538461539 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_429.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_429.txt new file mode 100644 index 0000000..b3ec0c3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_429.txt @@ -0,0 +1 @@ +0 0.4634615384615385 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_43.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_43.txt new file mode 100644 index 0000000..ef9e295 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_43.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_430.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_430.txt new file mode 100644 index 0000000..572a01a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_430.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_431.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_431.txt new file mode 100644 index 0000000..fec7a36 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_431.txt @@ -0,0 +1 @@ +0 0.475 0.434375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_432.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_432.txt new file mode 100644 index 0000000..789240f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_432.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_433.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_433.txt new file mode 100644 index 0000000..43b8aff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_433.txt @@ -0,0 +1 @@ +0 0.6519230769230769 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_434.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_434.txt new file mode 100644 index 0000000..82e07fc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_434.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_435.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_435.txt new file mode 100644 index 0000000..1361397 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_435.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_436.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_436.txt new file mode 100644 index 0000000..1bec417 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_436.txt @@ -0,0 +1 @@ +0 0.6115384615384616 0.55 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_437.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_437.txt new file mode 100644 index 0000000..66529c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_437.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_438.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_438.txt new file mode 100644 index 0000000..a90d501 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_438.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.303125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_439.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_439.txt new file mode 100644 index 0000000..1cca387 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_439.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_44.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_44.txt new file mode 100644 index 0000000..fe9127a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_44.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_440.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_440.txt new file mode 100644 index 0000000..5647dfe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_440.txt @@ -0,0 +1 @@ +0 0.5288461538461539 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_441.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_441.txt new file mode 100644 index 0000000..69264eb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_441.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_442.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_442.txt new file mode 100644 index 0000000..9f796f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_442.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_443.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_443.txt new file mode 100644 index 0000000..cd1ed8c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_443.txt @@ -0,0 +1 @@ +0 0.6692307692307692 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_444.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_444.txt new file mode 100644 index 0000000..b92f51d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_444.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_445.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_445.txt new file mode 100644 index 0000000..a7122a0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_445.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.371875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_446.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_446.txt new file mode 100644 index 0000000..3056f8d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_446.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_447.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_447.txt new file mode 100644 index 0000000..c8fd7c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_447.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_448.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_448.txt new file mode 100644 index 0000000..42e7566 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_448.txt @@ -0,0 +1 @@ +0 0.5 0.340625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_449.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_449.txt new file mode 100644 index 0000000..d5f6e18 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_449.txt @@ -0,0 +1 @@ +0 0.6557692307692308 0.203125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_45.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_45.txt new file mode 100644 index 0000000..be27224 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_45.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_450.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_450.txt new file mode 100644 index 0000000..254b0fe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_450.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_451.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_451.txt new file mode 100644 index 0000000..3438ed1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_451.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_452.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_452.txt new file mode 100644 index 0000000..0f7caab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_452.txt @@ -0,0 +1 @@ +0 0.3423076923076923 0.578125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_453.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_453.txt new file mode 100644 index 0000000..64ce159 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_453.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_454.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_454.txt new file mode 100644 index 0000000..df14c97 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_454.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_455.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_455.txt new file mode 100644 index 0000000..20e81a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_455.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.63125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_456.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_456.txt new file mode 100644 index 0000000..c40cd35 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_456.txt @@ -0,0 +1 @@ +0 0.375 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_457.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_457.txt new file mode 100644 index 0000000..60d09f7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_457.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_458.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_458.txt new file mode 100644 index 0000000..33131a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_458.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.08125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_459.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_459.txt new file mode 100644 index 0000000..7c7b268 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_459.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_46.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_46.txt new file mode 100644 index 0000000..b135db0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_46.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_460.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_460.txt new file mode 100644 index 0000000..41a354f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_460.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_461.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_461.txt new file mode 100644 index 0000000..ff05970 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_461.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.65 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_462.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_462.txt new file mode 100644 index 0000000..f6f2bfa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_462.txt @@ -0,0 +1 @@ +0 0.5057692307692307 0.590625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_463.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_463.txt new file mode 100644 index 0000000..8b7f7ec --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_463.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.459375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_464.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_464.txt new file mode 100644 index 0000000..1dc6654 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_464.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_465.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_465.txt new file mode 100644 index 0000000..2b351fc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_465.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.165625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_466.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_466.txt new file mode 100644 index 0000000..3eee44a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_466.txt @@ -0,0 +1 @@ +0 0.573076923076923 0.421875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_467.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_467.txt new file mode 100644 index 0000000..30708d5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_467.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_468.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_468.txt new file mode 100644 index 0000000..f77b38c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_468.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.60625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_469.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_469.txt new file mode 100644 index 0000000..1867d9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_469.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_47.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_47.txt new file mode 100644 index 0000000..5fcdbce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_47.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_470.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_470.txt new file mode 100644 index 0000000..84c8011 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_470.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_471.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_471.txt new file mode 100644 index 0000000..2770aa5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_471.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_472.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_472.txt new file mode 100644 index 0000000..cb91346 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_472.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_473.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_473.txt new file mode 100644 index 0000000..7341d02 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_473.txt @@ -0,0 +1 @@ +0 0.625 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_474.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_474.txt new file mode 100644 index 0000000..78894a3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_474.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.33125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_475.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_475.txt new file mode 100644 index 0000000..961e3bd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_475.txt @@ -0,0 +1 @@ +0 0.3423076923076923 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_476.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_476.txt new file mode 100644 index 0000000..51cdb5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_476.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_477.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_477.txt new file mode 100644 index 0000000..a73edef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_477.txt @@ -0,0 +1 @@ +0 0.525 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_478.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_478.txt new file mode 100644 index 0000000..0bc673d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_478.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_479.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_479.txt new file mode 100644 index 0000000..7e9910a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_479.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.55625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_48.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_48.txt new file mode 100644 index 0000000..b1d93f2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_48.txt @@ -0,0 +1 @@ +0 0.45 0.409375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_480.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_480.txt new file mode 100644 index 0000000..1ece177 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_480.txt @@ -0,0 +1 @@ +0 0.47884615384615387 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_481.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_481.txt new file mode 100644 index 0000000..87e147f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_481.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_482.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_482.txt new file mode 100644 index 0000000..aee9ecf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_482.txt @@ -0,0 +1 @@ +0 0.6615384615384615 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_483.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_483.txt new file mode 100644 index 0000000..8d850af --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_483.txt @@ -0,0 +1 @@ +0 0.40384615384615385 0.43125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_484.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_484.txt new file mode 100644 index 0000000..55c0f3c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_484.txt @@ -0,0 +1 @@ +0 0.4 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_485.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_485.txt new file mode 100644 index 0000000..abdd3ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_485.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_486.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_486.txt new file mode 100644 index 0000000..093ac52 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_486.txt @@ -0,0 +1 @@ +0 0.4 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_487.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_487.txt new file mode 100644 index 0000000..b7286ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_487.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_488.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_488.txt new file mode 100644 index 0000000..6c03d22 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_488.txt @@ -0,0 +1 @@ +0 0.4346153846153846 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_489.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_489.txt new file mode 100644 index 0000000..d48661f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_489.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_49.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_49.txt new file mode 100644 index 0000000..7bf9900 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_49.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_490.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_490.txt new file mode 100644 index 0000000..1837efd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_490.txt @@ -0,0 +1 @@ +0 0.48846153846153845 0.675 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_491.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_491.txt new file mode 100644 index 0000000..e8cb6cb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_491.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.315625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_492.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_492.txt new file mode 100644 index 0000000..6190a04 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_492.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_493.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_493.txt new file mode 100644 index 0000000..7843909 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_493.txt @@ -0,0 +1 @@ +0 0.6826923076923077 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_494.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_494.txt new file mode 100644 index 0000000..fa1e00f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_494.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.421875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_495.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_495.txt new file mode 100644 index 0000000..8d6d7be --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_495.txt @@ -0,0 +1 @@ +0 0.3730769230769231 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_496.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_496.txt new file mode 100644 index 0000000..fd0eb1d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_496.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_497.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_497.txt new file mode 100644 index 0000000..df1813a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_497.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.3 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_498.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_498.txt new file mode 100644 index 0000000..0942858 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_498.txt @@ -0,0 +1 @@ +0 0.6442307692307693 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_499.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_499.txt new file mode 100644 index 0000000..161ae00 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_499.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_5.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_5.txt new file mode 100644 index 0000000..3a8ae19 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_5.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_50.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_50.txt new file mode 100644 index 0000000..9d82f33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_50.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.1 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_500.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_500.txt new file mode 100644 index 0000000..ecf503d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_500.txt @@ -0,0 +1 @@ +0 0.46923076923076923 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_501.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_501.txt new file mode 100644 index 0000000..8515f89 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_501.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_502.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_502.txt new file mode 100644 index 0000000..b4466ab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_502.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_503.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_503.txt new file mode 100644 index 0000000..90bd624 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_503.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.146875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_504.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_504.txt new file mode 100644 index 0000000..239b697 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_504.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_505.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_505.txt new file mode 100644 index 0000000..135e324 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_505.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.44375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_506.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_506.txt new file mode 100644 index 0000000..6cc4b69 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_506.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_507.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_507.txt new file mode 100644 index 0000000..77913c8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_507.txt @@ -0,0 +1 @@ +0 0.48653846153846153 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_508.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_508.txt new file mode 100644 index 0000000..ea9741d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_508.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_509.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_509.txt new file mode 100644 index 0000000..c1c46ab --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_509.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_51.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_51.txt new file mode 100644 index 0000000..bae483b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_51.txt @@ -0,0 +1 @@ +0 0.5288461538461539 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_510.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_510.txt new file mode 100644 index 0000000..f580129 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_510.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_511.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_511.txt new file mode 100644 index 0000000..226409f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_511.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_512.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_512.txt new file mode 100644 index 0000000..979a15e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_512.txt @@ -0,0 +1 @@ +0 0.6653846153846154 0.1375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_513.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_513.txt new file mode 100644 index 0000000..09c6c41 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_513.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_514.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_514.txt new file mode 100644 index 0000000..4e00b1b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_514.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_515.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_515.txt new file mode 100644 index 0000000..1347cf2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_515.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_516.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_516.txt new file mode 100644 index 0000000..0d45ab4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_516.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_517.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_517.txt new file mode 100644 index 0000000..6a16ad1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_517.txt @@ -0,0 +1 @@ +0 0.325 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_518.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_518.txt new file mode 100644 index 0000000..009b920 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_518.txt @@ -0,0 +1 @@ +0 0.41346153846153844 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_519.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_519.txt new file mode 100644 index 0000000..4cbcc33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_519.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_52.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_52.txt new file mode 100644 index 0000000..04c2ed3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_52.txt @@ -0,0 +1 @@ +0 0.4096153846153846 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_520.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_520.txt new file mode 100644 index 0000000..1a14550 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_520.txt @@ -0,0 +1 @@ +0 0.6865384615384615 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_521.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_521.txt new file mode 100644 index 0000000..1281d69 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_521.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_522.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_522.txt new file mode 100644 index 0000000..9feb54d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_522.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.14375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_523.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_523.txt new file mode 100644 index 0000000..fb21c9a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_523.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_524.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_524.txt new file mode 100644 index 0000000..9625840 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_524.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_525.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_525.txt new file mode 100644 index 0000000..4be5e1b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_525.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_526.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_526.txt new file mode 100644 index 0000000..8ca6701 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_526.txt @@ -0,0 +1 @@ +0 0.675 0.565625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_527.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_527.txt new file mode 100644 index 0000000..8b9953d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_527.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_528.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_528.txt new file mode 100644 index 0000000..b18bc56 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_528.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.546875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_529.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_529.txt new file mode 100644 index 0000000..37ca185 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_529.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_53.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_53.txt new file mode 100644 index 0000000..bf3b4b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_53.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.084375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_530.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_530.txt new file mode 100644 index 0000000..f498815 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_530.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_531.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_531.txt new file mode 100644 index 0000000..93b2b5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_531.txt @@ -0,0 +1 @@ +0 0.48846153846153845 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_532.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_532.txt new file mode 100644 index 0000000..fc2f1f4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_532.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_533.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_533.txt new file mode 100644 index 0000000..a99f9f0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_533.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.378125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_534.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_534.txt new file mode 100644 index 0000000..95eb91c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_534.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_535.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_535.txt new file mode 100644 index 0000000..e6d6911 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_535.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.303125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_536.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_536.txt new file mode 100644 index 0000000..ae5fff5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_536.txt @@ -0,0 +1 @@ +0 0.6692307692307692 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_537.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_537.txt new file mode 100644 index 0000000..e7efa9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_537.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.11875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_538.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_538.txt new file mode 100644 index 0000000..8f2edd0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_538.txt @@ -0,0 +1 @@ +0 0.551923076923077 0.646875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_539.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_539.txt new file mode 100644 index 0000000..97ee822 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_539.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_54.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_54.txt new file mode 100644 index 0000000..7c940dc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_54.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.446875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_540.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_540.txt new file mode 100644 index 0000000..c74b068 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_540.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_541.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_541.txt new file mode 100644 index 0000000..57cddcc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_541.txt @@ -0,0 +1 @@ +0 0.5461538461538461 0.553125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_542.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_542.txt new file mode 100644 index 0000000..3e30cd7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_542.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_543.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_543.txt new file mode 100644 index 0000000..6059bc1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_543.txt @@ -0,0 +1 @@ +0 0.5134615384615384 0.55 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_544.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_544.txt new file mode 100644 index 0000000..cc9d46b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_544.txt @@ -0,0 +1 @@ +0 0.375 0.084375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_545.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_545.txt new file mode 100644 index 0000000..f2641c2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_545.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_546.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_546.txt new file mode 100644 index 0000000..a5bd0d9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_546.txt @@ -0,0 +1 @@ +0 0.5019230769230769 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_547.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_547.txt new file mode 100644 index 0000000..1fd915a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_547.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_548.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_548.txt new file mode 100644 index 0000000..60d65b4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_548.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_549.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_549.txt new file mode 100644 index 0000000..9b17ba9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_549.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.240625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_55.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_55.txt new file mode 100644 index 0000000..b8159d6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_55.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.10625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_550.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_550.txt new file mode 100644 index 0000000..3a70233 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_550.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.384375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_551.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_551.txt new file mode 100644 index 0000000..c076861 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_551.txt @@ -0,0 +1 @@ +0 0.6673076923076923 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_552.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_552.txt new file mode 100644 index 0000000..702b490 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_552.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_553.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_553.txt new file mode 100644 index 0000000..87c6aec --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_553.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_554.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_554.txt new file mode 100644 index 0000000..4361932 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_554.txt @@ -0,0 +1 @@ +0 0.4230769230769231 0.63125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_555.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_555.txt new file mode 100644 index 0000000..b52465a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_555.txt @@ -0,0 +1 @@ +0 0.5538461538461539 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_556.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_556.txt new file mode 100644 index 0000000..e63fe04 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_556.txt @@ -0,0 +1 @@ +0 0.325 0.34375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_557.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_557.txt new file mode 100644 index 0000000..bdb2066 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_557.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_558.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_558.txt new file mode 100644 index 0000000..5722c59 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_558.txt @@ -0,0 +1 @@ +0 0.5365384615384615 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_559.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_559.txt new file mode 100644 index 0000000..7bc9e40 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_559.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_56.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_56.txt new file mode 100644 index 0000000..59e6b3b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_56.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_560.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_560.txt new file mode 100644 index 0000000..715aabe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_560.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.1125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_561.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_561.txt new file mode 100644 index 0000000..e196846 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_561.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_562.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_562.txt new file mode 100644 index 0000000..1bc81bb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_562.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_563.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_563.txt new file mode 100644 index 0000000..44bba2d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_563.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.228125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_564.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_564.txt new file mode 100644 index 0000000..87a7643 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_564.txt @@ -0,0 +1 @@ +0 0.5365384615384615 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_565.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_565.txt new file mode 100644 index 0000000..9fec86b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_565.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_566.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_566.txt new file mode 100644 index 0000000..2ae336b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_566.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_567.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_567.txt new file mode 100644 index 0000000..48f9cfa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_567.txt @@ -0,0 +1 @@ +0 0.6115384615384616 0.234375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_568.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_568.txt new file mode 100644 index 0000000..3b252ec --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_568.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_569.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_569.txt new file mode 100644 index 0000000..417a777 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_569.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_57.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_57.txt new file mode 100644 index 0000000..9daab33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_57.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.365625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_570.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_570.txt new file mode 100644 index 0000000..1651e6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_570.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_571.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_571.txt new file mode 100644 index 0000000..8806452 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_571.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_572.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_572.txt new file mode 100644 index 0000000..f0f2cc4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_572.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_573.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_573.txt new file mode 100644 index 0000000..194fa16 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_573.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_574.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_574.txt new file mode 100644 index 0000000..0d1627f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_574.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_575.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_575.txt new file mode 100644 index 0000000..1991135 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_575.txt @@ -0,0 +1 @@ +0 0.4076923076923077 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_576.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_576.txt new file mode 100644 index 0000000..ad609ac --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_576.txt @@ -0,0 +1 @@ +0 0.41923076923076924 0.071875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_577.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_577.txt new file mode 100644 index 0000000..8e2ea9c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_577.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_578.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_578.txt new file mode 100644 index 0000000..eb892d9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_578.txt @@ -0,0 +1 @@ +0 0.41923076923076924 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_579.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_579.txt new file mode 100644 index 0000000..bf9bec7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_579.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_58.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_58.txt new file mode 100644 index 0000000..5044287 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_58.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_580.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_580.txt new file mode 100644 index 0000000..01ca7e7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_580.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_581.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_581.txt new file mode 100644 index 0000000..f85437f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_581.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.378125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_582.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_582.txt new file mode 100644 index 0000000..f6a1836 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_582.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_583.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_583.txt new file mode 100644 index 0000000..52ed8ca --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_583.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_584.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_584.txt new file mode 100644 index 0000000..0546360 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_584.txt @@ -0,0 +1 @@ +0 0.6115384615384616 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_585.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_585.txt new file mode 100644 index 0000000..8fb557d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_585.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_586.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_586.txt new file mode 100644 index 0000000..5022d3a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_586.txt @@ -0,0 +1 @@ +0 0.4576923076923077 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_587.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_587.txt new file mode 100644 index 0000000..bc32b2a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_587.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_588.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_588.txt new file mode 100644 index 0000000..b31a3ee --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_588.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.384375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_589.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_589.txt new file mode 100644 index 0000000..5313457 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_589.txt @@ -0,0 +1 @@ +0 0.4288461538461538 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_59.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_59.txt new file mode 100644 index 0000000..25dc4df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_59.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_590.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_590.txt new file mode 100644 index 0000000..7a6fb82 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_590.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_591.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_591.txt new file mode 100644 index 0000000..72dd2ff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_591.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_592.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_592.txt new file mode 100644 index 0000000..494e283 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_592.txt @@ -0,0 +1 @@ +0 0.6807692307692308 0.071875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_593.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_593.txt new file mode 100644 index 0000000..23055f1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_593.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_594.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_594.txt new file mode 100644 index 0000000..db8d99f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_594.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_595.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_595.txt new file mode 100644 index 0000000..d6383f2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_595.txt @@ -0,0 +1 @@ +0 0.4653846153846154 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_596.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_596.txt new file mode 100644 index 0000000..9afbacc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_596.txt @@ -0,0 +1 @@ +0 0.5288461538461539 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_597.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_597.txt new file mode 100644 index 0000000..941f6f7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_597.txt @@ -0,0 +1 @@ +0 0.3423076923076923 0.553125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_598.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_598.txt new file mode 100644 index 0000000..9325358 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_598.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_599.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_599.txt new file mode 100644 index 0000000..fad5383 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_599.txt @@ -0,0 +1 @@ +0 0.5153846153846153 0.1125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_6.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_6.txt new file mode 100644 index 0000000..1bc9c5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_6.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_60.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_60.txt new file mode 100644 index 0000000..1ce4452 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_60.txt @@ -0,0 +1 @@ +0 0.35 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_600.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_600.txt new file mode 100644 index 0000000..f00f3eb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_600.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.1 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_601.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_601.txt new file mode 100644 index 0000000..1e7ceda --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_601.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_602.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_602.txt new file mode 100644 index 0000000..7277950 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_602.txt @@ -0,0 +1 @@ +0 0.425 0.65 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_603.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_603.txt new file mode 100644 index 0000000..e98bbb5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_603.txt @@ -0,0 +1 @@ +0 0.45384615384615384 0.34375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_604.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_604.txt new file mode 100644 index 0000000..37fbe35 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_604.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.146875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_605.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_605.txt new file mode 100644 index 0000000..1d22910 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_605.txt @@ -0,0 +1 @@ +0 0.5615384615384615 0.640625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_606.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_606.txt new file mode 100644 index 0000000..6af410c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_606.txt @@ -0,0 +1 @@ +0 0.6788461538461539 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_607.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_607.txt new file mode 100644 index 0000000..779cba3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_607.txt @@ -0,0 +1 @@ +0 0.6038461538461538 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_608.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_608.txt new file mode 100644 index 0000000..6f6ac6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_608.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_609.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_609.txt new file mode 100644 index 0000000..e0bc4e6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_609.txt @@ -0,0 +1 @@ +0 0.5538461538461539 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_61.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_61.txt new file mode 100644 index 0000000..a4ea8a7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_61.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_610.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_610.txt new file mode 100644 index 0000000..c513175 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_610.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_611.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_611.txt new file mode 100644 index 0000000..2959c58 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_611.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_612.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_612.txt new file mode 100644 index 0000000..182f227 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_612.txt @@ -0,0 +1 @@ +0 0.49038461538461536 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_613.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_613.txt new file mode 100644 index 0000000..d540b76 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_613.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_614.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_614.txt new file mode 100644 index 0000000..a70d39b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_614.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_615.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_615.txt new file mode 100644 index 0000000..53c1c15 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_615.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_616.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_616.txt new file mode 100644 index 0000000..5456c39 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_616.txt @@ -0,0 +1 @@ +0 0.5269230769230769 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_617.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_617.txt new file mode 100644 index 0000000..263feb9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_617.txt @@ -0,0 +1 @@ +0 0.5788461538461539 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_618.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_618.txt new file mode 100644 index 0000000..30d9d0c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_618.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.646875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_619.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_619.txt new file mode 100644 index 0000000..117a6db --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_619.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_62.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_62.txt new file mode 100644 index 0000000..beae879 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_62.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.11875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_620.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_620.txt new file mode 100644 index 0000000..769dfb3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_620.txt @@ -0,0 +1 @@ +0 0.36923076923076925 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_621.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_621.txt new file mode 100644 index 0000000..1fc0e75 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_621.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_622.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_622.txt new file mode 100644 index 0000000..8e992d4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_622.txt @@ -0,0 +1 @@ +0 0.575 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_623.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_623.txt new file mode 100644 index 0000000..b16cf00 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_623.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_624.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_624.txt new file mode 100644 index 0000000..71cd109 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_624.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_625.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_625.txt new file mode 100644 index 0000000..aa9a21c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_625.txt @@ -0,0 +1 @@ +0 0.5115384615384615 0.396875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_626.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_626.txt new file mode 100644 index 0000000..ca9365a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_626.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.371875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_627.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_627.txt new file mode 100644 index 0000000..6b8ef12 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_627.txt @@ -0,0 +1 @@ +0 0.6269230769230769 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_628.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_628.txt new file mode 100644 index 0000000..8412441 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_628.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_629.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_629.txt new file mode 100644 index 0000000..4469a47 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_629.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_63.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_63.txt new file mode 100644 index 0000000..644542e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_63.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_630.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_630.txt new file mode 100644 index 0000000..ae2804e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_630.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_631.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_631.txt new file mode 100644 index 0000000..a5d6e96 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_631.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_632.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_632.txt new file mode 100644 index 0000000..5f7f7c2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_632.txt @@ -0,0 +1 @@ +0 0.5980769230769231 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_633.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_633.txt new file mode 100644 index 0000000..09e8348 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_633.txt @@ -0,0 +1 @@ +0 0.5923076923076923 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_634.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_634.txt new file mode 100644 index 0000000..681116c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_634.txt @@ -0,0 +1 @@ +0 0.48846153846153845 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_635.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_635.txt new file mode 100644 index 0000000..eab5110 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_635.txt @@ -0,0 +1 @@ +0 0.5153846153846153 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_636.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_636.txt new file mode 100644 index 0000000..9af966a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_636.txt @@ -0,0 +1 @@ +0 0.6692307692307692 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_637.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_637.txt new file mode 100644 index 0000000..9e5da93 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_637.txt @@ -0,0 +1 @@ +0 0.6711538461538461 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_638.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_638.txt new file mode 100644 index 0000000..55fa9a2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_638.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_639.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_639.txt new file mode 100644 index 0000000..9dbdd55 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_639.txt @@ -0,0 +1 @@ +0 0.6538461538461539 0.178125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_64.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_64.txt new file mode 100644 index 0000000..2af9dae --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_64.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_640.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_640.txt new file mode 100644 index 0000000..b32aa7a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_640.txt @@ -0,0 +1 @@ +0 0.3769230769230769 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_641.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_641.txt new file mode 100644 index 0000000..aea91df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_641.txt @@ -0,0 +1 @@ +0 0.6692307692307692 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_642.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_642.txt new file mode 100644 index 0000000..35993d3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_642.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.1 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_643.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_643.txt new file mode 100644 index 0000000..3828a85 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_643.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_644.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_644.txt new file mode 100644 index 0000000..e983517 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_644.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.08125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_645.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_645.txt new file mode 100644 index 0000000..2a5f9a5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_645.txt @@ -0,0 +1 @@ +0 0.47884615384615387 0.209375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_646.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_646.txt new file mode 100644 index 0000000..8cefa9b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_646.txt @@ -0,0 +1 @@ +0 0.6865384615384615 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_647.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_647.txt new file mode 100644 index 0000000..77ca2ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_647.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.45 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_648.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_648.txt new file mode 100644 index 0000000..00aef56 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_648.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_649.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_649.txt new file mode 100644 index 0000000..ca38b72 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_649.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.090625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_65.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_65.txt new file mode 100644 index 0000000..751a9e9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_65.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.25 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_650.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_650.txt new file mode 100644 index 0000000..2936051 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_650.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_651.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_651.txt new file mode 100644 index 0000000..6a5dc26 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_651.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_652.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_652.txt new file mode 100644 index 0000000..4d18f33 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_652.txt @@ -0,0 +1 @@ +0 0.676923076923077 0.446875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_653.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_653.txt new file mode 100644 index 0000000..e3d499f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_653.txt @@ -0,0 +1 @@ +0 0.49038461538461536 0.4125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_654.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_654.txt new file mode 100644 index 0000000..d1b66b2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_654.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.409375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_655.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_655.txt new file mode 100644 index 0000000..8be6668 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_655.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_656.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_656.txt new file mode 100644 index 0000000..af7775d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_656.txt @@ -0,0 +1 @@ +0 0.6826923076923077 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_657.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_657.txt new file mode 100644 index 0000000..03a934f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_657.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_658.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_658.txt new file mode 100644 index 0000000..0dfc4bb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_658.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.109375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_659.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_659.txt new file mode 100644 index 0000000..fa3285d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_659.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_66.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_66.txt new file mode 100644 index 0000000..a049d58 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_66.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_660.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_660.txt new file mode 100644 index 0000000..c7a4551 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_660.txt @@ -0,0 +1 @@ +0 0.4288461538461538 0.665625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_661.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_661.txt new file mode 100644 index 0000000..75d5d77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_661.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_662.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_662.txt new file mode 100644 index 0000000..cc6da53 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_662.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.14375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_663.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_663.txt new file mode 100644 index 0000000..6860283 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_663.txt @@ -0,0 +1 @@ +0 0.6365384615384615 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_664.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_664.txt new file mode 100644 index 0000000..cf3e1f7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_664.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_665.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_665.txt new file mode 100644 index 0000000..87c433b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_665.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.08125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_666.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_666.txt new file mode 100644 index 0000000..c991a7c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_666.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_667.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_667.txt new file mode 100644 index 0000000..1e28f48 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_667.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_668.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_668.txt new file mode 100644 index 0000000..3b2fd34 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_668.txt @@ -0,0 +1 @@ +0 0.5653846153846154 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_669.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_669.txt new file mode 100644 index 0000000..e00f00e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_669.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_67.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_67.txt new file mode 100644 index 0000000..380aaa5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_67.txt @@ -0,0 +1 @@ +0 0.35 0.596875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_670.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_670.txt new file mode 100644 index 0000000..c2d412c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_670.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_671.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_671.txt new file mode 100644 index 0000000..0346b11 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_671.txt @@ -0,0 +1 @@ +0 0.5 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_672.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_672.txt new file mode 100644 index 0000000..acfa65e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_672.txt @@ -0,0 +1 @@ +0 0.6038461538461538 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_673.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_673.txt new file mode 100644 index 0000000..bc7ab5f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_673.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_674.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_674.txt new file mode 100644 index 0000000..d4e666b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_674.txt @@ -0,0 +1 @@ +0 0.5134615384615384 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_675.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_675.txt new file mode 100644 index 0000000..9ec5c69 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_675.txt @@ -0,0 +1 @@ +0 0.6519230769230769 0.15 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_676.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_676.txt new file mode 100644 index 0000000..9332c77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_676.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_677.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_677.txt new file mode 100644 index 0000000..c5c908b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_677.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_678.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_678.txt new file mode 100644 index 0000000..690a984 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_678.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_679.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_679.txt new file mode 100644 index 0000000..7ff63f0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_679.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_68.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_68.txt new file mode 100644 index 0000000..e49d5ee --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_68.txt @@ -0,0 +1 @@ +0 0.5115384615384615 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_680.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_680.txt new file mode 100644 index 0000000..050d22e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_680.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_681.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_681.txt new file mode 100644 index 0000000..64dc952 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_681.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_682.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_682.txt new file mode 100644 index 0000000..fa99e5e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_682.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.4375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_683.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_683.txt new file mode 100644 index 0000000..07ba98c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_683.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.33125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_684.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_684.txt new file mode 100644 index 0000000..b75f04d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_684.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.5375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_685.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_685.txt new file mode 100644 index 0000000..53dd16a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_685.txt @@ -0,0 +1 @@ +0 0.6576923076923077 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_686.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_686.txt new file mode 100644 index 0000000..dd3d623 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_686.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_687.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_687.txt new file mode 100644 index 0000000..93711d6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_687.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_688.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_688.txt new file mode 100644 index 0000000..5b9c6b5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_688.txt @@ -0,0 +1 @@ +0 0.6653846153846154 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_689.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_689.txt new file mode 100644 index 0000000..42f057a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_689.txt @@ -0,0 +1 @@ +0 0.35 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_69.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_69.txt new file mode 100644 index 0000000..b8dea74 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_69.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.4125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_690.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_690.txt new file mode 100644 index 0000000..1420fdc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_690.txt @@ -0,0 +1 @@ +0 0.6884615384615385 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_691.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_691.txt new file mode 100644 index 0000000..85cdb8d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_691.txt @@ -0,0 +1 @@ +0 0.3942307692307692 0.55625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_692.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_692.txt new file mode 100644 index 0000000..354e8c3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_692.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_693.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_693.txt new file mode 100644 index 0000000..90905cd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_693.txt @@ -0,0 +1 @@ +0 0.36923076923076925 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_694.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_694.txt new file mode 100644 index 0000000..4fd98ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_694.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_695.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_695.txt new file mode 100644 index 0000000..f799b68 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_695.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.1375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_696.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_696.txt new file mode 100644 index 0000000..7590d4d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_696.txt @@ -0,0 +1 @@ +0 0.47884615384615387 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_697.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_697.txt new file mode 100644 index 0000000..74e8554 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_697.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.40625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_698.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_698.txt new file mode 100644 index 0000000..62b35f9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_698.txt @@ -0,0 +1 @@ +0 0.425 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_699.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_699.txt new file mode 100644 index 0000000..dbf2e34 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_699.txt @@ -0,0 +1 @@ +0 0.5057692307692307 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_7.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_7.txt new file mode 100644 index 0000000..403b1ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_7.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.31875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_70.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_70.txt new file mode 100644 index 0000000..fb2ed00 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_70.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_700.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_700.txt new file mode 100644 index 0000000..d077071 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_700.txt @@ -0,0 +1 @@ +0 0.575 0.41875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_701.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_701.txt new file mode 100644 index 0000000..37ca185 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_701.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_702.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_702.txt new file mode 100644 index 0000000..e2d73c9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_702.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.228125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_703.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_703.txt new file mode 100644 index 0000000..8b1497b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_703.txt @@ -0,0 +1 @@ +0 0.6576923076923077 0.221875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_704.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_704.txt new file mode 100644 index 0000000..ed6a265 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_704.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.55625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_705.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_705.txt new file mode 100644 index 0000000..c172b52 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_705.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_706.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_706.txt new file mode 100644 index 0000000..8556242 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_706.txt @@ -0,0 +1 @@ +0 0.6884615384615385 0.0625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_707.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_707.txt new file mode 100644 index 0000000..eb39e9c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_707.txt @@ -0,0 +1 @@ +0 0.6538461538461539 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_708.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_708.txt new file mode 100644 index 0000000..34e2920 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_708.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_709.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_709.txt new file mode 100644 index 0000000..286debd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_709.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_71.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_71.txt new file mode 100644 index 0000000..be6e1ce --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_71.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_710.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_710.txt new file mode 100644 index 0000000..81439bc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_710.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.278125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_711.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_711.txt new file mode 100644 index 0000000..04c0ae9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_711.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_712.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_712.txt new file mode 100644 index 0000000..924a037 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_712.txt @@ -0,0 +1 @@ +0 0.6192307692307693 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_713.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_713.txt new file mode 100644 index 0000000..00c39d7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_713.txt @@ -0,0 +1 @@ +0 0.4230769230769231 0.60625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_714.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_714.txt new file mode 100644 index 0000000..cc16757 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_714.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_715.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_715.txt new file mode 100644 index 0000000..064bab6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_715.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.6 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_716.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_716.txt new file mode 100644 index 0000000..7ab2770 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_716.txt @@ -0,0 +1 @@ +0 0.6519230769230769 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_717.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_717.txt new file mode 100644 index 0000000..f7bb6de --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_717.txt @@ -0,0 +1 @@ +0 0.4826923076923077 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_718.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_718.txt new file mode 100644 index 0000000..c4b40ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_718.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.071875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_719.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_719.txt new file mode 100644 index 0000000..4d0122a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_719.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_72.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_72.txt new file mode 100644 index 0000000..8cbe82a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_72.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_720.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_720.txt new file mode 100644 index 0000000..8d54a42 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_720.txt @@ -0,0 +1 @@ +0 0.5884615384615385 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_721.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_721.txt new file mode 100644 index 0000000..526ef6e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_721.txt @@ -0,0 +1 @@ +0 0.4442307692307692 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_722.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_722.txt new file mode 100644 index 0000000..9196bb5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_722.txt @@ -0,0 +1 @@ +0 0.5634615384615385 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_723.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_723.txt new file mode 100644 index 0000000..fadf546 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_723.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_724.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_724.txt new file mode 100644 index 0000000..7f6ffbe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_724.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_725.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_725.txt new file mode 100644 index 0000000..86c2f4a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_725.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_726.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_726.txt new file mode 100644 index 0000000..f8f0b37 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_726.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.078125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_727.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_727.txt new file mode 100644 index 0000000..1721f4a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_727.txt @@ -0,0 +1 @@ +0 0.4307692307692308 0.515625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_728.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_728.txt new file mode 100644 index 0000000..560fdfe --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_728.txt @@ -0,0 +1 @@ +0 0.3269230769230769 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_729.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_729.txt new file mode 100644 index 0000000..d612fb2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_729.txt @@ -0,0 +1 @@ +0 0.375 0.096875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_73.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_73.txt new file mode 100644 index 0000000..946ca93 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_73.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_730.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_730.txt new file mode 100644 index 0000000..c836be8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_730.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.65625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_731.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_731.txt new file mode 100644 index 0000000..c386580 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_731.txt @@ -0,0 +1 @@ +0 0.575 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_732.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_732.txt new file mode 100644 index 0000000..5151bd4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_732.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_733.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_733.txt new file mode 100644 index 0000000..469abf0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_733.txt @@ -0,0 +1 @@ +0 0.5653846153846154 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_734.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_734.txt new file mode 100644 index 0000000..e914a92 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_734.txt @@ -0,0 +1 @@ +0 0.6442307692307693 0.11875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_735.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_735.txt new file mode 100644 index 0000000..770057e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_735.txt @@ -0,0 +1 @@ +0 0.5 0.19375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_736.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_736.txt new file mode 100644 index 0000000..b581e62 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_736.txt @@ -0,0 +1 @@ +0 0.6596153846153846 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_737.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_737.txt new file mode 100644 index 0000000..86baa6f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_737.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.190625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_738.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_738.txt new file mode 100644 index 0000000..33eef5b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_738.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.39375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_739.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_739.txt new file mode 100644 index 0000000..4ab4aff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_739.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_74.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_74.txt new file mode 100644 index 0000000..68708f0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_74.txt @@ -0,0 +1 @@ +0 0.6403846153846153 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_740.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_740.txt new file mode 100644 index 0000000..abdd3ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_740.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.653125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_741.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_741.txt new file mode 100644 index 0000000..3a0258d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_741.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.478125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_742.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_742.txt new file mode 100644 index 0000000..8b3caaa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_742.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_743.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_743.txt new file mode 100644 index 0000000..f8946a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_743.txt @@ -0,0 +1 @@ +0 0.5 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_744.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_744.txt new file mode 100644 index 0000000..65a47a0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_744.txt @@ -0,0 +1 @@ +0 0.45 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_745.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_745.txt new file mode 100644 index 0000000..6c11ca8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_745.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_746.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_746.txt new file mode 100644 index 0000000..af09141 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_746.txt @@ -0,0 +1 @@ +0 0.3769230769230769 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_747.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_747.txt new file mode 100644 index 0000000..2e0c7a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_747.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.64375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_748.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_748.txt new file mode 100644 index 0000000..388d2e2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_748.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_749.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_749.txt new file mode 100644 index 0000000..0b5aca9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_749.txt @@ -0,0 +1 @@ +0 0.6384615384615384 0.25 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_75.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_75.txt new file mode 100644 index 0000000..84b9a22 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_75.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.1125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_750.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_750.txt new file mode 100644 index 0000000..b6aa83c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_750.txt @@ -0,0 +1 @@ +0 0.525 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_751.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_751.txt new file mode 100644 index 0000000..2f5d45e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_751.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_752.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_752.txt new file mode 100644 index 0000000..13bd218 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_752.txt @@ -0,0 +1 @@ +0 0.33653846153846156 0.540625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_753.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_753.txt new file mode 100644 index 0000000..cafc3d3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_753.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_754.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_754.txt new file mode 100644 index 0000000..7d56260 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_754.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_755.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_755.txt new file mode 100644 index 0000000..0246ef8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_755.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.41875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_756.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_756.txt new file mode 100644 index 0000000..f30ae71 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_756.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_757.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_757.txt new file mode 100644 index 0000000..1c535c9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_757.txt @@ -0,0 +1 @@ +0 0.4423076923076923 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_758.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_758.txt new file mode 100644 index 0000000..250ddd0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_758.txt @@ -0,0 +1 @@ +0 0.5980769230769231 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_759.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_759.txt new file mode 100644 index 0000000..ea1db6a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_759.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.265625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_76.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_76.txt new file mode 100644 index 0000000..d47d26e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_76.txt @@ -0,0 +1 @@ +0 0.3923076923076923 0.15625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_760.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_760.txt new file mode 100644 index 0000000..7f35054 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_760.txt @@ -0,0 +1 @@ +0 0.6 0.140625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_761.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_761.txt new file mode 100644 index 0000000..5014e26 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_761.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.3 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_762.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_762.txt new file mode 100644 index 0000000..dab120a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_762.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_763.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_763.txt new file mode 100644 index 0000000..f80aab1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_763.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.184375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_764.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_764.txt new file mode 100644 index 0000000..d98d49b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_764.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.684375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_765.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_765.txt new file mode 100644 index 0000000..cb9e7a7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_765.txt @@ -0,0 +1 @@ +0 0.3076923076923077 0.58125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_766.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_766.txt new file mode 100644 index 0000000..ee87e75 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_766.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_767.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_767.txt new file mode 100644 index 0000000..3809a7f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_767.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_768.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_768.txt new file mode 100644 index 0000000..c236265 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_768.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_769.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_769.txt new file mode 100644 index 0000000..422c571 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_769.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.6625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_77.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_77.txt new file mode 100644 index 0000000..657791b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_77.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_770.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_770.txt new file mode 100644 index 0000000..43e1f7a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_770.txt @@ -0,0 +1 @@ +0 0.36538461538461536 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_771.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_771.txt new file mode 100644 index 0000000..b9f8996 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_771.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_772.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_772.txt new file mode 100644 index 0000000..df20c94 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_772.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.659375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_773.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_773.txt new file mode 100644 index 0000000..03d1630 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_773.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.2125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_774.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_774.txt new file mode 100644 index 0000000..0d4dcc1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_774.txt @@ -0,0 +1 @@ +0 0.36730769230769234 0.6375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_775.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_775.txt new file mode 100644 index 0000000..c3c8fd3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_775.txt @@ -0,0 +1 @@ +0 0.38846153846153847 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_776.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_776.txt new file mode 100644 index 0000000..368cac0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_776.txt @@ -0,0 +1 @@ +0 0.4269230769230769 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_777.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_777.txt new file mode 100644 index 0000000..2fcc412 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_777.txt @@ -0,0 +1 @@ +0 0.3903846153846154 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_778.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_778.txt new file mode 100644 index 0000000..56397ff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_778.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_779.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_779.txt new file mode 100644 index 0000000..61b80a2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_779.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.43125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_78.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_78.txt new file mode 100644 index 0000000..99284ae --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_78.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.20625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_780.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_780.txt new file mode 100644 index 0000000..86c2748 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_780.txt @@ -0,0 +1 @@ +0 0.3230769230769231 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_781.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_781.txt new file mode 100644 index 0000000..4044a1e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_781.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_782.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_782.txt new file mode 100644 index 0000000..a932ca1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_782.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_783.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_783.txt new file mode 100644 index 0000000..b47f917 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_783.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.621875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_784.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_784.txt new file mode 100644 index 0000000..4a8976b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_784.txt @@ -0,0 +1 @@ +0 0.5403846153846154 0.3125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_785.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_785.txt new file mode 100644 index 0000000..93148fc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_785.txt @@ -0,0 +1 @@ +0 0.65 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_786.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_786.txt new file mode 100644 index 0000000..3502ea0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_786.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_787.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_787.txt new file mode 100644 index 0000000..fd7c418 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_787.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_788.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_788.txt new file mode 100644 index 0000000..9b18d23 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_788.txt @@ -0,0 +1 @@ +0 0.5269230769230769 0.384375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_789.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_789.txt new file mode 100644 index 0000000..053cb0a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_789.txt @@ -0,0 +1 @@ +0 0.5961538461538461 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_79.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_79.txt new file mode 100644 index 0000000..6348780 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_79.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_790.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_790.txt new file mode 100644 index 0000000..4cf9122 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_790.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.171875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_791.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_791.txt new file mode 100644 index 0000000..20cacd9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_791.txt @@ -0,0 +1 @@ +0 0.5 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_792.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_792.txt new file mode 100644 index 0000000..3ea952f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_792.txt @@ -0,0 +1 @@ +0 0.425 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_793.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_793.txt new file mode 100644 index 0000000..b5a1671 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_793.txt @@ -0,0 +1 @@ +0 0.4403846153846154 0.315625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_794.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_794.txt new file mode 100644 index 0000000..8c3e2ff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_794.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.109375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_795.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_795.txt new file mode 100644 index 0000000..d03f43e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_795.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_796.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_796.txt new file mode 100644 index 0000000..7b76a32 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_796.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.6 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_797.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_797.txt new file mode 100644 index 0000000..9035b73 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_797.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_798.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_798.txt new file mode 100644 index 0000000..1619297 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_798.txt @@ -0,0 +1 @@ +0 0.40192307692307694 0.25 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_799.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_799.txt new file mode 100644 index 0000000..6f337d3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_799.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_8.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_8.txt new file mode 100644 index 0000000..500dc77 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_8.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.290625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_80.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_80.txt new file mode 100644 index 0000000..0b2922a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_80.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.634375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_800.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_800.txt new file mode 100644 index 0000000..cea322f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_800.txt @@ -0,0 +1 @@ +0 0.31153846153846154 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_801.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_801.txt new file mode 100644 index 0000000..0246ef8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_801.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.41875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_802.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_802.txt new file mode 100644 index 0000000..1459da5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_802.txt @@ -0,0 +1 @@ +0 0.5038461538461538 0.309375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_803.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_803.txt new file mode 100644 index 0000000..5b1deb1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_803.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_804.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_804.txt new file mode 100644 index 0000000..97d51d6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_804.txt @@ -0,0 +1 @@ +0 0.36153846153846153 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_805.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_805.txt new file mode 100644 index 0000000..3a87724 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_805.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.4625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_806.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_806.txt new file mode 100644 index 0000000..799de13 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_806.txt @@ -0,0 +1 @@ +0 0.35192307692307695 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_807.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_807.txt new file mode 100644 index 0000000..d49e705 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_807.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_808.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_808.txt new file mode 100644 index 0000000..76fac5d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_808.txt @@ -0,0 +1 @@ +0 0.3211538461538462 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_809.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_809.txt new file mode 100644 index 0000000..fa1255a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_809.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.103125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_81.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_81.txt new file mode 100644 index 0000000..b8da217 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_81.txt @@ -0,0 +1 @@ +0 0.6211538461538462 0.553125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_810.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_810.txt new file mode 100644 index 0000000..ccf6ee9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_810.txt @@ -0,0 +1 @@ +0 0.46153846153846156 0.328125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_811.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_811.txt new file mode 100644 index 0000000..d6bc6a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_811.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_812.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_812.txt new file mode 100644 index 0000000..88e37df --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_812.txt @@ -0,0 +1 @@ +0 0.3596153846153846 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_813.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_813.txt new file mode 100644 index 0000000..990de50 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_813.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.28125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_814.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_814.txt new file mode 100644 index 0000000..0492f2c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_814.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.30625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_815.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_815.txt new file mode 100644 index 0000000..21c0b8b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_815.txt @@ -0,0 +1 @@ +0 0.33076923076923076 0.571875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_816.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_816.txt new file mode 100644 index 0000000..648e148 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_816.txt @@ -0,0 +1 @@ +0 0.5326923076923077 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_817.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_817.txt new file mode 100644 index 0000000..4398fe1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_817.txt @@ -0,0 +1 @@ +0 0.65 0.409375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_818.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_818.txt new file mode 100644 index 0000000..fef25bc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_818.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_819.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_819.txt new file mode 100644 index 0000000..cf87658 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_819.txt @@ -0,0 +1 @@ +0 0.45384615384615384 0.509375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_82.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_82.txt new file mode 100644 index 0000000..b4a3d92 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_82.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_820.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_820.txt new file mode 100644 index 0000000..ab0988f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_820.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.453125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_821.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_821.txt new file mode 100644 index 0000000..25a5167 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_821.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.153125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_822.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_822.txt new file mode 100644 index 0000000..f4c7869 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_822.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_823.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_823.txt new file mode 100644 index 0000000..2236925 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_823.txt @@ -0,0 +1 @@ +0 0.575 0.2875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_824.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_824.txt new file mode 100644 index 0000000..57370bf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_824.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_825.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_825.txt new file mode 100644 index 0000000..9f8e9af --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_825.txt @@ -0,0 +1 @@ +0 0.6846153846153846 0.3375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_826.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_826.txt new file mode 100644 index 0000000..22ba662 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_826.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_827.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_827.txt new file mode 100644 index 0000000..053f612 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_827.txt @@ -0,0 +1 @@ +0 0.35 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_828.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_828.txt new file mode 100644 index 0000000..f9c67f8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_828.txt @@ -0,0 +1 @@ +0 0.43653846153846154 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_829.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_829.txt new file mode 100644 index 0000000..87e6bd2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_829.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_83.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_83.txt new file mode 100644 index 0000000..4a7a367 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_83.txt @@ -0,0 +1 @@ +0 0.5192307692307693 0.38125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_830.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_830.txt new file mode 100644 index 0000000..00c7e3b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_830.txt @@ -0,0 +1 @@ +0 0.6480769230769231 0.203125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_831.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_831.txt new file mode 100644 index 0000000..4d49b97 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_831.txt @@ -0,0 +1 @@ +0 0.4461538461538462 0.6125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_832.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_832.txt new file mode 100644 index 0000000..c46e4f6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_832.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_833.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_833.txt new file mode 100644 index 0000000..252635b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_833.txt @@ -0,0 +1 @@ +0 0.6634615384615384 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_834.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_834.txt new file mode 100644 index 0000000..7a54855 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_834.txt @@ -0,0 +1 @@ +0 0.573076923076923 0.63125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_835.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_835.txt new file mode 100644 index 0000000..f48109b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_835.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.675 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_836.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_836.txt new file mode 100644 index 0000000..eba80a5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_836.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.246875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_837.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_837.txt new file mode 100644 index 0000000..2c3c638 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_837.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_838.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_838.txt new file mode 100644 index 0000000..4ce380e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_838.txt @@ -0,0 +1 @@ +0 0.3403846153846154 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_839.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_839.txt new file mode 100644 index 0000000..a2fbe1c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_839.txt @@ -0,0 +1 @@ +0 0.5769230769230769 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_84.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_84.txt new file mode 100644 index 0000000..182d059 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_84.txt @@ -0,0 +1 @@ +0 0.4461538461538462 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_840.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_840.txt new file mode 100644 index 0000000..23f5fbc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_840.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_841.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_841.txt new file mode 100644 index 0000000..26df00f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_841.txt @@ -0,0 +1 @@ +0 0.35384615384615387 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_842.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_842.txt new file mode 100644 index 0000000..66529c4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_842.txt @@ -0,0 +1 @@ +0 0.6903846153846154 0.296875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_843.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_843.txt new file mode 100644 index 0000000..b7fb5c5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_843.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_844.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_844.txt new file mode 100644 index 0000000..8a49f4d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_844.txt @@ -0,0 +1 @@ +0 0.3173076923076923 0.36875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_845.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_845.txt new file mode 100644 index 0000000..3001658 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_845.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.128125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_846.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_846.txt new file mode 100644 index 0000000..9da2efd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_846.txt @@ -0,0 +1 @@ +0 0.5557692307692308 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_847.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_847.txt new file mode 100644 index 0000000..0dc930b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_847.txt @@ -0,0 +1 @@ +0 0.40576923076923077 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_848.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_848.txt new file mode 100644 index 0000000..9f2acb3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_848.txt @@ -0,0 +1 @@ +0 0.6865384615384615 0.503125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_849.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_849.txt new file mode 100644 index 0000000..8d0a686 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_849.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_85.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_85.txt new file mode 100644 index 0000000..e469e68 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_85.txt @@ -0,0 +1 @@ +0 0.4 0.2875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_850.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_850.txt new file mode 100644 index 0000000..c1674e6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_850.txt @@ -0,0 +1 @@ +0 0.3384615384615385 0.13125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_851.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_851.txt new file mode 100644 index 0000000..03bacef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_851.txt @@ -0,0 +1 @@ +0 0.6615384615384615 0.675 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_852.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_852.txt new file mode 100644 index 0000000..532b7ed --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_852.txt @@ -0,0 +1 @@ +0 0.6269230769230769 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_853.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_853.txt new file mode 100644 index 0000000..655c38d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_853.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_854.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_854.txt new file mode 100644 index 0000000..ca57efc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_854.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.50625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_855.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_855.txt new file mode 100644 index 0000000..0ebe589 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_855.txt @@ -0,0 +1 @@ +0 0.3576923076923077 0.56875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_856.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_856.txt new file mode 100644 index 0000000..b310ce8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_856.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_857.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_857.txt new file mode 100644 index 0000000..31ce9a8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_857.txt @@ -0,0 +1 @@ +0 0.5538461538461539 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_858.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_858.txt new file mode 100644 index 0000000..b2a796d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_858.txt @@ -0,0 +1 @@ +0 0.34615384615384615 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_859.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_859.txt new file mode 100644 index 0000000..73dc958 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_859.txt @@ -0,0 +1 @@ +0 0.6307692307692307 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_86.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_86.txt new file mode 100644 index 0000000..b62a51a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_86.txt @@ -0,0 +1 @@ +0 0.4326923076923077 0.66875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_860.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_860.txt new file mode 100644 index 0000000..3f05bb1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_860.txt @@ -0,0 +1 @@ +0 0.5942307692307692 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_861.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_861.txt new file mode 100644 index 0000000..b11cfb7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_861.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.55 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_862.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_862.txt new file mode 100644 index 0000000..d6cb984 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_862.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_863.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_863.txt new file mode 100644 index 0000000..6c1805c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_863.txt @@ -0,0 +1 @@ +0 0.5057692307692307 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_864.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_864.txt new file mode 100644 index 0000000..79c88b4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_864.txt @@ -0,0 +1 @@ +0 0.5826923076923077 0.1 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_865.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_865.txt new file mode 100644 index 0000000..af6d5d6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_865.txt @@ -0,0 +1 @@ +0 0.4634615384615385 0.671875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_866.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_866.txt new file mode 100644 index 0000000..8c64abf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_866.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.29375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_867.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_867.txt new file mode 100644 index 0000000..ebda7b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_867.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.090625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_868.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_868.txt new file mode 100644 index 0000000..b3c0102 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_868.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.196875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_869.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_869.txt new file mode 100644 index 0000000..1db1c89 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_869.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.18125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_87.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_87.txt new file mode 100644 index 0000000..00e2b1f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_87.txt @@ -0,0 +1 @@ +0 0.4307692307692308 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_870.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_870.txt new file mode 100644 index 0000000..d431e9a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_870.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_871.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_871.txt new file mode 100644 index 0000000..7fadbdd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_871.txt @@ -0,0 +1 @@ +0 0.6076923076923076 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_872.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_872.txt new file mode 100644 index 0000000..621c704 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_872.txt @@ -0,0 +1 @@ +0 0.5807692307692308 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_873.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_873.txt new file mode 100644 index 0000000..0b8928c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_873.txt @@ -0,0 +1 @@ +0 0.6730769230769231 0.48125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_874.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_874.txt new file mode 100644 index 0000000..6012cf3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_874.txt @@ -0,0 +1 @@ +0 0.5673076923076923 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_875.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_875.txt new file mode 100644 index 0000000..b799c4e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_875.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_876.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_876.txt new file mode 100644 index 0000000..e939c1e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_876.txt @@ -0,0 +1 @@ +0 0.5596153846153846 0.134375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_877.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_877.txt new file mode 100644 index 0000000..54a92db --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_877.txt @@ -0,0 +1 @@ +0 0.5423076923076923 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_878.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_878.txt new file mode 100644 index 0000000..25c0ea4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_878.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.5125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_879.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_879.txt new file mode 100644 index 0000000..d129ed8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_879.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_88.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_88.txt new file mode 100644 index 0000000..88ebfac --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_88.txt @@ -0,0 +1 @@ +0 0.34807692307692306 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_880.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_880.txt new file mode 100644 index 0000000..bbb3034 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_880.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_881.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_881.txt new file mode 100644 index 0000000..b41cf7a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_881.txt @@ -0,0 +1 @@ +0 0.4 0.678125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_882.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_882.txt new file mode 100644 index 0000000..9f6dddf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_882.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.6875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_883.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_883.txt new file mode 100644 index 0000000..3fabb09 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_883.txt @@ -0,0 +1 @@ +0 0.5019230769230769 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_884.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_884.txt new file mode 100644 index 0000000..788869d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_884.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.5 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_885.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_885.txt new file mode 100644 index 0000000..d11bc6d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_885.txt @@ -0,0 +1 @@ +0 0.4461538461538462 0.265625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_886.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_886.txt new file mode 100644 index 0000000..c7d8886 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_886.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_887.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_887.txt new file mode 100644 index 0000000..e956178 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_887.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.284375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_888.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_888.txt new file mode 100644 index 0000000..26a8a6d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_888.txt @@ -0,0 +1 @@ +0 0.5807692307692308 0.428125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_889.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_889.txt new file mode 100644 index 0000000..7a9a449 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_889.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_89.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_89.txt new file mode 100644 index 0000000..edb1725 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_89.txt @@ -0,0 +1 @@ +0 0.48653846153846153 0.28125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_890.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_890.txt new file mode 100644 index 0000000..6133eb8 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_890.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.109375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_891.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_891.txt new file mode 100644 index 0000000..89694af --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_891.txt @@ -0,0 +1 @@ +0 0.65 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_892.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_892.txt new file mode 100644 index 0000000..23dad62 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_892.txt @@ -0,0 +1 @@ +0 0.5211538461538462 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_893.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_893.txt new file mode 100644 index 0000000..7ed814b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_893.txt @@ -0,0 +1 @@ +0 0.6596153846153846 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_894.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_894.txt new file mode 100644 index 0000000..733dd93 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_894.txt @@ -0,0 +1 @@ +0 0.6384615384615384 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_895.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_895.txt new file mode 100644 index 0000000..388155f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_895.txt @@ -0,0 +1 @@ +0 0.3557692307692308 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_896.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_896.txt new file mode 100644 index 0000000..2632d3b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_896.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.4375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_897.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_897.txt new file mode 100644 index 0000000..f065af9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_897.txt @@ -0,0 +1 @@ +0 0.3596153846153846 0.51875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_898.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_898.txt new file mode 100644 index 0000000..e24b894 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_898.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.346875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_899.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_899.txt new file mode 100644 index 0000000..7d5f97c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_899.txt @@ -0,0 +1 @@ +0 0.5980769230769231 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_9.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_9.txt new file mode 100644 index 0000000..0227e94 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_9.txt @@ -0,0 +1 @@ +0 0.4980769230769231 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_90.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_90.txt new file mode 100644 index 0000000..8428034 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_90.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.4375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_900.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_900.txt new file mode 100644 index 0000000..d3fe802 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_900.txt @@ -0,0 +1 @@ +0 0.325 0.425 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_901.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_901.txt new file mode 100644 index 0000000..8755512 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_901.txt @@ -0,0 +1 @@ +0 0.3211538461538462 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_902.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_902.txt new file mode 100644 index 0000000..375cb97 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_902.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_903.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_903.txt new file mode 100644 index 0000000..adf3beb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_903.txt @@ -0,0 +1 @@ +0 0.3326923076923077 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_904.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_904.txt new file mode 100644 index 0000000..e3521eb --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_904.txt @@ -0,0 +1 @@ +0 0.6557692307692308 0.1625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_905.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_905.txt new file mode 100644 index 0000000..fde0ee3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_905.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_906.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_906.txt new file mode 100644 index 0000000..e42640b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_906.txt @@ -0,0 +1 @@ +0 0.6596153846153846 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_907.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_907.txt new file mode 100644 index 0000000..62b5c4c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_907.txt @@ -0,0 +1 @@ +0 0.45576923076923076 0.3875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_908.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_908.txt new file mode 100644 index 0000000..d5e76ae --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_908.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.68125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_909.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_909.txt new file mode 100644 index 0000000..41d37ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_909.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_91.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_91.txt new file mode 100644 index 0000000..7f3c8aa --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_91.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_910.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_910.txt new file mode 100644 index 0000000..80d17ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_910.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_911.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_911.txt new file mode 100644 index 0000000..536f488 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_911.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_912.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_912.txt new file mode 100644 index 0000000..63836e5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_912.txt @@ -0,0 +1 @@ +0 0.5288461538461539 0.321875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_913.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_913.txt new file mode 100644 index 0000000..3140f2e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_913.txt @@ -0,0 +1 @@ +0 0.6173076923076923 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_914.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_914.txt new file mode 100644 index 0000000..87629a3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_914.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.421875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_915.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_915.txt new file mode 100644 index 0000000..49829a6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_915.txt @@ -0,0 +1 @@ +0 0.5307692307692308 0.109375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_916.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_916.txt new file mode 100644 index 0000000..b4bda47 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_916.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.46875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_917.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_917.txt new file mode 100644 index 0000000..0b4a5b4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_917.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.403125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_918.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_918.txt new file mode 100644 index 0000000..83e0a93 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_918.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.353125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_919.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_919.txt new file mode 100644 index 0000000..acd3c1e --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_919.txt @@ -0,0 +1 @@ +0 0.35192307692307695 0.590625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_92.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_92.txt new file mode 100644 index 0000000..154c688 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_92.txt @@ -0,0 +1 @@ +0 0.39807692307692305 0.465625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_920.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_920.txt new file mode 100644 index 0000000..cbdafcd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_920.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.5625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_921.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_921.txt new file mode 100644 index 0000000..7107c5f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_921.txt @@ -0,0 +1 @@ +0 0.4480769230769231 0.609375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_922.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_922.txt new file mode 100644 index 0000000..52a0aff --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_922.txt @@ -0,0 +1 @@ +0 0.5230769230769231 0.4 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_923.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_923.txt new file mode 100644 index 0000000..033e420 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_923.txt @@ -0,0 +1 @@ +0 0.38269230769230766 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_924.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_924.txt new file mode 100644 index 0000000..99ee2f9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_924.txt @@ -0,0 +1 @@ +0 0.41346153846153844 0.584375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_925.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_925.txt new file mode 100644 index 0000000..2f4bea6 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_925.txt @@ -0,0 +1 @@ +0 0.5788461538461539 0.115625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_926.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_926.txt new file mode 100644 index 0000000..38e9525 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_926.txt @@ -0,0 +1 @@ +0 0.37115384615384617 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_927.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_927.txt new file mode 100644 index 0000000..531b6fd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_927.txt @@ -0,0 +1 @@ +0 0.5442307692307692 0.253125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_928.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_928.txt new file mode 100644 index 0000000..56ce869 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_928.txt @@ -0,0 +1 @@ +0 0.475 0.315625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_929.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_929.txt new file mode 100644 index 0000000..d66a768 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_929.txt @@ -0,0 +1 @@ +0 0.5846153846153846 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_93.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_93.txt new file mode 100644 index 0000000..b877faf --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_93.txt @@ -0,0 +1 @@ +0 0.5384615384615384 0.35 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_930.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_930.txt new file mode 100644 index 0000000..d068ef2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_930.txt @@ -0,0 +1 @@ +0 0.6288461538461538 0.325 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_931.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_931.txt new file mode 100644 index 0000000..607ab10 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_931.txt @@ -0,0 +1 @@ +0 0.6576923076923077 0.2375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_932.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_932.txt new file mode 100644 index 0000000..ff21521 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_932.txt @@ -0,0 +1 @@ +0 0.5903846153846154 0.275 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_933.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_933.txt new file mode 100644 index 0000000..b107b38 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_933.txt @@ -0,0 +1 @@ +0 0.6 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_934.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_934.txt new file mode 100644 index 0000000..7729c73 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_934.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.090625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_935.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_935.txt new file mode 100644 index 0000000..875d61c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_935.txt @@ -0,0 +1 @@ +0 0.37884615384615383 0.534375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_936.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_936.txt new file mode 100644 index 0000000..a3b2810 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_936.txt @@ -0,0 +1 @@ +0 0.6153846153846154 0.68125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_937.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_937.txt new file mode 100644 index 0000000..00ec6d0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_937.txt @@ -0,0 +1 @@ +0 0.47307692307692306 0.61875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_938.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_938.txt new file mode 100644 index 0000000..c401031 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_938.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.075 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_939.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_939.txt new file mode 100644 index 0000000..a377249 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_939.txt @@ -0,0 +1 @@ +0 0.4153846153846154 0.240625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_94.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_94.txt new file mode 100644 index 0000000..1106651 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_94.txt @@ -0,0 +1 @@ +0 0.5230769230769231 0.209375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_940.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_940.txt new file mode 100644 index 0000000..0c8f6c1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_940.txt @@ -0,0 +1 @@ +0 0.675 0.209375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_941.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_941.txt new file mode 100644 index 0000000..a32f1a2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_941.txt @@ -0,0 +1 @@ +0 0.5557692307692308 0.1875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_942.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_942.txt new file mode 100644 index 0000000..1146691 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_942.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.334375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_943.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_943.txt new file mode 100644 index 0000000..8f6b61b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_943.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_944.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_944.txt new file mode 100644 index 0000000..1cbf797 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_944.txt @@ -0,0 +1 @@ +0 0.4173076923076923 0.16875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_945.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_945.txt new file mode 100644 index 0000000..e2fe276 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_945.txt @@ -0,0 +1 @@ +0 0.5692307692307692 0.625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_946.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_946.txt new file mode 100644 index 0000000..f547cb7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_946.txt @@ -0,0 +1 @@ +0 0.5480769230769231 0.49375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_947.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_947.txt new file mode 100644 index 0000000..c7d8886 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_947.txt @@ -0,0 +1 @@ +0 0.49423076923076925 0.2625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_948.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_948.txt new file mode 100644 index 0000000..4bb71a4 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_948.txt @@ -0,0 +1 @@ +0 0.5019230769230769 0.603125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_949.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_949.txt new file mode 100644 index 0000000..7d98220 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_949.txt @@ -0,0 +1 @@ +0 0.6653846153846154 0.23125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_95.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_95.txt new file mode 100644 index 0000000..ec3b8e9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_95.txt @@ -0,0 +1 @@ +0 0.39615384615384613 0.121875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_950.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_950.txt new file mode 100644 index 0000000..6ce886d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_950.txt @@ -0,0 +1 @@ +0 0.43846153846153846 0.378125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_951.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_951.txt new file mode 100644 index 0000000..07d8620 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_951.txt @@ -0,0 +1 @@ +0 0.3346153846153846 0.4875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_952.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_952.txt new file mode 100644 index 0000000..3a1fb0b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_952.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.621875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_953.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_953.txt new file mode 100644 index 0000000..3677870 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_953.txt @@ -0,0 +1 @@ +0 0.6423076923076924 0.175 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_954.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_954.txt new file mode 100644 index 0000000..b16f0a9 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_954.txt @@ -0,0 +1 @@ +0 0.551923076923077 0.06875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_955.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_955.txt new file mode 100644 index 0000000..d4bf5f3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_955.txt @@ -0,0 +1 @@ +0 0.5057692307692307 0.440625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_956.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_956.txt new file mode 100644 index 0000000..c4648f0 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_956.txt @@ -0,0 +1 @@ +0 0.47692307692307695 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_957.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_957.txt new file mode 100644 index 0000000..e101403 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_957.txt @@ -0,0 +1 @@ +0 0.3192307692307692 0.09375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_958.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_958.txt new file mode 100644 index 0000000..fe76793 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_958.txt @@ -0,0 +1 @@ +0 0.575 0.54375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_959.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_959.txt new file mode 100644 index 0000000..2fbb838 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_959.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.59375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_96.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_96.txt new file mode 100644 index 0000000..cda155c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_96.txt @@ -0,0 +1 @@ +0 0.34423076923076923 0.25625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_960.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_960.txt new file mode 100644 index 0000000..b3e95e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_960.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_961.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_961.txt new file mode 100644 index 0000000..425641f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_961.txt @@ -0,0 +1 @@ +0 0.47115384615384615 0.090625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_962.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_962.txt new file mode 100644 index 0000000..afd1e99 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_962.txt @@ -0,0 +1 @@ +0 0.4519230769230769 0.640625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_963.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_963.txt new file mode 100644 index 0000000..51567e1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_963.txt @@ -0,0 +1 @@ +0 0.5365384615384615 0.36875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_964.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_964.txt new file mode 100644 index 0000000..6a61333 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_964.txt @@ -0,0 +1 @@ +0 0.5173076923076924 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_965.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_965.txt new file mode 100644 index 0000000..c6d2205 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_965.txt @@ -0,0 +1 @@ +0 0.6057692307692307 0.315625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_966.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_966.txt new file mode 100644 index 0000000..f2bd385 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_966.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_967.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_967.txt new file mode 100644 index 0000000..e0e8758 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_967.txt @@ -0,0 +1 @@ +0 0.5096153846153846 0.359375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_968.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_968.txt new file mode 100644 index 0000000..b196b47 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_968.txt @@ -0,0 +1 @@ +0 0.6134615384615385 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_969.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_969.txt new file mode 100644 index 0000000..4eb9d42 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_969.txt @@ -0,0 +1 @@ +0 0.551923076923077 0.259375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_97.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_97.txt new file mode 100644 index 0000000..d23f68f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_97.txt @@ -0,0 +1 @@ +0 0.3211538461538462 0.215625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_970.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_970.txt new file mode 100644 index 0000000..c37d3ea --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_970.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.559375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_971.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_971.txt new file mode 100644 index 0000000..93f4dcd --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_971.txt @@ -0,0 +1 @@ +0 0.475 0.634375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_972.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_972.txt new file mode 100644 index 0000000..1360b57 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_972.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.471875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_973.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_973.txt new file mode 100644 index 0000000..bd36157 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_973.txt @@ -0,0 +1 @@ +0 0.49615384615384617 0.2 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_974.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_974.txt new file mode 100644 index 0000000..791f0ac --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_974.txt @@ -0,0 +1 @@ +0 0.38653846153846155 0.26875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_975.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_975.txt new file mode 100644 index 0000000..be69d91 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_975.txt @@ -0,0 +1 @@ +0 0.49038461538461536 0.421875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_976.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_976.txt new file mode 100644 index 0000000..f161a05 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_976.txt @@ -0,0 +1 @@ +0 0.4807692307692308 0.415625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_977.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_977.txt new file mode 100644 index 0000000..379d5ef --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_977.txt @@ -0,0 +1 @@ +0 0.6461538461538462 0.25 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_978.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_978.txt new file mode 100644 index 0000000..d8181b7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_978.txt @@ -0,0 +1 @@ +0 0.5 0.575 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_979.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_979.txt new file mode 100644 index 0000000..f2605ad --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_979.txt @@ -0,0 +1 @@ +0 0.42115384615384616 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_98.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_98.txt new file mode 100644 index 0000000..85c03ba --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_98.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.53125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_980.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_980.txt new file mode 100644 index 0000000..194ff9f --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_980.txt @@ -0,0 +1 @@ +0 0.4846153846153846 0.45625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_981.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_981.txt new file mode 100644 index 0000000..bfa7e45 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_981.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.440625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_982.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_982.txt new file mode 100644 index 0000000..292d0a1 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_982.txt @@ -0,0 +1 @@ +0 0.6019230769230769 0.21875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_983.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_983.txt new file mode 100644 index 0000000..b943b98 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_983.txt @@ -0,0 +1 @@ +0 0.6326923076923077 0.30625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_984.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_984.txt new file mode 100644 index 0000000..92cafe3 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_984.txt @@ -0,0 +1 @@ +0 0.4288461538461538 0.484375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_985.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_985.txt new file mode 100644 index 0000000..2a9c762 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_985.txt @@ -0,0 +1 @@ +0 0.5076923076923077 0.3625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_986.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_986.txt new file mode 100644 index 0000000..b614353 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_986.txt @@ -0,0 +1 @@ +0 0.38076923076923075 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_987.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_987.txt new file mode 100644 index 0000000..4038842 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_987.txt @@ -0,0 +1 @@ +0 0.3211538461538462 0.490625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_988.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_988.txt new file mode 100644 index 0000000..9702c79 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_988.txt @@ -0,0 +1 @@ +0 0.36346153846153845 0.08125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_989.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_989.txt new file mode 100644 index 0000000..23f9b8a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_989.txt @@ -0,0 +1 @@ +0 0.5865384615384616 0.5875 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_99.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_99.txt new file mode 100644 index 0000000..c92021c --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_99.txt @@ -0,0 +1 @@ +0 0.4596153846153846 0.475 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_990.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_990.txt new file mode 100644 index 0000000..feb6772 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_990.txt @@ -0,0 +1 @@ +0 0.45 0.615625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_991.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_991.txt new file mode 100644 index 0000000..5256bcc --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_991.txt @@ -0,0 +1 @@ +0 0.5634615384615385 0.14375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_992.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_992.txt new file mode 100644 index 0000000..7491b79 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_992.txt @@ -0,0 +1 @@ +0 0.6096153846153847 0.440625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_993.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_993.txt new file mode 100644 index 0000000..1f3ca2a --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_993.txt @@ -0,0 +1 @@ +0 0.32884615384615384 0.065625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_994.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_994.txt new file mode 100644 index 0000000..9871909 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_994.txt @@ -0,0 +1 @@ +0 0.4653846153846154 0.528125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_995.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_995.txt new file mode 100644 index 0000000..d5bdbc7 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_995.txt @@ -0,0 +1 @@ +0 0.5576923076923077 0.375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_996.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_996.txt new file mode 100644 index 0000000..6d53084 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_996.txt @@ -0,0 +1 @@ +0 0.6 0.303125 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_997.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_997.txt new file mode 100644 index 0000000..f6d139b --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_997.txt @@ -0,0 +1 @@ +0 0.31346153846153846 0.35625 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_998.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_998.txt new file mode 100644 index 0000000..27007d2 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_998.txt @@ -0,0 +1 @@ +0 0.38461538461538464 0.159375 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_999.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_999.txt new file mode 100644 index 0000000..9f9f1da --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/captcha/labels/captcha_999.txt @@ -0,0 +1 @@ +0 0.6230769230769231 0.225 0.16596774 0.24170968 \ No newline at end of file diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/compare.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/compare.py new file mode 100644 index 0000000..492af75 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/compare.py @@ -0,0 +1,9 @@ +import cv2 +import numpy as np + +image1 = cv2.imread('image1.png') +image2 = cv2.imread('image2.png') +sub = image1 - image2 +affine_arr = np.float32([[1, 0, 0], [0, 1, 0]]) +res = cv2.warpAffine(image2, affine_arr, (image2.shape[1], image2.shape[0])) +cv2.imwrite('sub.png', sub) diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/construct.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/construct.py new file mode 100644 index 0000000..08e6909 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/construct.py @@ -0,0 +1,31 @@ +import cv2 +import os +import numpy as np +from loguru import logger + +CAPTCHA_WIDTH = 520 +CAPTCHA_HEIGHT = 320 + +for root, dirs, files in os.walk('input'): + for file in files: + image_path = os.path.join(root, file) + logger.debug(f'image path {image_path}') + image = cv2.imread(image_path, cv2.IMREAD_UNCHANGED) + image_height, image_width, image_dim = image.shape + + if image_dim == 3: + b_channel, g_channel, r_channel = cv2.split(image) + alpha_channel = np.ones(b_channel.shape, dtype=b_channel.dtype) * 255 + image = cv2.merge((b_channel, g_channel, r_channel, alpha_channel)) + + if image_width / image_height > CAPTCHA_WIDTH / CAPTCHA_HEIGHT: + image = cv2.resize(image, (int(CAPTCHA_HEIGHT * image_width / image_height), CAPTCHA_HEIGHT)) + image_height, image_width, _ = image.shape + image = image[:, int(image_width / 2 - CAPTCHA_WIDTH / 2): int(image_width / 2 + CAPTCHA_WIDTH / 2)] + else: + image = cv2.resize(image, (CAPTCHA_WIDTH, int(CAPTCHA_WIDTH * image_height / image_width))) + image_height, image_width, _ = image.shape + image = image[int(image_height / 2 - CAPTCHA_HEIGHT / 2): int(image_height / 2 + CAPTCHA_HEIGHT / 2), :] + + cv2.imwrite(f'output/{file}', image) + logger.debug(f'finish output/{file}') diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/image1.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/image1.png new file mode 100644 index 0000000..ca89110 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/image1.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/image2.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/image2.png new file mode 100644 index 0000000..34ff494 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/image2.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/1.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/1.png new file mode 100644 index 0000000..b36d97e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/1.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/10.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/10.png new file mode 100644 index 0000000..67e10a7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/10.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/11.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/11.png new file mode 100644 index 0000000..2ebc65a Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/11.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/13.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/13.png new file mode 100644 index 0000000..92ce600 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/13.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/14.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/14.png new file mode 100644 index 0000000..336f610 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/14.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/15.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/15.png new file mode 100644 index 0000000..30d3c66 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/15.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/16.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/16.png new file mode 100644 index 0000000..a679071 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/16.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/18.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/18.png new file mode 100644 index 0000000..0b01ec4 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/18.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/19.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/19.png new file mode 100644 index 0000000..73e5a3e Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/19.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/2.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/2.png new file mode 100644 index 0000000..eaf1668 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/2.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/20.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/20.png new file mode 100644 index 0000000..1b84175 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/20.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/21.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/21.png new file mode 100644 index 0000000..5d3ea02 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/21.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/22.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/22.png new file mode 100644 index 0000000..a055b65 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/22.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/23.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/23.png new file mode 100644 index 0000000..8098c63 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/23.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/24.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/24.png new file mode 100644 index 0000000..7560316 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/24.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/26.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/26.png new file mode 100644 index 0000000..0089e10 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/26.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/27.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/27.png new file mode 100644 index 0000000..9bcb03b Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/27.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/28.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/28.png new file mode 100644 index 0000000..744df9d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/28.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/3.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/3.png new file mode 100644 index 0000000..9062377 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/3.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/30.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/30.png new file mode 100644 index 0000000..9fdf143 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/30.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/31.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/31.png new file mode 100644 index 0000000..3901058 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/31.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/32.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/32.png new file mode 100644 index 0000000..396a892 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/32.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/33.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/33.png new file mode 100644 index 0000000..5493e69 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/33.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/34.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/34.png new file mode 100644 index 0000000..67ebeb2 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/34.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/35.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/35.png new file mode 100644 index 0000000..1dbc03c Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/35.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/36.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/36.png new file mode 100644 index 0000000..cf533ea Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/36.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/37.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/37.png new file mode 100644 index 0000000..86f0130 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/37.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/38.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/38.png new file mode 100644 index 0000000..d140024 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/38.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/39.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/39.png new file mode 100644 index 0000000..ad57336 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/39.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/5.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/5.png new file mode 100644 index 0000000..854587d Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/5.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/6.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/6.png new file mode 100644 index 0000000..7bc5845 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/6.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/7.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/7.png new file mode 100644 index 0000000..b26d9df Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/7.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/8.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/8.png new file mode 100644 index 0000000..938eba7 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/8.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/9.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/9.png new file mode 100644 index 0000000..d7b1319 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/input/9.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/paste.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/paste.py new file mode 100644 index 0000000..ea44add --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/paste.py @@ -0,0 +1,43 @@ +import os +from PIL import Image +import random +import glob +from loguru import logger + +CAPTCHA_WIDTH = 520 +CAPTCHA_HEIGHT = 320 + +image_source = Image.open('block_source.png') +image_target = Image.open('block_target.png') + +label_offset_x_base = 260 +label_offset_y_base = 120 + +count = 0 +total = 1000 +root_dir = 'output' +file_paths = glob.glob(f'{root_dir}/*.png') + +while True: + file_path = random.choice(file_paths) + + offset_y = random.randint(-100, 100) + offset_x = random.randint(-100, 100) + + label_offset_x = label_offset_x_base + offset_x + label_offset_y = label_offset_y_base + offset_y + + image_path = os.path.join(file_path) + image = Image.open(image_path) + image.paste(image_target, (offset_x, offset_y), image_target) + image.paste(image_source, (0, offset_y), image_source) + label = f'0 {label_offset_x / CAPTCHA_WIDTH} {label_offset_y / CAPTCHA_HEIGHT} 0.16596774 0.24170968' + image.save(f'captcha/images/captcha_{count}.png') + logger.debug(f'generated captcha file captcha_{count}.png') + with open(f'captcha/labels/captcha_{count}.txt', 'w') as f: + f.write(label) + logger.debug(f'generated label file captcha_{count}.txt') + count += 1 + if count > total: + logger.debug('finished') + break diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/prepare.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/prepare.py new file mode 100644 index 0000000..912e4f5 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/prepare.py @@ -0,0 +1,15 @@ +import glob +from sklearn.model_selection import train_test_split + +file_paths = glob.glob('captcha/images/*.png') +print('file_paths', file_paths) + +train, valid = train_test_split(file_paths, test_size=0.2) + +with open('train.txt', 'w', encoding='utf-8') as f: + for item in train: + f.write(f'data/{item}\n') + +with open('valid.txt', 'w', encoding='utf-8') as f: + for item in valid: + f.write(f'data/{item}\n') diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/sub.png b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/sub.png new file mode 100644 index 0000000..31a57f1 Binary files /dev/null and b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/preprocess/sub.png differ diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/process.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/process.py new file mode 100644 index 0000000..d71de62 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/process.py @@ -0,0 +1,19 @@ +import xmltodict +import json + + +def parse_xml(file): + xml_str = open(file, encoding='utf-8').read() + data = xmltodict.parse(xml_str) + data = json.loads(json.dumps(data)) + annoatation = data.get('annotation') + width = int(annoatation.get('size').get('width')) + height = int(annoatation.get('size').get('height')) + bndbox = annoatation.get('object').get('bndbox') + box_xmin = int(bndbox.get('xmin')) + box_xmax = int(bndbox.get('xmax')) + box_ymin = int(bndbox.get('ymin')) + box_ymax = int(bndbox.get('ymax')) + box_width = (box_xmax - box_xmin) / width + box_height = (box_ymax - box_ymin) / height + return box_xmin / width, box_ymax / height, box_width / width, box_height / height diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/requirements.txt b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/requirements.txt new file mode 100644 index 0000000..08f8190 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/requirements.txt @@ -0,0 +1,9 @@ +numpy +torch>=1.0 +torchvision +matplotlib +tensorflow==2.4.0 +tensorboard +terminaltables +pillow +tqdm diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/test.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/test.py new file mode 100644 index 0000000..59e9c73 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/test.py @@ -0,0 +1,109 @@ +from __future__ import division + +from models import * +from utils.utils import * +from utils.datasets import * +from utils.parse_config import * + +import os +import sys +import time +import datetime +import argparse +import tqdm + +import torch +from torch.utils.data import DataLoader +from torchvision import datasets +from torchvision import transforms +from torch.autograd import Variable +import torch.optim as optim + + +def evaluate(model, path, iou_thres, conf_thres, nms_thres, img_size, batch_size): + model.eval() + + # Get dataloader + dataset = ListDataset(path, img_size=img_size, augment=False, multiscale=False) + dataloader = torch.utils.data.DataLoader( + dataset, batch_size=batch_size, shuffle=False, num_workers=1, collate_fn=dataset.collate_fn + ) + + Tensor = torch.cuda.FloatTensor if torch.cuda.is_available() else torch.FloatTensor + + labels = [] + sample_metrics = [] # List of tuples (TP, confs, pred) + for batch_i, (_, imgs, targets) in enumerate(tqdm.tqdm(dataloader, desc="Detecting objects")): + + # Extract labels + labels += targets[:, 1].tolist() + # Rescale target + targets[:, 2:] = xywh2xyxy(targets[:, 2:]) + targets[:, 2:] *= img_size + + imgs = Variable(imgs.type(Tensor), requires_grad=False) + + with torch.no_grad(): + outputs = model(imgs) + outputs = non_max_suppression(outputs, conf_thres=conf_thres, nms_thres=nms_thres) + + sample_metrics += get_batch_statistics(outputs, targets, iou_threshold=iou_thres) + + if not sample_metrics: + print('no eval result') + return None + + # Concatenate sample statistics + true_positives, pred_scores, pred_labels = [np.concatenate(x, 0) for x in list(zip(*sample_metrics))] + precision, recall, AP, f1, ap_class = ap_per_class(true_positives, pred_scores, pred_labels, labels) + + return precision, recall, AP, f1, ap_class + + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--batch_size", type=int, default=8, help="size of each image batch") + parser.add_argument("--model_def", type=str, default="config/yolov3.cfg", help="path to model definition file") + parser.add_argument("--data_config", type=str, default="config/coco.data", help="path to data config file") + parser.add_argument("--weights_path", type=str, default="weights/yolov3.weights", help="path to weights file") + parser.add_argument("--class_path", type=str, default="data/coco.names", help="path to class label file") + parser.add_argument("--iou_thres", type=float, default=0.5, help="iou threshold required to qualify as detected") + parser.add_argument("--conf_thres", type=float, default=0.001, help="object confidence threshold") + parser.add_argument("--nms_thres", type=float, default=0.5, help="iou thresshold for non-maximum suppression") + parser.add_argument("--n_cpu", type=int, default=8, help="number of cpu threads to use during batch generation") + parser.add_argument("--img_size", type=int, default=416, help="size of each image dimension") + opt = parser.parse_args() + print(opt) + + device = torch.device("cuda" if torch.cuda.is_available() else "cpu") + + data_config = parse_data_config(opt.data_config) + valid_path = data_config["valid"] + class_names = load_classes(data_config["names"]) + + # Initiate model + model = Darknet(opt.model_def).to(device) + if opt.weights_path.endswith(".weights"): + # Load darknet weights + model.load_darknet_weights(opt.weights_path) + else: + # Load checkpoint weights + model.load_state_dict(torch.load(opt.weights_path)) + + print("Compute mAP...") + + precision, recall, AP, f1, ap_class = evaluate( + model, + path=valid_path, + iou_thres=opt.iou_thres, + conf_thres=opt.conf_thres, + nms_thres=opt.nms_thres, + img_size=opt.img_size, + batch_size=8, + ) + + print("Average Precisions:") + for i, c in enumerate(ap_class): + print(f"+ Class '{c}' ({class_names[c]}) - AP: {AP[i]}") + + print(f"mAP: {AP.mean()}") diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/train.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/train.py new file mode 100644 index 0000000..a7652de --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/train.py @@ -0,0 +1,202 @@ +from __future__ import division +import sys + +if not sys.warnoptions: + import warnings + + warnings.simplefilter("ignore") + +import warnings + + +def fxn(): + warnings.warn("deprecated", DeprecationWarning) + + +with warnings.catch_warnings(): + warnings.simplefilter("ignore") + fxn() + +warnings.filterwarnings("ignore") + +from models import * +from utils.logger import * +from utils.utils import * +from utils.datasets import * +from utils.parse_config import * +from test import evaluate + +from terminaltables import AsciiTable + +import os +import sys +import time +import datetime +import argparse + +import torch +from torch.utils.data import DataLoader +from torchvision import datasets +from torchvision import transforms +from torch.autograd import Variable +import torch.optim as optim + +if __name__ == "__main__": + parser = argparse.ArgumentParser() + parser.add_argument("--epochs", type=int, default=100, help="number of epochs") + parser.add_argument("--batch_size", type=int, default=8, help="size of each image batch") + parser.add_argument("--gradient_accumulations", type=int, default=2, help="number of gradient accums before step") + parser.add_argument("--model_def", type=str, default="config/yolov3.cfg", help="path to model definition file") + parser.add_argument("--data_config", type=str, default="config/coco.data", help="path to data config file") + parser.add_argument("--pretrained_weights", type=str, help="if specified starts from checkpoint model") + parser.add_argument("--n_cpu", type=int, default=8, help="number of cpu threads to use during batch generation") + parser.add_argument("--img_size", type=int, default=416, help="size of each image dimension") + parser.add_argument("--checkpoint_interval", type=int, default=1, help="interval between saving model weights") + parser.add_argument("--evaluation_interval", type=int, default=1, help="interval evaluations on validation set") + parser.add_argument("--compute_map", default=False, help="if True computes mAP every tenth batch") + parser.add_argument("--multiscale_training", default=True, help="allow for multi-scale training") + opt = parser.parse_args() + print(opt) + + logger = Logger("logs") + + device = torch.device("cuda" if torch.cuda.is_available() else "cpu") + + os.makedirs("output", exist_ok=True) + os.makedirs("checkpoints", exist_ok=True) + + # Get data configuration + data_config = parse_data_config(opt.data_config) + train_path = data_config["train"] + valid_path = data_config["valid"] + class_names = load_classes(data_config["names"]) + + # Initiate model + model = Darknet(opt.model_def).to(device) + model.apply(weights_init_normal) + + # If specified we start from checkpoint + if opt.pretrained_weights: + if opt.pretrained_weights.endswith(".pth"): + model.load_state_dict(torch.load(opt.pretrained_weights)) + else: + model.load_darknet_weights(opt.pretrained_weights) + + # Get dataloader + dataset = ListDataset(train_path, augment=True, multiscale=opt.multiscale_training) + dataloader = torch.utils.data.DataLoader( + dataset, + batch_size=opt.batch_size, + shuffle=True, + num_workers=opt.n_cpu, + pin_memory=True, + collate_fn=dataset.collate_fn, + ) + + optimizer = torch.optim.Adam(model.parameters()) + + metrics = [ + "grid_size", + "loss", + "x", + "y", + "w", + "h", + "conf", + "cls", + "cls_acc", + "recall50", + "recall75", + "precision", + "conf_obj", + "conf_noobj", + ] + + for epoch in range(opt.epochs): + model.train() + start_time = time.time() + for batch_i, (_, imgs, targets) in enumerate(dataloader): + batches_done = len(dataloader) * epoch + batch_i + + imgs = Variable(imgs.to(device)) + targets = Variable(targets.to(device), requires_grad=False) + + loss, outputs = model(imgs, targets) + loss.backward() + + if batches_done % opt.gradient_accumulations: + # Accumulates gradient before each step + optimizer.step() + optimizer.zero_grad() + + # ---------------- + # Log progress + # ---------------- + + log_str = "\n---- [Epoch %d/%d, Batch %d/%d] ----\n" % (epoch, opt.epochs, batch_i, len(dataloader)) + + metric_table = [["Metrics", *[f"YOLO Layer {i}" for i in range(len(model.yolo_layers))]]] + + # Log metrics at each YOLO layer + for i, metric in enumerate(metrics): + formats = {m: "%.6f" for m in metrics} + formats["grid_size"] = "%2d" + formats["cls_acc"] = "%.2f%%" + row_metrics = [formats[metric] % yolo.metrics.get(metric, 0) for yolo in model.yolo_layers] + metric_table += [[metric, *row_metrics]] + + # Tensorboard logging + tensorboard_log = [] + for j, yolo in enumerate(model.yolo_layers): + for name, metric in yolo.metrics.items(): + if name != "grid_size": + tensorboard_log += [(f"{name}_{j + 1}", metric)] + tensorboard_log += [("loss", loss.item())] + logger.list_of_scalars_summary(tensorboard_log, batches_done) + + log_str += AsciiTable(metric_table).table + log_str += f"\nTotal loss {loss.item()}" + + # Determine approximate time left for epoch + epoch_batches_left = len(dataloader) - (batch_i + 1) + time_left = datetime.timedelta(seconds=epoch_batches_left * (time.time() - start_time) / (batch_i + 1)) + log_str += f"\n---- ETA {time_left}" + + print(log_str) + + model.seen += imgs.size(0) + + print('Epoch', epoch, opt.evaluation_interval) + + if epoch % opt.evaluation_interval == 0: + print("\n---- Evaluating Model ----") + # Evaluate the model on the validation set + result = evaluate( + model, + path=valid_path, + iou_thres=0.5, + conf_thres=0.5, + nms_thres=0.5, + img_size=opt.img_size, + batch_size=8, + ) + if result: + print('result', result) + precision, recall, AP, f1, ap_class = result + evaluation_metrics = [ + ("val_precision", precision.mean()), + ("val_recall", recall.mean()), + ("val_mAP", AP.mean()), + ("val_f1", f1.mean()), + ] + logger.list_of_scalars_summary(evaluation_metrics, epoch) + + # Print class APs and mAP + ap_table = [["Index", "Class name", "AP"]] + for i, c in enumerate(ap_class): + ap_table += [[c, class_names[c], "%.5f" % AP[i]]] + print(AsciiTable(ap_table).table) + print(f"---- mAP {AP.mean()}") + + if epoch % opt.checkpoint_interval == 0: + torch.save(model.state_dict(), f"checkpoints/yolov3_ckpt_%d.pth" % epoch) diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/train.sh b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/train.sh new file mode 100644 index 0000000..cdf7914 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/train.sh @@ -0,0 +1 @@ +python3 train.py --model_def config/yolov3-captcha.cfg --data_config config/captcha.data --pretrained_weights weights/darknet53.conv.74 diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/__init__.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/augmentations.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/augmentations.py new file mode 100644 index 0000000..b1aed5d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/augmentations.py @@ -0,0 +1,9 @@ +import torch +import torch.nn.functional as F +import numpy as np + + +def horisontal_flip(images, targets): + images = torch.flip(images, [-1]) + targets[:, 2] = 1 - targets[:, 2] + return images, targets diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/datasets.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/datasets.py new file mode 100644 index 0000000..8cdba62 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/datasets.py @@ -0,0 +1,154 @@ +import glob +import random +import os +import sys +import numpy as np +from PIL import Image +import torch +import torch.nn.functional as F + +from utils.augmentations import horisontal_flip +from torch.utils.data import Dataset +import torchvision.transforms as transforms + + +def pad_to_square(img, pad_value): + c, h, w = img.shape + dim_diff = np.abs(h - w) + # (upper / left) padding and (lower / right) padding + pad1, pad2 = dim_diff // 2, dim_diff - dim_diff // 2 + # Determine padding + pad = (0, 0, pad1, pad2) if h <= w else (pad1, pad2, 0, 0) + # Add padding + img = F.pad(img, pad, "constant", value=pad_value) + + return img, pad + + +def resize(image, size): + image = F.interpolate(image.unsqueeze(0), size=size, mode="nearest").squeeze(0) + return image + + +def random_resize(images, min_size=288, max_size=448): + new_size = random.sample(list(range(min_size, max_size + 1, 32)), 1)[0] + images = F.interpolate(images, size=new_size, mode="nearest") + return images + + +class ImageFolder(Dataset): + def __init__(self, folder_path, img_size=416): + self.files = sorted(glob.glob("%s/*.*" % folder_path)) + self.img_size = img_size + + def __getitem__(self, index): + img_path = self.files[index % len(self.files)] + # Extract image as PyTorch tensor + # img = transforms.ToTensor()(Image.open(img_path)) + + img = transforms.ToTensor()(Image.open(img_path).convert('RGB')) + + # Pad to square resolution + img, _ = pad_to_square(img, 0) + # Resize + img = resize(img, self.img_size) + + return img_path, img + + def __len__(self): + return len(self.files) + + +class ListDataset(Dataset): + def __init__(self, list_path, img_size=416, augment=True, multiscale=True, normalized_labels=True): + with open(list_path, "r") as file: + self.img_files = file.readlines() + + self.label_files = [ + path.replace("images", "labels").replace(".png", ".txt").replace(".jpg", ".txt") + for path in self.img_files + ] + self.img_size = img_size + self.max_objects = 100 + self.augment = augment + self.multiscale = multiscale + self.normalized_labels = normalized_labels + self.min_size = self.img_size - 3 * 32 + self.max_size = self.img_size + 3 * 32 + self.batch_count = 0 + + def __getitem__(self, index): + + # --------- + # Image + # --------- + + img_path = self.img_files[index % len(self.img_files)].rstrip() + + # Extract image as PyTorch tensor + img = transforms.ToTensor()(Image.open(img_path).convert('RGB')) + + # Handle images with less than three channels + if len(img.shape) != 3: + img = img.unsqueeze(0) + img = img.expand((3, img.shape[1:])) + + _, h, w = img.shape + h_factor, w_factor = (h, w) if self.normalized_labels else (1, 1) + # Pad to square resolution + img, pad = pad_to_square(img, 0) + _, padded_h, padded_w = img.shape + + # --------- + # Label + # --------- + + label_path = self.label_files[index % len(self.img_files)].rstrip() + + targets = None + if os.path.exists(label_path): + boxes = torch.from_numpy(np.loadtxt(label_path).reshape(-1, 5)) + # Extract coordinates for unpadded + unscaled image + x1 = w_factor * (boxes[:, 1] - boxes[:, 3] / 2) + y1 = h_factor * (boxes[:, 2] - boxes[:, 4] / 2) + x2 = w_factor * (boxes[:, 1] + boxes[:, 3] / 2) + y2 = h_factor * (boxes[:, 2] + boxes[:, 4] / 2) + # Adjust for added padding + x1 += pad[0] + y1 += pad[2] + x2 += pad[1] + y2 += pad[3] + # Returns (x, y, w, h) + boxes[:, 1] = ((x1 + x2) / 2) / padded_w + boxes[:, 2] = ((y1 + y2) / 2) / padded_h + boxes[:, 3] *= w_factor / padded_w + boxes[:, 4] *= h_factor / padded_h + + targets = torch.zeros((len(boxes), 6)) + targets[:, 1:] = boxes + + # Apply augmentations + if self.augment: + if np.random.random() < 0.5: + img, targets = horisontal_flip(img, targets) + + return img_path, img, targets + + def collate_fn(self, batch): + paths, imgs, targets = list(zip(*batch)) + # Remove empty placeholder targets + targets = [boxes for boxes in targets if boxes is not None] + # Add sample index to targets + for i, boxes in enumerate(targets): + boxes[:, 0] = i + targets = torch.cat(targets, 0) + # Selects new image size every tenth batch + if self.multiscale and self.batch_count % 10 == 0: + self.img_size = random.choice(range(self.min_size, self.max_size + 1, 32)) + # Resize images to input shape + imgs = torch.stack([resize(img, self.img_size) for img in imgs]) + self.batch_count += 1 + return paths, imgs, targets + + def __len__(self): + return len(self.img_files) diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/logger.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/logger.py new file mode 100644 index 0000000..9d7f820 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/logger.py @@ -0,0 +1,24 @@ +import tensorflow as tf + + +class Logger(object): + def __init__(self, log_dir): + """Create a summary writer logging to log_dir.""" + self.writer = tf.summary.create_file_writer(log_dir) + + def scalar_summary(self, tag, value, step): + """Log a scalar variable.""" + # summary = tf.Summary(value=[tf.Summary.Value(tag=tag, simple_value=value)]) + # self.writer.add_summary(summary, step) + + with self.writer.as_default(): + tf.summary.scalar(tag, value, step=step) + + def list_of_scalars_summary(self, tag_value_pairs, step): + """Log scalar variables.""" + # summary = tf.Summary(value=[tf.Summary.Value(tag=tag, simple_value=value) for tag, value in tag_value_pairs]) + # self.writer.add_summary(summary, step) + + with self.writer.as_default(): + for tag, value in tag_value_pairs: + tf.summary.scalar(tag, value, step=step) diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/parse_config.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/parse_config.py new file mode 100644 index 0000000..9dc0358 --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/parse_config.py @@ -0,0 +1,36 @@ + + +def parse_model_config(path): + """Parses the yolo-v3 layer configuration file and returns module definitions""" + file = open(path, 'r') + lines = file.read().split('\n') + lines = [x for x in lines if x and not x.startswith('#')] + lines = [x.rstrip().lstrip() for x in lines] # get rid of fringe whitespaces + module_defs = [] + for line in lines: + if line.startswith('['): # This marks the start of a new block + module_defs.append({}) + module_defs[-1]['type'] = line[1:-1].rstrip() + if module_defs[-1]['type'] == 'convolutional': + module_defs[-1]['batch_normalize'] = 0 + else: + key, value = line.split("=") + value = value.strip() + module_defs[-1][key.rstrip()] = value.strip() + + return module_defs + +def parse_data_config(path): + """Parses the data configuration file""" + options = dict() + options['gpus'] = '0,1,2,3' + options['num_workers'] = '10' + with open(path, 'r') as fp: + lines = fp.readlines() + for line in lines: + line = line.strip() + if line == '' or line.startswith('#'): + continue + key, value = line.split('=') + options[key.strip()] = value.strip() + return options diff --git a/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/utils.py b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/utils.py new file mode 100644 index 0000000..5eb2a1d --- /dev/null +++ b/Spider/Chapter08_验证码的识别/深度学习识别滑动验证码/utils/utils.py @@ -0,0 +1,321 @@ +from __future__ import division +import math +import time +import tqdm +import torch +import torch.nn as nn +import torch.nn.functional as F +from torch.autograd import Variable +import numpy as np +import matplotlib.pyplot as plt +import matplotlib.patches as patches + + +def to_cpu(tensor): + return tensor.detach().cpu() + + +def load_classes(path): + """ + Loads class labels at 'path' + """ + fp = open(path, "r") + names = fp.read().split("\n")[:-1] + return names + + +def weights_init_normal(m): + classname = m.__class__.__name__ + if classname.find("Conv") != -1: + torch.nn.init.normal_(m.weight.data, 0.0, 0.02) + elif classname.find("BatchNorm2d") != -1: + torch.nn.init.normal_(m.weight.data, 1.0, 0.02) + torch.nn.init.constant_(m.bias.data, 0.0) + + +def rescale_boxes(boxes, current_dim, original_shape): + """ Rescales bounding boxes to the original shape """ + orig_h, orig_w = original_shape + # The amount of padding that was added + pad_x = max(orig_h - orig_w, 0) * (current_dim / max(original_shape)) + pad_y = max(orig_w - orig_h, 0) * (current_dim / max(original_shape)) + # Image height and width after padding is removed + unpad_h = current_dim - pad_y + unpad_w = current_dim - pad_x + # Rescale bounding boxes to dimension of original image + boxes[:, 0] = ((boxes[:, 0] - pad_x // 2) / unpad_w) * orig_w + boxes[:, 1] = ((boxes[:, 1] - pad_y // 2) / unpad_h) * orig_h + boxes[:, 2] = ((boxes[:, 2] - pad_x // 2) / unpad_w) * orig_w + boxes[:, 3] = ((boxes[:, 3] - pad_y // 2) / unpad_h) * orig_h + return boxes + + +def xywh2xyxy(x): + y = x.new(x.shape) + y[..., 0] = x[..., 0] - x[..., 2] / 2 + y[..., 1] = x[..., 1] - x[..., 3] / 2 + y[..., 2] = x[..., 0] + x[..., 2] / 2 + y[..., 3] = x[..., 1] + x[..., 3] / 2 + return y + + +def ap_per_class(tp, conf, pred_cls, target_cls): + """ Compute the average precision, given the recall and precision curves. + Source: https://github.com/rafaelpadilla/Object-Detection-Metrics. + # Arguments + tp: True positives (list). + conf: Objectness value from 0-1 (list). + pred_cls: Predicted object classes (list). + target_cls: True object classes (list). + # Returns + The average precision as computed in py-faster-rcnn. + """ + + # Sort by objectness + i = np.argsort(-conf) + tp, conf, pred_cls = tp[i], conf[i], pred_cls[i] + + # Find unique classes + unique_classes = np.unique(target_cls) + + # Create Precision-Recall curve and compute AP for each class + ap, p, r = [], [], [] + for c in tqdm.tqdm(unique_classes, desc="Computing AP"): + i = pred_cls == c + n_gt = (target_cls == c).sum() # Number of ground truth objects + n_p = i.sum() # Number of predicted objects + + if n_p == 0 and n_gt == 0: + continue + elif n_p == 0 or n_gt == 0: + ap.append(0) + r.append(0) + p.append(0) + else: + # Accumulate FPs and TPs + fpc = (1 - tp[i]).cumsum() + tpc = (tp[i]).cumsum() + + # Recall + recall_curve = tpc / (n_gt + 1e-16) + r.append(recall_curve[-1]) + + # Precision + precision_curve = tpc / (tpc + fpc) + p.append(precision_curve[-1]) + + # AP from recall-precision curve + ap.append(compute_ap(recall_curve, precision_curve)) + + # Compute F1 score (harmonic mean of precision and recall) + p, r, ap = np.array(p), np.array(r), np.array(ap) + f1 = 2 * p * r / (p + r + 1e-16) + + return p, r, ap, f1, unique_classes.astype("int32") + + +def compute_ap(recall, precision): + """ Compute the average precision, given the recall and precision curves. + Code originally from https://github.com/rbgirshick/py-faster-rcnn. + + # Arguments + recall: The recall curve (list). + precision: The precision curve (list). + # Returns + The average precision as computed in py-faster-rcnn. + """ + # correct AP calculation + # first append sentinel values at the end + mrec = np.concatenate(([0.0], recall, [1.0])) + mpre = np.concatenate(([0.0], precision, [0.0])) + + # compute the precision envelope + for i in range(mpre.size - 1, 0, -1): + mpre[i - 1] = np.maximum(mpre[i - 1], mpre[i]) + + # to calculate area under PR curve, look for points + # where X axis (recall) changes value + i = np.where(mrec[1:] != mrec[:-1])[0] + + # and sum (\Delta recall) * prec + ap = np.sum((mrec[i + 1] - mrec[i]) * mpre[i + 1]) + return ap + + +def get_batch_statistics(outputs, targets, iou_threshold): + """ Compute true positives, predicted scores and predicted labels per sample """ + batch_metrics = [] + for sample_i in range(len(outputs)): + + if outputs[sample_i] is None: + continue + + output = outputs[sample_i] + pred_boxes = output[:, :4] + pred_scores = output[:, 4] + pred_labels = output[:, -1] + + true_positives = np.zeros(pred_boxes.shape[0]) + + annotations = targets[targets[:, 0] == sample_i][:, 1:] + target_labels = annotations[:, 0] if len(annotations) else [] + if len(annotations): + detected_boxes = [] + target_boxes = annotations[:, 1:] + + for pred_i, (pred_box, pred_label) in enumerate(zip(pred_boxes, pred_labels)): + + # If targets are found break + if len(detected_boxes) == len(annotations): + break + + # Ignore if label is not one of the target labels + if pred_label not in target_labels: + continue + + iou, box_index = bbox_iou(pred_box.unsqueeze(0), target_boxes).max(0) + if iou >= iou_threshold and box_index not in detected_boxes: + true_positives[pred_i] = 1 + detected_boxes += [box_index] + batch_metrics.append([true_positives, pred_scores, pred_labels]) + return batch_metrics + + +def bbox_wh_iou(wh1, wh2): + wh2 = wh2.t() + w1, h1 = wh1[0], wh1[1] + w2, h2 = wh2[0], wh2[1] + inter_area = torch.min(w1, w2) * torch.min(h1, h2) + union_area = (w1 * h1 + 1e-16) + w2 * h2 - inter_area + return inter_area / union_area + + +def bbox_iou(box1, box2, x1y1x2y2=True): + """ + Returns the IoU of two bounding boxes + """ + if not x1y1x2y2: + # Transform from center and width to exact coordinates + b1_x1, b1_x2 = box1[:, 0] - box1[:, 2] / 2, box1[:, 0] + box1[:, 2] / 2 + b1_y1, b1_y2 = box1[:, 1] - box1[:, 3] / 2, box1[:, 1] + box1[:, 3] / 2 + b2_x1, b2_x2 = box2[:, 0] - box2[:, 2] / 2, box2[:, 0] + box2[:, 2] / 2 + b2_y1, b2_y2 = box2[:, 1] - box2[:, 3] / 2, box2[:, 1] + box2[:, 3] / 2 + else: + # Get the coordinates of bounding boxes + b1_x1, b1_y1, b1_x2, b1_y2 = box1[:, 0], box1[:, 1], box1[:, 2], box1[:, 3] + b2_x1, b2_y1, b2_x2, b2_y2 = box2[:, 0], box2[:, 1], box2[:, 2], box2[:, 3] + + # get the corrdinates of the intersection rectangle + inter_rect_x1 = torch.max(b1_x1, b2_x1) + inter_rect_y1 = torch.max(b1_y1, b2_y1) + inter_rect_x2 = torch.min(b1_x2, b2_x2) + inter_rect_y2 = torch.min(b1_y2, b2_y2) + # Intersection area + inter_area = torch.clamp(inter_rect_x2 - inter_rect_x1 + 1, min=0) * torch.clamp( + inter_rect_y2 - inter_rect_y1 + 1, min=0 + ) + # Union Area + b1_area = (b1_x2 - b1_x1 + 1) * (b1_y2 - b1_y1 + 1) + b2_area = (b2_x2 - b2_x1 + 1) * (b2_y2 - b2_y1 + 1) + + iou = inter_area / (b1_area + b2_area - inter_area + 1e-16) + + return iou + + +def non_max_suppression(prediction, conf_thres=0.5, nms_thres=0.4): + """ + Removes detections with lower object confidence score than 'conf_thres' and performs + Non-Maximum Suppression to further filter detections. + Returns detections with shape: + (x1, y1, x2, y2, object_conf, class_score, class_pred) + """ + + # From (center x, center y, width, height) to (x1, y1, x2, y2) + prediction[..., :4] = xywh2xyxy(prediction[..., :4]) + output = [None for _ in range(len(prediction))] + for image_i, image_pred in enumerate(prediction): + # Filter out confidence scores below threshold + image_pred = image_pred[image_pred[:, 4] >= conf_thres] + # If none are remaining => process next image + if not image_pred.size(0): + continue + # Object confidence times class confidence + score = image_pred[:, 4] * image_pred[:, 5:].max(1)[0] + # Sort by it + image_pred = image_pred[(-score).argsort()] + class_confs, class_preds = image_pred[:, 5:].max(1, keepdim=True) + detections = torch.cat((image_pred[:, :5], class_confs.float(), class_preds.float()), 1) + # Perform non-maximum suppression + keep_boxes = [] + while detections.size(0): + large_overlap = bbox_iou(detections[0, :4].unsqueeze(0), detections[:, :4]) > nms_thres + label_match = detections[0, -1] == detections[:, -1] + # Indices of boxes with lower confidence scores, large IOUs and matching labels + invalid = large_overlap & label_match + weights = detections[invalid, 4:5] + # Merge overlapping bboxes by order of confidence + detections[0, :4] = (weights * detections[invalid, :4]).sum(0) / weights.sum() + keep_boxes += [detections[0]] + detections = detections[~invalid] + if keep_boxes: + output[image_i] = torch.stack(keep_boxes) + + return output + + +def build_targets(pred_boxes, pred_cls, target, anchors, ignore_thres): + + ByteTensor = torch.cuda.ByteTensor if pred_boxes.is_cuda else torch.ByteTensor + FloatTensor = torch.cuda.FloatTensor if pred_boxes.is_cuda else torch.FloatTensor + + nB = pred_boxes.size(0) + nA = pred_boxes.size(1) + nC = pred_cls.size(-1) + nG = pred_boxes.size(2) + + # Output tensors + obj_mask = ByteTensor(nB, nA, nG, nG).fill_(0) + noobj_mask = ByteTensor(nB, nA, nG, nG).fill_(1) + class_mask = FloatTensor(nB, nA, nG, nG).fill_(0) + iou_scores = FloatTensor(nB, nA, nG, nG).fill_(0) + tx = FloatTensor(nB, nA, nG, nG).fill_(0) + ty = FloatTensor(nB, nA, nG, nG).fill_(0) + tw = FloatTensor(nB, nA, nG, nG).fill_(0) + th = FloatTensor(nB, nA, nG, nG).fill_(0) + tcls = FloatTensor(nB, nA, nG, nG, nC).fill_(0) + + # Convert to position relative to box + target_boxes = target[:, 2:6] * nG + gxy = target_boxes[:, :2] + gwh = target_boxes[:, 2:] + # Get anchors with best iou + ious = torch.stack([bbox_wh_iou(anchor, gwh) for anchor in anchors]) + best_ious, best_n = ious.max(0) + # Separate target values + b, target_labels = target[:, :2].long().t() + gx, gy = gxy.t() + gw, gh = gwh.t() + gi, gj = gxy.long().t() + # Set masks + obj_mask[b, best_n, gj, gi] = 1 + noobj_mask[b, best_n, gj, gi] = 0 + + # Set noobj mask to zero where iou exceeds ignore threshold + for i, anchor_ious in enumerate(ious.t()): + noobj_mask[b[i], anchor_ious > ignore_thres, gj[i], gi[i]] = 0 + + # Coordinates + tx[b, best_n, gj, gi] = gx - gx.floor() + ty[b, best_n, gj, gi] = gy - gy.floor() + # Width and height + tw[b, best_n, gj, gi] = torch.log(gw / anchors[best_n][:, 0] + 1e-16) + th[b, best_n, gj, gi] = torch.log(gh / anchors[best_n][:, 1] + 1e-16) + # One-hot encoding of label + tcls[b, best_n, gj, gi, target_labels] = 1 + # Compute label correctness and iou at best anchor + class_mask[b, best_n, gj, gi] = (pred_cls[b, best_n, gj, gi].argmax(-1) == target_labels).float() + iou_scores[b, best_n, gj, gi] = bbox_iou(pred_boxes[b, best_n, gj, gi], target_boxes, x1y1x2y2=False) + + tconf = obj_mask.float() + return iou_scores, class_mask, obj_mask, noobj_mask, tx, ty, tw, th, tcls, tconf diff --git a/Spider/Chapter09_代理的使用/__init__.py b/Spider/Chapter09_代理的使用/__init__.py new file mode 100644 index 0000000..3c90a3a --- /dev/null +++ b/Spider/Chapter09_代理的使用/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/13 19:12 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/付费代理/__init__.py b/Spider/Chapter09_代理的使用/付费代理/__init__.py new file mode 100644 index 0000000..faef866 --- /dev/null +++ b/Spider/Chapter09_代理的使用/付费代理/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 16:39 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/付费代理/ip.json b/Spider/Chapter09_代理的使用/付费代理/ip.json new file mode 100644 index 0000000..770a66a --- /dev/null +++ b/Spider/Chapter09_代理的使用/付费代理/ip.json @@ -0,0 +1,21 @@ +{ + "code": 0, + "msg": "", + "data": { + "count": 10, + "dedup_count": 10, + "order_left_count": 990, + "proxy_list": [ + "124.172.117.189:19812", + "219.133.31.120:26947", + "183.237.194.145:28436", + "183.62.172.50:23485", + "163.125.157.243:17503", + "183.57.42.79:26483", + "202.103.150.70:17251", + "182.254.129.124:15395", + "58.251.132.181:20659", + "112.95.241.76:21948" + ] + } +} \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/付费代理/test.py b/Spider/Chapter09_代理的使用/付费代理/test.py new file mode 100644 index 0000000..9bf34d3 --- /dev/null +++ b/Spider/Chapter09_代理的使用/付费代理/test.py @@ -0,0 +1,45 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 16:40 +@Usage : +@Desc : +''' + +import requests +import json + +PROXY_API = 'https://dps.kdlapi.com/api/getdps/?secret_id=oimi28znnx51x79f3r0d&num=10&signature=25zjft23etaeswom3ipa56bsyqnne347&pt=1&format=json&sep=2' + + +def get_proxies(): + response = requests.get(PROXY_API) + res = json.loads(response.text) + return res['data']['proxy_list'] + + +def test_proxies(): + proxies = get_proxies() + # 注意这里要用户名和密码 在订单中心可以看https://www.kuaidaili.com/uc/dps/?orderid=930254289411869 + auth = "d2118699212:bxb0p3l8" + for proxy in proxies: + proxy = proxy.strip() + print(f"using proxy {proxy}") + p = { + 'http': f'http://{auth}@{proxy}', + 'https': f'http://{auth}@{proxy}', + + } + try: + requests.Request() + response = requests.get('http://www.httpbin.org/ip', proxies=p) + # response = requests.get('http://www.baidu.com', proxies=p) + print(response.text) + except requests.ConnectionError as e: + print(e) + print(f"proxy {proxy} is invalid") + + +if __name__ == '__main__': + test_proxies() diff --git a/Spider/Chapter09_代理的使用/代理反爬实战/__init__.py b/Spider/Chapter09_代理的使用/代理反爬实战/__init__.py new file mode 100644 index 0000000..e6578a0 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理反爬实战/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 19:09 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理反爬实战/core/__init__.py b/Spider/Chapter09_代理的使用/代理反爬实战/core/__init__.py new file mode 100644 index 0000000..7da6ace --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理反爬实战/core/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 19:20 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理反爬实战/core/config.py b/Spider/Chapter09_代理的使用/代理反爬实战/core/config.py new file mode 100644 index 0000000..f1b3380 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理反爬实战/core/config.py @@ -0,0 +1,31 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 19:22 +@Usage : +@Desc : +''' + +from environs import Env + +env = Env() +env.read_env() + +REDIS_HOST = env.str('REDIS_HOST', '192.168.118.202') + +REDIS_PORT = env.int('REDIS_PORT', 6379) + +REDIS_PASSWORD = env.str('REDIS_PASSWORD', None) + +REDIS_KEY = env.str('REDIS_KEY', 'antispider5') + +PROXY_POOL_URL = env.str('PROXY_POOL_URL', 'http://127.0.0.1:5555/random') + +IS_AUTH_PROXY = env.bool('IS_AUTH_PROXY', True) + +TIMEOUT = env.int('TIMEOUT', 10) + +MAX_FAILED_TIME = env.int('MAX_FAILED_TIME', 20) + +VALID_STATUSES = env.list('VALID_STATUSES', [200]) diff --git a/Spider/Chapter09_代理的使用/代理反爬实战/core/db.py b/Spider/Chapter09_代理的使用/代理反爬实战/core/db.py new file mode 100644 index 0000000..824f1a9 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理反爬实战/core/db.py @@ -0,0 +1,48 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 19:26 +@Usage : +@Desc : +''' + +from redis import StrictRedis +from core.config import * +from pickle import dumps, loads +from core.request import MovieRequest + +# Request对象不能直接存取,可以通过pickle的dumps和loads进行序列化和反序列化 +class RedisQueue(): + def __init__(self): + """ + init redis connection + """ + self.db = StrictRedis( + host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWORD) + + def add(self, request): + """ + add request to queue + :param request: request + :param fail_time: fail times + :return: result + """ + if isinstance(request, MovieRequest): + return self.db.rpush(REDIS_KEY, dumps(request)) + return False + + def pop(self): + """ + get next request + :return: Request or None + """ + if self.db.llen(REDIS_KEY): + return loads(self.db.lpop(REDIS_KEY)) + return False + + def clear(self): + self.db.delete(REDIS_KEY) + + def empty(self): + return self.db.llen(REDIS_KEY) == 0 \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理反爬实战/core/request.py b/Spider/Chapter09_代理的使用/代理反爬实战/core/request.py new file mode 100644 index 0000000..f671b1f --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理反爬实战/core/request.py @@ -0,0 +1,20 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 19:21 +@Usage : +@Desc : +''' + +from core.config import * +from requests import Request + + +class MovieRequest(Request): + def __init__(self, url, callback, method='GET', headers=None, fail_time=0, timeout=TIMEOUT): + Request.__init__(self, method, url, headers) + # 增加几个参数,分别代表回调函数,失败次数,和超时时间 + self.callback = callback + self.fail_time = fail_time + self.timeout = timeout diff --git a/Spider/Chapter09_代理的使用/代理反爬实战/core/spider.py b/Spider/Chapter09_代理的使用/代理反爬实战/core/spider.py new file mode 100644 index 0000000..cf9d92c --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理反爬实战/core/spider.py @@ -0,0 +1,192 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 19:34 +@Usage : 实际爬取 依赖于之前代理池的运行 +@Desc : +''' + +import re +import requests +from urllib.parse import urljoin +from requests import Session +from requests.exceptions import RequestException +from core.config import * +from core.db import RedisQueue +from core.request import MovieRequest +from pyquery import PyQuery as pq +from loguru import logger + +BASE_URL = 'https://antispider5.scrape.center/' +HEADERS = { + 'User-Agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_12_3) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36' +} + + +class Spider(): + session = Session() + queue = RedisQueue() + + @logger.catch + def get_proxy(self): + """ + get proxy from proxypool + :return: proxy + """ + response = requests.get(PROXY_POOL_URL) + if response.status_code == 200: + logger.debug(f'get proxy {response.text}') + return response.text + + @logger.catch + def get_proxy_safe(self): + """ + get proxy from proxypool + :return: proxy + """ + response = requests.get(PROXY_POOL_URL) + if response.status_code == 200: + logger.debug(f'get proxy {response.text}') + return response.text + + def start(self): + """ + start request + """ + self.session.headers.update(HEADERS) + start_url = BASE_URL + request = MovieRequest( + url=start_url, callback=self.parse_index) + # schedule first request + self.queue.add(request) + + def parse_index(self, response): + """ + parse index page + :param response: response + :return: new request + """ + doc = pq(response.text) + + # request for detail + items = doc('.item .name').items() + for item in items: + detail_url = urljoin(BASE_URL, item.attr('href')) + request = MovieRequest( + url=detail_url, callback=self.parse_detail) + yield request + + # request for next page + next_href = doc('.next').attr('href') + if next_href: + next_url = urljoin(BASE_URL, next_href) + request = MovieRequest( + url=next_url, callback=self.parse_index) + yield request + + def parse_detail(self, response): + """ + parse detail + :param response: response of detail + :return: data + """ + doc = pq(response.text) + cover = doc('img.cover').attr('src') + name = doc('a > h2').text() + categories = [item.text() + for item in doc('.categories button span').items()] + published_at = doc('.info:contains(上映)').text() + published_at = re.search('(\d{4}-\d{2}-\d{2})', published_at).group(1) \ + if published_at and re.search('\d{4}-\d{2}-\d{2}', published_at) else None + drama = doc('.drama p').text() + score = doc('p.score').text() + score = float(score) if score else None + yield { + 'cover': cover, + 'name': name, + 'categories': categories, + 'published_at': published_at, + 'drama': drama, + 'score': score + } + + def request(self, request): + """ + execute request + :param request: weixin request + :return: response + """ + try: + proxy = self.get_proxy() + logger.debug(f'get proxy {proxy}') + proxies = None + auth = "d2118699212:bxb0p3l8" + if proxy: + if IS_AUTH_PROXY: + proxies = { + 'http': f'http://{auth}@{proxy}', + 'https': f'http://{auth}@{proxy}', + } + else: + proxies = { + 'http': 'http://' + proxy, + 'https': 'https://' + proxy + } + return self.session.send(request.prepare(), + timeout=request.timeout, + proxies=proxies) + except RequestException: + logger.exception(f'requesting {request.url} failed') + + def error(self, request): + """ + error handling + :param request: request + :return: + """ + request.fail_time = request.fail_time + 1 + logger.debug( + f'request of {request.url} failed {request.fail_time} times') + if request.fail_time < MAX_FAILED_TIME: + self.queue.add(request) + + def schedule(self): + """ + schedule request + :return: + """ + # 从池子里取,然后不断爬取 + while not self.queue.empty(): + request = self.queue.pop() + callback = request.callback + logger.debug(f'executing request {request.url}') + response = self.request(request) + logger.debug(f'response status {response} of {request.url}') + if not response or not response.status_code in VALID_STATUSES: + self.error(request) + continue + results = list(callback(response)) + if not results: + self.error(request) + continue + for result in results: + if isinstance(result, MovieRequest): + logger.debug(f'generated new request {result.url}') + self.queue.add(result) + if isinstance(result, dict): + # 到这里就证明是爬取成功了,可以保存之类的了 + logger.debug(f'scraped new data {result}') + + def run(self): + """ + run + :return: + """ + self.start() + self.schedule() + + +if __name__ == '__main__': + spider = Spider() + spider.run() diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/.dockerignore b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/.dockerignore new file mode 100644 index 0000000..3eab792 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/.dockerignore @@ -0,0 +1,135 @@ +# Created by .ignore support plugin (hsz.mobi) +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +proxypool/.env +.DS_Store +.vscode \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/.gitignore b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/.gitignore new file mode 100644 index 0000000..16a7490 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/.gitignore @@ -0,0 +1,7 @@ +*.vscode +*.pyc +*.db +venv +/.idea +*.log +.DS_Store \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/Dockerfile b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/Dockerfile new file mode 100644 index 0000000..c5ca544 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/Dockerfile @@ -0,0 +1,18 @@ +FROM python:3.7-alpine AS build +COPY requirements.txt . +RUN apk update &&\ + apk add --no-cache gcc g++ libffi-dev openssl-dev libxml2-dev libxslt-dev build-base musl-dev &&\ + pip install -U pip &&\ + pip install --timeout 30 --user --no-cache-dir --no-warn-script-location -r requirements.txt + +FROM python:3.7-alpine +ENV APP_ENV=prod +ENV LOCAL_PKG="/root/.local" +COPY --from=build ${LOCAL_PKG} ${LOCAL_PKG} +RUN apk update && apk add --no-cache libffi-dev openssl-dev libxslt-dev &&\ + ln -sf ${LOCAL_PKG}/bin/* /usr/local/bin/ +WORKDIR /app +COPY . . +EXPOSE 5555 +VOLUME ["/app/proxypool/crawlers/private"] +ENTRYPOINT ["supervisord", "-c", "supervisord.conf"] \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/LICENSE b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/LICENSE new file mode 100644 index 0000000..89052ac --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2020 Germey + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/README.md b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/README.md new file mode 100644 index 0000000..d01d7a0 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/README.md @@ -0,0 +1,359 @@ +# ProxyPool + +![build](https://github.com/Python3WebSpider/ProxyPool/workflows/build/badge.svg) +![deploy](https://github.com/Python3WebSpider/ProxyPool/workflows/deploy/badge.svg) +![](https://img.shields.io/badge/python-3.6%2B-brightgreen) +![Docker Pulls](https://img.shields.io/docker/pulls/germey/proxypool) + +简易高效的代理池,提供如下功能: + +- 定时抓取免费代理网站,简易可扩展。 +- 使用 Redis 对代理进行存储并对代理可用性进行排序。 +- 定时测试和筛选,剔除不可用代理,留下可用代理。 +- 提供代理 API,随机取用测试通过的可用代理。 + +代理池原理解析可见「[如何搭建一个高效的代理池](https://cuiqingcai.com/7048.html)」,建议使用之前阅读。 + +## 使用准备 + +首先当然是克隆代码并进入 ProxyPool 文件夹: + +``` +git clone https://github.com/Python3WebSpider/ProxyPool.git +cd ProxyPool +``` + +然后选用下面 Docker 和常规方式任意一个执行即可。 + +## 使用要求 + +可以通过两种方式来运行代理池,一种方式是使用 Docker(推荐),另一种方式是常规方式运行,要求如下: + +### Docker + +如果使用 Docker,则需要安装如下环境: + +- Docker +- Docker-Compose + +安装方法自行搜索即可。 + +官方 Docker Hub 镜像:[germey/proxypool](https://hub.docker.com/r/germey/proxypool) + +### 常规方式 + +常规方式要求有 Python 环境、Redis 环境,具体要求如下: + +- Python>=3.6 +- Redis + +## Docker 运行 + +如果安装好了 Docker 和 Docker-Compose,只需要一条命令即可运行。 + +```shell script +docker-compose up +``` + +运行结果类似如下: + +``` +redis | 1:M 19 Feb 2020 17:09:43.940 * DB loaded from disk: 0.000 seconds +redis | 1:M 19 Feb 2020 17:09:43.940 * Ready to accept connections +proxypool | 2020-02-19 17:09:44,200 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. +proxypool | 2020-02-19 17:09:44,203 INFO supervisord started with pid 1 +proxypool | 2020-02-19 17:09:45,209 INFO spawned: 'getter' with pid 10 +proxypool | 2020-02-19 17:09:45,212 INFO spawned: 'server' with pid 11 +proxypool | 2020-02-19 17:09:45,216 INFO spawned: 'tester' with pid 12 +proxypool | 2020-02-19 17:09:46,596 INFO success: getter entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +proxypool | 2020-02-19 17:09:46,596 INFO success: server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +proxypool | 2020-02-19 17:09:46,596 INFO success: tester entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +``` + +可以看到 Redis、Getter、Server、Tester 都已经启动成功。 + +这时候访问 [http://localhost:5555/random](http://localhost:5555/random) 即可获取一个随机可用代理。 + +当然你也可以选择自己 Build,直接运行如下命令即可: + +``` +docker-compose -f build.yaml up +``` + +如果下载速度特别慢,可以自行修改 Dockerfile,修改: + +```diff +- RUN pip install -r requirements.txt ++ RUN pip install -r requirements.txt -i https://pypi.douban.com/simple +``` + +## 常规方式运行 + +如果不使用 Docker 运行,配置好 Python、Redis 环境之后也可运行,步骤如下。 + +### 安装和配置 Redis + +本地安装 Redis、Docker 启动 Redis、远程 Redis 都是可以的,只要能正常连接使用即可。 + +首先可以需要一下环境变量,代理池会通过环境变量读取这些值。 + +设置 Redis 的环境变量有两种方式,一种是分别设置 host、port、password,另一种是设置连接字符串,设置方法分别如下: + +设置 host、port、password,如果 password 为空可以设置为空字符串,示例如下: + +```shell script +export PROXYPOOL_REDIS_HOST='localhost' +export PROXYPOOL_REDIS_PORT=6379 +export PROXYPOOL_REDIS_PASSWORD='' +export PROXYPOOL_REDIS_DB=0 +``` + +或者只设置连接字符串: + +```shell script +export PROXYPOOL_REDIS_CONNECTION_STRING='redis://localhost' +``` + +这里连接字符串的格式需要符合 `redis://[:password@]host[:port][/database]` 的格式, +中括号参数可以省略,port 默认是 6379,database 默认是 0,密码默认为空。 + +以上两种设置任选其一即可。 + +### 安装依赖包 + +这里强烈推荐使用 [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands) +或 [virtualenv](https://virtualenv.pypa.io/en/latest/user_guide.html) 创建虚拟环境,Python 版本不低于 3.6。 + +然后 pip 安装依赖即可: + +```shell script +pip3 install -r requirements.txt +``` + +### 运行代理池 + +两种方式运行代理池,一种是 Tester、Getter、Server 全部运行,另一种是按需分别运行。 + +一般来说可以选择全部运行,命令如下: + +```shell script +python3 run.py +``` + +运行之后会启动 Tester、Getter、Server,这时访问 [http://localhost:5555/random](http://localhost:5555/random) 即可获取一个随机可用代理。 + +或者如果你弄清楚了代理池的架构,可以按需分别运行,命令如下: + +```shell script +python3 run.py --processor getter +python3 run.py --processor tester +python3 run.py --processor server +``` + +这里 processor 可以指定运行 Tester、Getter 还是 Server。 + +## 使用 + +成功运行之后可以通过 [http://localhost:5555/random](http://localhost:5555/random) 获取一个随机可用代理。 + +可以用程序对接实现,下面的示例展示了获取代理并爬取网页的过程: + +```python +import requests + +proxypool_url = 'http://127.0.0.1:5555/random' +target_url = 'http://httpbin.org/get' + +def get_random_proxy(): + """ + get random proxy from proxypool + :return: proxy + """ + return requests.get(proxypool_url).text.strip() + +def crawl(url, proxy): + """ + use proxy to crawl page + :param url: page url + :param proxy: proxy, such as 8.8.8.8:8888 + :return: html + """ + proxies = {'http': 'http://' + proxy} + return requests.get(url, proxies=proxies).text + + +def main(): + """ + main method, entry point + :return: none + """ + proxy = get_random_proxy() + print('get random proxy', proxy) + html = crawl(target_url, proxy) + print(html) + +if __name__ == '__main__': + main() +``` + +运行结果如下: + +``` +get random proxy 116.196.115.209:8080 +{ + "args": {}, + "headers": { + "Accept": "*/*", + "Accept-Encoding": "gzip, deflate", + "Host": "httpbin.org", + "User-Agent": "python-requests/2.22.0", + "X-Amzn-Trace-Id": "Root=1-5e4d7140-662d9053c0a2e513c7278364" + }, + "origin": "116.196.115.209", + "url": "https://httpbin.org/get" +} +``` + +可以看到成功获取了代理,并请求 httpbin.org 验证了代理的可用性。 + +## 可配置项 + +代理池可以通过设置环境变量来配置一些参数。 + +### 开关 + +- ENABLE_TESTER:允许 Tester 启动,默认 true +- ENABLE_GETTER:允许 Getter 启动,默认 true +- ENABLE_SERVER:运行 Server 启动,默认 true + +### 环境 + +- APP_ENV:运行环境,可以设置 dev、test、prod,即开发、测试、生产环境,默认 dev +- APP_DEBUG:调试模式,可以设置 true 或 false,默认 true +- APP_PROD_METHOD: 正式环境启动应用方式,默认是`gevent`, + 可选:`tornado`,`meinheld`(分别需要安装 tornado 或 meinheld 模块) + +### Redis 连接 + +- PROXYPOOL_REDIS_HOST / REDIS_HOST:Redis 的 Host,其中 PROXYPOOL_REDIS_HOST 会覆盖 REDIS_HOST 的值。 +- PROXYPOOL_REDIS_PORT / REDIS_PORT:Redis 的端口,其中 PROXYPOOL_REDIS_PORT 会覆盖 REDIS_PORT 的值。 +- PROXYPOOL_REDIS_PASSWORD / REDIS_PASSWORD:Redis 的密码,其中 PROXYPOOL_REDIS_PASSWORD 会覆盖 REDIS_PASSWORD 的值。 +- PROXYPOOL_REDIS_DB / REDIS_DB:Redis 的数据库索引,如 0、1,其中 PROXYPOOL_REDIS_DB 会覆盖 REDIS_DB 的值。 +- PROXYPOOL_REDIS_CONNECTION_STRING / REDIS_CONNECTION_STRING:Redis 连接字符串,其中 PROXYPOOL_REDIS_CONNECTION_STRING 会覆盖 REDIS_CONNECTION_STRING 的值。 +- PROXYPOOL_REDIS_KEY / REDIS_KEY:Redis 储存代理使用字典的名称,其中 PROXYPOOL_REDIS_KEY 会覆盖 REDIS_KEY 的值。 + +### 处理器 + +- CYCLE_TESTER:Tester 运行周期,即间隔多久运行一次测试,默认 20 秒 +- CYCLE_GETTER:Getter 运行周期,即间隔多久运行一次代理获取,默认 100 秒 +- TEST_URL:测试 URL,默认百度 +- TEST_TIMEOUT:测试超时时间,默认 10 秒 +- TEST_BATCH:批量测试数量,默认 20 个代理 +- TEST_VALID_STATUS:测试有效的状态码 +- API_HOST:代理 Server 运行 Host,默认 0.0.0.0 +- API_PORT:代理 Server 运行端口,默认 5555 +- API_THREADED:代理 Server 是否使用多线程,默认 true + +### 日志 + +- LOG_DIR:日志相对路径 +- LOG_RUNTIME_FILE:运行日志文件名称 +- LOG_ERROR_FILE:错误日志文件名称 +- LOG_ROTATION: 日志记录周转周期或大小,默认 500MB,见 [loguru - rotation](https://github.com/Delgan/loguru#easier-file-logging-with-rotation--retention--compression) +- LOG_RETENTION: 日志保留日期,默认 7 天,见 [loguru - retention](https://github.com/Delgan/loguru#easier-file-logging-with-rotation--retention--compression) +- ENABLE_LOG_FILE:是否输出 log 文件,默认 true,如果设置为 false,那么 ENABLE_LOG_RUNTIME_FILE 和 ENABLE_LOG_ERROR_FILE 都不会生效 +- ENABLE_LOG_RUNTIME_FILE:是否输出 runtime log 文件,默认 true +- ENABLE_LOG_ERROR_FILE:是否输出 error log 文件,默认 true + +以上内容均可使用环境变量配置,即在运行前设置对应环境变量值即可,如更改测试地址和 Redis 键名: + +```shell script +export TEST_URL=http://weibo.cn +export REDIS_KEY=proxies:weibo +``` + +即可构建一个专属于微博的代理池,有效的代理都是可以爬取微博的。 + +如果使用 Docker-Compose 启动代理池,则需要在 docker-compose.yml 文件里面指定环境变量,如: + +```yaml +version: "3" +services: + redis: + image: redis:alpine + container_name: redis + command: redis-server + ports: + - "6379:6379" + restart: always + proxypool: + build: . + image: "germey/proxypool" + container_name: proxypool + ports: + - "5555:5555" + restart: always + environment: + REDIS_HOST: redis + TEST_URL: http://weibo.cn + REDIS_KEY: proxies:weibo +``` + +## 扩展代理爬虫 + +代理的爬虫均放置在 proxypool/crawlers 文件夹下,目前对接了有限几个代理的爬虫。 + +若扩展一个爬虫,只需要在 crawlers 文件夹下新建一个 Python 文件声明一个 Class 即可。 + +写法规范如下: + +```python +from pyquery import PyQuery as pq +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler + +BASE_URL = 'http://www.664ip.cn/{page}.html' +MAX_PAGE = 5 + +class Daili66Crawler(BaseCrawler): + """ + daili66 crawler, http://www.66ip.cn/1.html + """ + urls = [BASE_URL.format(page=page) for page in range(1, MAX_PAGE + 1)] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + trs = doc('.containerbox table tr:gt(0)').items() + for tr in trs: + host = tr.find('td:nth-child(1)').text() + port = int(tr.find('td:nth-child(2)').text()) + yield Proxy(host=host, port=port) +``` + +在这里只需要定义一个 Crawler 继承 BaseCrawler 即可,然后定义好 urls 变量和 parse 方法即可。 + +- urls 变量即为爬取的代理网站网址列表,可以用程序定义也可写成固定内容。 +- parse 方法接收一个参数即 html,代理网址的 html,在 parse 方法里只需要写好 html 的解析,解析出 host 和 port,并构建 Proxy 对象 yield 返回即可。 + +网页的爬取不需要实现,BaseCrawler 已经有了默认实现,如需更改爬取方式,重写 crawl 方法即可。 + +欢迎大家多多发 Pull Request 贡献 Crawler,使其代理源更丰富强大起来。 + +## 部署 + +本项目提供了 Kubernetes 部署脚本,如需部署到 Kubernetes,请参考 [kubernetes](./kubernetes)。 + +## 待开发 + +- [ ] 前端页面管理 +- [ ] 使用情况统计分析 + +如有一起开发的兴趣可以在 Issue 留言,非常感谢! + +## LICENSE + +MIT diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/build.yaml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/build.yaml new file mode 100644 index 0000000..74b2fd0 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/build.yaml @@ -0,0 +1,18 @@ +version: "3" +services: + redis4proxypool: + image: redis:alpine + container_name: redis4proxypool + ports: + - "6374:6379" + proxypool: + build: . + image: "germey/proxypool:master" + container_name: proxypool + ports: + - "5555:5555" + restart: always + # volumes: + # - proxypool/crawlers/private:/app/proxypool/crawlers/private + environment: + PROXYPOOL_REDIS_CONNECTION_STRING: redis://@redis4proxypool:6379/0 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/docker-compose.yml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/docker-compose.yml new file mode 100644 index 0000000..cf367f4 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/docker-compose.yml @@ -0,0 +1,18 @@ +version: "3" +services: + redis4proxypool: + image: redis:alpine + container_name: redis4proxypool + # ports: + # - "6374:6379" + proxypool: + image: "germey/proxypool:master" + container_name: proxypool + ports: + - "5555:5555" + restart: always + # volumes: + # - proxypool/crawlers/private:/app/proxypool/crawlers/private + environment: + PROXYPOOL_REDIS_HOST: redis4proxypool + diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/examples/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/examples/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/examples/usage.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/examples/usage.py new file mode 100644 index 0000000..bc699ba --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/examples/usage.py @@ -0,0 +1,39 @@ +import requests + + +proxypool_url = 'http://127.0.0.1:5555/random' +target_url = 'https://antispider5.scrape.center/' + + +def get_random_proxy(): + """ + get random proxy from proxypool + :return: proxy + """ + return requests.get(proxypool_url).text.strip() + + +def crawl(url, proxy): + """ + use proxy to crawl page + :param url: page url + :param proxy: proxy, such as 8.8.8.8:8888 + :return: html + """ + proxies = {'http': 'http://' + proxy} + return requests.get(url, proxies=proxies).text + + +def main(): + """ + main method, entry point + :return: none + """ + proxy = get_random_proxy() + print('get random proxy', proxy) + html = crawl(target_url, proxy) + print(html) + + +if __name__ == '__main__': + main() diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/examples/usage2.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/examples/usage2.py new file mode 100644 index 0000000..918c5eb --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/examples/usage2.py @@ -0,0 +1,95 @@ +# -*- coding: UTF-8 -*- + +''' +''' +import requests +import time +import threading +import urllib3 +from fake_headers import Headers +import uuid +from geolite2 import geolite2 +ips = [] + +# 爬数据的线程类 + +def getChinaIP(ip='127.0.0.1'): + reader = geolite2.reader() + ip_info = reader.get(ip) + geolite2.close() + print(ip_info) + return True if ip_info['country']['iso_code'] == 'CN' else False + + + +class CrawlThread(threading.Thread): + def __init__(self, proxyip): + super(CrawlThread, self).__init__() + self.proxyip = proxyip + + def run(self): + # 开始计时 + pure_ip_address = self.proxyip.split(':')[0] + # 验证IP归属 + if not getChinaIP(pure_ip_address): + # pass + raise ValueError('不是有效IP') + # + start = time.time() + # 消除关闭证书验证的警告 + urllib3.disable_warnings() + headers = Headers(headers=True).generate() + headers['Referer'] = 'http://bb.cf08tp.cn/Home/index.php?m=Index&a=index&id=2676' + headers['Pragma'] = 'no-cache' + headers['Host'] = 'bb.cf08tp.cn' + headers['x-forward-for'] = pure_ip_address + headers['Cookie'] = 'PHPSESSID={}'.format( + ''.join(str(uuid.uuid1()).split('-'))) + print(headers) + html = requests.get(headers=headers, url=targetUrl, proxies={ + "http": 'http://' + self.proxyip, "https": 'https://' + self.proxyip}, verify=False, timeout=2).content.decode() + # 结束计时 + end = time.time() + # 输出内容 + print(threading.current_thread().getName() + "使用代理IP, 耗时 " + str(end - start) + + "毫秒 " + self.proxyip + " 获取到如下HTML内容:\n" + html + "\n*************") + +# 获取代理IP的线程类 + + +class GetIpThread(threading.Thread): + def __init__(self, fetchSecond): + super(GetIpThread, self).__init__() + self.fetchSecond = fetchSecond + + def run(self): + global ips + while True: + # 获取IP列表 + res = requests.get(apiUrl).content.decode() + # 按照\n分割获取到的IP + ips = res.split('\n') + # 利用每一个IP + for proxyip in ips: + if proxyip.strip(): + # 开启一个线程 + # CrawlThread(proxyip).start() + try: + CrawlThread(proxyip).run() + time.sleep(1.5) + except Exception as e: + print(e) + # 休眠 + time.sleep(len(ips) /self.fetchSecond ) + + +if __name__ == '__main__': + # 获取IP的API接口 + # apiUrl = "http://127.0.0.1:5555/all" + apiUrl = "http://127.0.0.1:5555/random" + # 要抓取的目标网站地址 + targetUrl = "http://bb.cf08tp.cn/Home/index.php?m=Index&a=vote&vid=335688&id=2676&tp=" + # targetUrl = 'http://bb.cf08tp.cn/Home/index.php?m=Index&a=vote&vid=335608&id=2676&tp=' + fetchSecond = 5 + # 开始自动获取IP + GetIpThread(fetchSecond).start() diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/.helmignore b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/.helmignore new file mode 100644 index 0000000..9716c30 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/.helmignore @@ -0,0 +1,24 @@ +# Patterns to ignore when building packages. +# This supports shell glob matching, relative path matching, and +# negation (prefixed with !). Only one pattern per line. +.DS_Store +# Common VCS dirs +.git/ +.gitignore +.bzr/ +.bzrignore +.hg/ +.hgignore +.svn/ +# Common backup files +*.swp +*.bak +*.tmp +*.orig +*~ +# Various IDEs +.project +.idea/ +*.tmproj +.vscode/ +image/ \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/Chart.yaml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/Chart.yaml new file mode 100644 index 0000000..58db2bc --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/Chart.yaml @@ -0,0 +1,27 @@ +apiVersion: v2 +name: proxypool +description: A Efficient Proxy Pool + +# A chart can be either an 'application' or a 'library' chart. +# +# Application charts are a collection of templates that can be packaged into versioned archives +# to be deployed. +# +# Library charts provide useful utilities or functions for the chart developer. They're included as +# a dependency of application charts to inject those utilities and functions into the rendering +# pipeline. Library charts do not define any templates and therefore cannot be deployed. +type: application + +# Keywords about this application. +keywords: + - proxypool + +# This is the chart version. This version number should be incremented each time you make changes +# to the chart and its templates, including the app version. +# Versions are expected to follow Semantic Versioning (https://semver.org/) +version: 0.1.0 + +# This is the version number of the application being deployed. This version number should be +# incremented each time you make changes to the application. Versions are not expected to +# follow Semantic Versioning. They should reflect the version the application is using. +appVersion: 1.16.0 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/README.md b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/README.md new file mode 100644 index 0000000..327880d --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/README.md @@ -0,0 +1,42 @@ +# Kubernetes 部署 + +这是用来快速部署本代理池的 Helm Charts。 + +首先需要有一个 Kubernetes 集群,其次需要安装 Helm,确保 helm 命令可以正常运行。 + +安装参考: + +- Kubernetes:[https://setup.scrape.center/kubernetes](https://setup.scrape.center/kubernetes)。 +- Helm: [https://setup.scrape.center/helm](https://setup.scrape.center/helm)。 + +## 安装 + +安装直接使用 helm 命令在本文件夹运行即可,使用 `-n` 可以制定 NameSpace。 + +```shell +helm install proxypool-app . -n scrape +``` + +其中 proxypool-app 就是应用的名字,可以任意取名,它会用作代理池 Deplyment 的名称。 + +如果需要覆盖变量,可以修改 values.yaml 文件,执行如下命令安装: + +```shell +helm install proxypool-app . -f values.yaml -n scrape +``` + +## 更新 + +如果需要更新配置,可以修改 values.yaml 文件,执行如下命令更新版本: + +```shell +helm upgrade proxypool-app . -f values.yaml -n scrape +``` + +## 卸载 + +如果不想使用了,可以只用 uninstall 命令卸载: + +```shell +helm uninstall proxypool-app -n scrape +``` diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/_helpers.tpl b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/_helpers.tpl new file mode 100644 index 0000000..31911df --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/_helpers.tpl @@ -0,0 +1,53 @@ +{{/* vim: set filetype=mustache: */}} +{{/* +Expand the name of the chart. +*/}} +{{- define "proxypool.name" -}} +{{- default .Chart.Name .Values.name | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Create a default fully qualified app name. +We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec). +If release name contains chart name it will be used as a full name. +*/}} +{{- define "proxypool.fullname" -}} +{{- if .Values.fullname }} +{{- .Values.fullname | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- $name := default .Chart.Name .Values.name }} +{{- if contains $name .Release.Name }} +{{- .Release.Name | trunc 63 | trimSuffix "-" }} +{{- else }} +{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }} +{{- end }} +{{- end }} +{{- end }} + + +{{/* +Create chart name and version as used by the chart label. +*/}} +{{- define "proxypool.chart" -}} +{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }} +{{- end }} + +{{/* +Common labels +*/}} +{{- define "proxypool.labels" -}} +helm.sh/chart: {{ include "proxypool.chart" . }} +{{ include "proxypool.selectorLabels" . }} +{{- if .Chart.AppVersion }} +app.kubernetes.io/version: {{ .Chart.AppVersion | quote }} +{{- end }} +app.kubernetes.io/managed-by: {{ .Release.Service }} +{{- end }} + +{{/* +Selector labels +*/}} +{{- define "proxypool.selectorLabels" -}} +app.kubernetes.io/name: {{ include "proxypool.fullname" . }} +app.kubernetes.io/instance: {{ .Release.Name }} +{{- end }} diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-deployment.yaml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-deployment.yaml new file mode 100644 index 0000000..a12854d --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-deployment.yaml @@ -0,0 +1,37 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + name: {{ include "proxypool.fullname" . }} + labels: + {{- include "proxypool.labels" . | nindent 4 }} +spec: + replicas: {{ .Values.deployment.replicas }} + revisionHistoryLimit: {{ .Values.deployment.revisionHistoryLimit }} + selector: + matchLabels: + {{- include "proxypool.labels" . | nindent 8 }} + template: + metadata: + labels: + {{- include "proxypool.labels" . | nindent 8 }} + spec: + restartPolicy: {{ .Values.deployment.restartPolicy }} + containers: + - name: {{ include "proxypool.fullname" . }} + image: {{ .Values.deployment.image }} + ports: + - containerPort: 5555 + protocol: TCP + imagePullPolicy: {{ .Values.deployment.imagePullPolicy }} + livenessProbe: + httpGet: + path: /random + port: 5555 + initialDelaySeconds: 60 + periodSeconds: 5 + failureThreshold: 5 + timeoutSeconds: 10 + resources: + {{- toYaml .Values.deployment.resources | nindent 12 }} + env: + {{- toYaml .Values.deployment.env | nindent 12 }} diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-ingress.yaml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-ingress.yaml new file mode 100644 index 0000000..0706f5d --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-ingress.yaml @@ -0,0 +1,41 @@ +{{- if .Values.ingress.enabled -}} +{{- $fullName := include "proxypool.fullname" . -}} +{{- $svcPort := .Values.service.port -}} +{{- if semverCompare ">=1.14-0" .Capabilities.KubeVersion.GitVersion -}} +apiVersion: networking.k8s.io/v1beta1 +{{- else -}} +apiVersion: extensions/v1beta1 +{{- end }} +kind: Ingress +metadata: + name: {{ $fullName }} + labels: + {{- include "proxypool.labels" . | nindent 4 }} + {{- with .Values.ingress.annotations }} + annotations: + {{- toYaml . | nindent 4 }} + {{- end }} +spec: + {{- if .Values.ingress.tls }} + tls: + {{- range .Values.ingress.tls }} + - hosts: + {{- range .hosts }} + - {{ . | quote }} + {{- end }} + secretName: {{ .secretName }} + {{- end }} + {{- end }} + rules: + {{- range .Values.ingress.hosts }} + - host: {{ .host | quote }} + http: + paths: + {{- range .paths }} + - path: {{ . }} + backend: + serviceName: {{ $fullName }} + servicePort: {{ $svcPort }} + {{- end }} + {{- end }} + {{- end }} diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-service.yaml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-service.yaml new file mode 100644 index 0000000..3d4285b --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/proxypool-service.yaml @@ -0,0 +1,15 @@ +apiVersion: v1 +kind: Service +metadata: + name: {{ include "proxypool.fullname" . }} + labels: + {{- include "proxypool.labels" . | nindent 4 }} +spec: + type: {{ .Values.service.type }} + ports: + - port: {{ .Values.service.port }} + targetPort: 5555 + protocol: TCP + name: http + selector: + {{- include "proxypool.selectorLabels" . | nindent 4 }} diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/redis-deployment.yaml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/redis-deployment.yaml new file mode 100644 index 0000000..4acf435 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/redis-deployment.yaml @@ -0,0 +1,30 @@ +apiVersion: apps/v1 +kind: Deployment +metadata: + labels: + app: proxypool-redis + name: proxypool-redis +spec: + replicas: 1 + revisionHistoryLimit: 1 + selector: + matchLabels: + app: proxypool-redis + template: + metadata: + labels: + app: proxypool-redis + spec: + containers: + - image: redis:alpine + name: proxypool-redis + ports: + - containerPort: 6379 + resources: + limits: + memory: "100Mi" + cpu: "100m" + requests: + memory: "100Mi" + cpu: "100m" + restartPolicy: Always diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/redis-service.yaml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/redis-service.yaml new file mode 100644 index 0000000..5dbda55 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/templates/redis-service.yaml @@ -0,0 +1,13 @@ +apiVersion: v1 +kind: Service +metadata: + labels: + app: proxypool-redis + name: proxypool-redis +spec: + ports: + - name: "6379" + port: 6379 + targetPort: 6379 + selector: + app: proxypool-redis \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/values.yaml b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/values.yaml new file mode 100644 index 0000000..15b2537 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/kubernetes/values.yaml @@ -0,0 +1,39 @@ +name: proxypool +fullname: proxypool-app + +deployment: + image: germey/proxypool:master + imagePullPolicy: Always + restartPolicy: Always + revisionHistoryLimit: 2 + successfulJobsHistoryLimit: 1 + replicas: 1 + resources: + limits: + memory: "200Mi" + cpu: "80m" + requests: + memory: "200Mi" + cpu: "80m" + env: + - name: PROXYPOOL_REDIS_HOST + value: "proxypool-redis" + - name: PROXYPOOL_REDIS_PORT + value: "6379" + +service: + type: ClusterIP + port: 80 + +ingress: + enabled: true + annotations: + kubernetes.io/ingress.class: nginx + hosts: + - host: proxypool.scrape.center + paths: + - "/" + tls: + - secretName: tls-wildcard-scrape-center + hosts: + - proxypool.scrape.center diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/.gitignore b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/.gitignore new file mode 100644 index 0000000..9f26378 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/.gitignore @@ -0,0 +1,134 @@ +# Created by .ignore support plugin (hsz.mobi) +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +pip-wheel-metadata/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +.python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +.idea/ +*.log \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/__init__.py new file mode 100644 index 0000000..e68db8d --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/__init__.py @@ -0,0 +1,15 @@ +import pkgutil +from .base import BasePaidCrawler +import inspect + + +# load classes subclass of BaseCrawler +classes = [] +for loader, name, is_pkg in pkgutil.walk_packages(__path__): + module = loader.find_module(name).load_module(name) + for name, value in inspect.getmembers(module): + globals()[name] = value + if inspect.isclass(value) and issubclass(value, BasePaidCrawler) and value is not BasePaidCrawler \ + and not getattr(value, 'ignore', False): + classes.append(value) +__all__ = __ALL__ = classes diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/base.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/base.py new file mode 100644 index 0000000..995ea67 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/base.py @@ -0,0 +1,93 @@ +from retrying import RetryError, retry +import requests +from loguru import logger +from proxypool.setting import GET_TIMEOUT +from fake_headers import Headers +import time + +# 免费的节点 +class BaseCrawler(object): + urls = [] + + @retry(stop_max_attempt_number=3, retry_on_result=lambda x: x is None, wait_fixed=2000) + def fetch(self, url, **kwargs): + try: + headers = Headers(headers=True).generate() + kwargs.setdefault('timeout', GET_TIMEOUT) + kwargs.setdefault('verify', False) + kwargs.setdefault('headers', headers) + response = requests.get(url, **kwargs) + if response.status_code == 200: + response.encoding = 'utf-8' + return response.text + except (requests.ConnectionError, requests.ReadTimeout): + return + + def process(self, html, url): + """ + used for parse html + """ + for proxy in self.parse(html): + logger.info(f'fetched proxy {proxy.string()} from {url}') + yield proxy + + def crawl(self): + """ + crawl main method + """ + try: + for url in self.urls: + logger.info(f'fetching {url}') + html = self.fetch(url) + if not html: + continue + time.sleep(.5) + yield from self.process(html, url) + except RetryError: + logger.error( + f'crawler {self} crawled proxy unsuccessfully, ' + 'please check if target url is valid or network issue') + + +# 付费的节点 +class BasePaidCrawler(object): + urls = [] + + @retry(stop_max_attempt_number=3, retry_on_result=lambda x: x is None, wait_fixed=2000) + def fetch(self, url, **kwargs): + try: + headers = Headers(headers=True).generate() + kwargs.setdefault('timeout', GET_TIMEOUT) + kwargs.setdefault('verify', False) + kwargs.setdefault('headers', headers) + response = requests.get(url, **kwargs) + if response.status_code == 200: + response.encoding = 'utf-8' + return response.text + except (requests.ConnectionError, requests.ReadTimeout): + return + + def process(self, response, url): + """ + used for parse html + """ + for proxy in self.parse(response): + logger.info(f'fetched proxy {proxy.string()} from {url}') + yield proxy + + def crawl(self): + """ + crawl main method + """ + try: + for url in self.urls: + logger.info(f'fetching {url}') + response = self.fetch(url) + if not response: + continue + time.sleep(.5) + yield from self.process(response, url) + except RetryError: + logger.error( + f'crawler {self} crawled proxy unsuccessfully, ' + 'please check if target url is valid or network issue') diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/private/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/private/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/private/kuaidaili_paid.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/private/kuaidaili_paid.py new file mode 100644 index 0000000..dce213e --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/private/kuaidaili_paid.py @@ -0,0 +1,38 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 13:23 +@Usage : +@Desc : 付费的快代理 +''' + +from proxypool.crawlers.base import BasePaidCrawler +from proxypool.schemas.proxy import Proxy +import json + +BASE_URL = 'https://dps.kdlapi.com/api/getdps/?secret_id=oimi28znnx51x79f3r0d&num=10&signature=25zjft23etaeswom3ipa56bsyqnne347&pt=1&format=json&sep=1' + + +class KuaidailiPaidCrawler(BasePaidCrawler): + """ + kuaidaili crawler, https://www.kuaidaili.com/ + """ + urls = [BASE_URL] + + def parse(self, response): + """ + parse html file to get proxies + :return: + """ + response = json.loads(response) + for proxy in response["data"]["proxy_list"]: + ip = proxy.split(":")[0] + port = proxy.split(":")[1] + yield Proxy(host=ip, port=port) + + +if __name__ == '__main__': + crawler = KuaidailiPaidCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/daili66.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/daili66.py new file mode 100644 index 0000000..aec7ea6 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/daili66.py @@ -0,0 +1,32 @@ +from pyquery import PyQuery as pq +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler + + +BASE_URL = 'http://www.66ip.cn/{page}.html' +MAX_PAGE = 3 + + +class Daili66Crawler(BaseCrawler): + """ + daili66 crawler, http://www.66ip.cn/1.html + """ + urls = [BASE_URL.format(page=page) for page in range(1, MAX_PAGE + 1)] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + trs = doc('.containerbox table tr:gt(0)').items() + for tr in trs: + host = tr.find('td:nth-child(1)').text() + port = int(tr.find('td:nth-child(2)').text()) + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = Daili66Crawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/data5u.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/data5u.py new file mode 100644 index 0000000..62158c2 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/data5u.py @@ -0,0 +1,31 @@ +from pyquery import PyQuery as pq +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +from loguru import logger + +BASE_URL = 'http://www.data5u.com' + + +class Data5UCrawler(BaseCrawler): + """ + data5u crawler, http://www.data5u.com + """ + urls = [BASE_URL] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + items = doc('.wlist ul.l2').items() + for item in items: + host = item.find('span:first-child').text() + port = int(item.find('span:nth-child(2)').text()) + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = Data5UCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/docip.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/docip.py new file mode 100644 index 0000000..26a6f8a --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/docip.py @@ -0,0 +1,40 @@ +import time +from retrying import RetryError +from loguru import logger +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +import json + +BASE_URL = 'https://www.docip.net/data/free.json?t={date}' + + + +class DocipCrawler(BaseCrawler): + """ + Docip crawler, https://www.docip.net/data/free.json + """ + urls = [BASE_URL.format(date=time.strftime("%Y%m%d", time.localtime()))] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + try: + result = json.loads(html) + proxy_list = result['data'] + for proxy_item in proxy_list: + # TODO 这里的逻辑有变化,因为返回的ip变了 + ip_and_port =proxy_item['ip'] + host = ip_and_port.split(":")[0] + port = ip_and_port.split(":")[1] + yield Proxy(host=host, port=port) + except json.JSONDecodeError: + print("json.JSONDecodeError") + return + + +if __name__ == '__main__': + crawler = DocipCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/fatezero.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/fatezero.py new file mode 100644 index 0000000..681cf9e --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/fatezero.py @@ -0,0 +1,31 @@ +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +import re +import json +BASE_URL = 'http://proxylist.fatezero.org/proxy.list' + + +class FatezeroCrawler(BaseCrawler): + """ + Fatezero crawler,http://proxylist.fatezero.org + """ + urls = [BASE_URL] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + + hosts_ports = html.split('\n') + for addr in hosts_ports: + if(addr): + ip_address = json.loads(addr) + host = ip_address['host'] + port = ip_address['port'] + yield Proxy(host=host, port=port) + +if __name__ == '__main__': + crawler = FatezeroCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/geonodedaili.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/geonodedaili.py new file mode 100644 index 0000000..f71f16e --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/geonodedaili.py @@ -0,0 +1,71 @@ +import time +from retrying import RetryError +from loguru import logger +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +import json + +BASE_URL = 'https://proxylist.geonode.com/api/proxy-list?limit=500&page={page}&sort_by=lastChecked&sort_type=desc' +MAX_PAGE = 18 + + +class GeonodeCrawler(BaseCrawler): + """ + Geonode crawler, https://proxylist.geonode.com/ + """ + urls = [BASE_URL.format(page=page) for page in range(1, MAX_PAGE + 1)] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + try: + result = json.loads(html) + proxy_list = result['data'] + for proxy_item in proxy_list: + host = proxy_item['ip'] + port = proxy_item['port'] + yield Proxy(host=host, port=port) + except json.JSONDecodeError: + print("json.JSONDecodeError") + return + + def crawl(self): + """ + override crawl main method + add headers + """ + headers = { + 'authority': 'proxylist.geonode.com', + 'sec-ch-ua': '" Not A;Brand";v="99", "Chromium";v="99", "Google Chrome";v="99"', + 'accept': 'application/json, text/plain, */*', + 'sec-ch-ua-mobile': '?0', + 'user-agent': 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/99.0.4844.83 Safari/537.36', + 'sec-ch-ua-platform': '"macOS"', + 'origin': 'https://geonode.com', + 'sec-fetch-site': 'same-site', + 'sec-fetch-mode': 'cors', + 'sec-fetch-dest': 'empty', + 'referer': 'https://geonode.com/', + 'accept-language': 'zh-CN,zh;q=0.9,en;q=0.8,ja;q=0.7', + 'if-none-match': 'W/"c25d-BXjLTmP+/yYXtIz4OEcmdOWSv88"', + } + try: + for url in self.urls: + logger.info(f'fetching {url}') + html = self.fetch(url, headers=headers) + if not html: + continue + time.sleep(.5) + yield from self.process(html, url) + except RetryError: + logger.error( + f'crawler {self} crawled proxy unsuccessfully, ' + 'please check if target url is valid or network issue') + + +if __name__ == '__main__': + crawler = GeonodeCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/goubanjia.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/goubanjia.py new file mode 100644 index 0000000..5715785 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/goubanjia.py @@ -0,0 +1,44 @@ +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +import re +from pyquery import PyQuery as pq +import time +BASE_URL = 'http://www.goubanjia.com/' + + +class GoubanjiaCrawler(BaseCrawler): + """ + ip Goubanjia crawler, http://www.goubanjia.com/ + """ + urls = [BASE_URL] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html)('.ip').items() + # ''.join([*filter(lambda x: x != '',re.compile('\>([\d:\.]*)\<').findall(td.html()))]) + for td in doc: + trs = td.children() + ip_str = '' + for tr in trs: + attrib = tr.attrib + if 'style' in attrib and 'none' in tr.attrib['style']: + continue + ip_str+= '' if not tr.text else tr.text + addr_split = ip_str.split(':') + if(len(addr_split) == 2): + host = addr_split[0] + port = addr_split[1] + yield Proxy(host=host, port=port) + else: + port = trs[-1].text + host = ip_str.replace(port,'') + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = GoubanjiaCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ihuan.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ihuan.py new file mode 100644 index 0000000..4ca5e52 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ihuan.py @@ -0,0 +1,36 @@ +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +import re +from pyquery import PyQuery as pq +import time +BASE_URL = 'https://ip.ihuan.me/today/{path}.html' + + +class IhuanCrawler(BaseCrawler): + """ + ip ihuan crawler, https://ip.ihuan.me + """ + path = time.strftime("%Y/%m/%d/%H", time.localtime()) + urls = [BASE_URL.format(path=path)] + ignore = False + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + # doc = pq(html)('.text-left') + ip_address = re.compile('([\d:\.]*).*?
    ') + hosts_ports = ip_address.findall(html) + for addr in hosts_ports: + addr_split = addr.split(':') + if(len(addr_split) == 2): + host = addr_split[0] + port = addr_split[1] + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = IhuanCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ip3366.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ip3366.py new file mode 100644 index 0000000..dfbc06f --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ip3366.py @@ -0,0 +1,32 @@ +from proxypool.crawlers.base import BaseCrawler +from proxypool.schemas.proxy import Proxy +import re + + +MAX_PAGE = 3 +BASE_URL = 'http://www.ip3366.net/free/?stype={stype}&page={page}' + + +class IP3366Crawler(BaseCrawler): + """ + ip3366 crawler, http://www.ip3366.net/ + """ + urls = [BASE_URL.format(stype=stype,page=i) for stype in range(1,3) for i in range(1, 8)] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + ip_address = re.compile('\s*(.*?)\s*(.*?)') + # \s * 匹配空格,起到换行作用 + re_ip_address = ip_address.findall(html) + for address, port in re_ip_address: + proxy = Proxy(host=address.strip(), port=int(port.strip())) + yield proxy + + +if __name__ == '__main__': + crawler = IP3366Crawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ip89.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ip89.py new file mode 100644 index 0000000..f67c387 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/ip89.py @@ -0,0 +1,33 @@ +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +import re + +MAX_NUM = 9999 +BASE_URL = 'http://api.89ip.cn/tqdl.html?api=1&num={MAX_NUM}&port=&address=&isp='.format(MAX_NUM=MAX_NUM) + + +class Ip89Crawler(BaseCrawler): + """ + 89ip crawler, http://api.89ip.cn + """ + urls = [BASE_URL] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + ip_address = re.compile('([\d:\.]*)
    ') + hosts_ports = ip_address.findall(html) + for addr in hosts_ports: + addr_split = addr.split(':') + if(len(addr_split) == 2): + host = addr_split[0] + port = addr_split[1] + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = Ip89Crawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/iphai.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/iphai.py new file mode 100644 index 0000000..baa7983 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/iphai.py @@ -0,0 +1,35 @@ +from proxypool.crawlers.base import BaseCrawler +from proxypool.schemas.proxy import Proxy +import re + + +BASE_URL = 'http://www.iphai.com/' + +class IPHaiCrawler(BaseCrawler): + """ + iphai crawler, http://www.iphai.com/ + """ + urls = [BASE_URL] + ignore = True + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + find_tr = re.compile('(.*?)', re.S) + trs = find_tr.findall(html) + for s in range(1, len(trs)): + find_ip = re.compile('\s+(\d+\.\d+\.\d+\.\d+)\s+', re.S) + re_ip_address = find_ip.findall(trs[s]) + find_port = re.compile('\s+(\d+)\s+', re.S) + re_port = find_port.findall(trs[s]) + for address, port in zip(re_ip_address, re_port): + proxy = Proxy(host=address.strip(), port=int(port.strip())) + yield proxy + +if __name__ == '__main__': + crawler = IPHaiCrawler() + for proxy in crawler.crawl(): + print(proxy) + diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/jiangxianli.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/jiangxianli.py new file mode 100644 index 0000000..861dd1e --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/jiangxianli.py @@ -0,0 +1,39 @@ +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +import json + + +BASE_URL = 'https://ip.jiangxianli.com/api/proxy_ips?page={page}' + +MAX_PAGE = 3 + + +class JiangxianliCrawler(BaseCrawler): + """ + jiangxianli crawler,https://ip.jiangxianli.com/ + """ + + urls = [BASE_URL.format(page=page) for page in range(1, MAX_PAGE + 1)] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + + result = json.loads(html) + if result['code'] != 0: + return + MAX_PAGE = int(result['data']['last_page']) + hosts_ports = result['data']['data'] + for ip_address in hosts_ports: + if(ip_address): + host = ip_address['ip'] + port = ip_address['port'] + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = JiangxianliCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/kuaidaili.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/kuaidaili.py new file mode 100644 index 0000000..3602833 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/kuaidaili.py @@ -0,0 +1,33 @@ +from proxypool.crawlers.base import BaseCrawler +from proxypool.schemas.proxy import Proxy +import re +from pyquery import PyQuery as pq + + +BASE_URL = 'https://www.kuaidaili.com/free/{type}/{page}/' +MAX_PAGE = 3 + + +class KuaidailiCrawler(BaseCrawler): + """ + kuaidaili crawler, https://www.kuaidaili.com/ + """ + urls = [BASE_URL.format(type=type,page=page) for type in ('intr','inha') for page in range(1, MAX_PAGE + 1)] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + for item in doc('table tr').items(): + td_ip = item.find('td[data-title="IP"]').text() + td_port = item.find('td[data-title="PORT"]').text() + if td_ip and td_port: + yield Proxy(host=td_ip, port=td_port) + + +if __name__ == '__main__': + crawler = KuaidailiCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/seofangfa.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/seofangfa.py new file mode 100644 index 0000000..1293fc0 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/seofangfa.py @@ -0,0 +1,34 @@ +import requests +from pyquery import PyQuery as pq + +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler + +requests.packages.urllib3.disable_warnings() +BASE_URL = "https://proxy.seofangfa.com/" +MAX_PAGE = 1 + + +class SeoFangFaCrawler(BaseCrawler): + """ + seo方法 crawler, https://proxy.seofangfa.com/ + """ + urls = ["https://proxy.seofangfa.com/"] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + trs = doc('.table tr:gt(0)').items() + for tr in trs: + host = tr.find('td:nth-child(1)').text() + port = int(tr.find('td:nth-child(2)').text()) + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = SeoFangFaCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/taiyangdaili.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/taiyangdaili.py new file mode 100644 index 0000000..edbacad --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/taiyangdaili.py @@ -0,0 +1,31 @@ +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +from pyquery import PyQuery as pq + +BaseUrl = 'http://www.taiyanghttp.com/free/page{num}' +MAX_PAGE = 3 + + +class TaiyangdailiCrawler(BaseCrawler): + """ + taiyangdaili crawler, http://www.taiyanghttp.com/free/ + """ + urls = [BaseUrl.format(num=i) for i in range(1, 6)] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + trs = doc('#ip_list .tr.ip_tr').items() + for tr in trs: + host = tr.find('div:nth-child(1)').text() + port = tr.find('div:nth-child(2)').text() + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = TaiyangdailiCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/uqidata.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/uqidata.py new file mode 100644 index 0000000..3e54b2d --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/uqidata.py @@ -0,0 +1,49 @@ +from pyquery import PyQuery as pq +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +from loguru import logger + +BASE_URL = 'https://ip.uqidata.com/free/index.html' + + +class UqidataCrawler(BaseCrawler): + """ + Uqidata crawler, https://ip.uqidata.com/free/index.html + """ + urls = [BASE_URL] + ignore = True + + def encode(input_str): + tmp = [] + for i in range(len(input_str)): + tmp.append("ABCDEFGHIZ".find(input_str[i])) + result = "".join(str(i) for i in tmp) + result = int(result) >> 0x03 + return result + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + trs = doc('#main_container .inner table tbody tr:nth-child(n+3)').items() + for tr in trs: + ip_html = tr('td.ip').find("*").items() + host = '' + for i in ip_html: + if i.attr('style') is not None and 'none' in i.attr('style'): + continue + if i.text() == '': + continue + host += i.text() + + port_code = tr('td.port').attr('class').split(' ')[1] + port = UqidataCrawler.encode(port_code) + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = UqidataCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xiaoshudaili.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xiaoshudaili.py new file mode 100644 index 0000000..4476309 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xiaoshudaili.py @@ -0,0 +1,54 @@ +import re +from pyquery import PyQuery as pq +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler + +BASE_URL = "http://www.xsdaili.cn/" +PAGE_BASE_URL = "http://www.xsdaili.cn/dayProxy/ip/{page}.html" +MAX_PAGE = 3 + + +class XiaoShuCrawler(BaseCrawler): + """ + 小舒代理 crawler, http://www.xsdaili.cn/ + """ + + def __init__(self): + """ + init urls + """ + try: + html = self.fetch(url=BASE_URL) + except: + self.urls = [] + return + doc = pq(html) + title = doc(".title:eq(0) a").items() + latest_page = 0 + for t in title: + res = re.search(r"/(\d+)\.html", t.attr("href")) + latest_page = int(res.group(1)) if res else 0 + if latest_page: + self.urls = [PAGE_BASE_URL.format(page=page) for page in range( + latest_page - MAX_PAGE, latest_page)] + else: + self.urls = [] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + contents = doc('.cont').text() + contents = contents.split("\n") + for content in contents: + c = content[:content.find("@")] + host, port = c.split(":") + yield Proxy(host=host, port=int(port)) + + +if __name__ == '__main__': + crawler = XiaoShuCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xicidaili.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xicidaili.py new file mode 100644 index 0000000..53a4872 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xicidaili.py @@ -0,0 +1,35 @@ +from pyquery import PyQuery as pq +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +from loguru import logger + +BASE_URL = 'https://www.xicidaili.com/' + + +class XicidailiCrawler(BaseCrawler): + """ + xididaili crawler, https://www.xicidaili.com/ + """ + urls = [BASE_URL] + ignore = True + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + items = doc('#ip_list tr:contains(高匿)').items() + for item in items: + country = item.find('td.country').text() + if not country or country.strip() != '高匿': + continue + host = item.find('td:nth-child(2)').text() + port = int(item.find('td:nth-child(3)').text()) + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = XicidailiCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xiladaili.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xiladaili.py new file mode 100644 index 0000000..70a75ff --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/xiladaili.py @@ -0,0 +1,32 @@ +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +from lxml import etree + +BASE_URL = "http://www.xiladaili.com/" +MAX_PAGE = 5 + + +class XiladailiCrawler(BaseCrawler): + """ + xiladaili crawler, http://www.xiladaili.com/ + """ + urls = ["http://www.xiladaili.com/"] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + etree_html = etree.HTML(html) + ip_ports = etree_html.xpath("//tbody/tr/td[1]/text()") + + for ip_port in ip_ports: + host = ip_port.partition(":")[0] + port = ip_port.partition(":")[2] + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = XiladailiCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/yqie.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/yqie.py new file mode 100644 index 0000000..fb3feaf --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/yqie.py @@ -0,0 +1,32 @@ +from pyquery import PyQuery as pq + +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler + +BASE_URL = "http://ip.yqie.com/ipproxy.htm" +MAX_PAGE = 1 + + +class YqIeCrawler(BaseCrawler): + """ + ip yqie crawler, http://ip.yqie.com/ipproxy.htm + """ + urls = [BASE_URL] + + def parse(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + trs = doc('#GridViewOrder tr:gt(0)').items() + for tr in trs: + host = tr.find('td:nth-child(1)').text() + port = int(tr.find('td:nth-child(2)').text()) + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = YqIeCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/zhandaye.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/zhandaye.py new file mode 100644 index 0000000..1522cdf --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/crawlers/public/zhandaye.py @@ -0,0 +1,59 @@ +from pyquery import PyQuery as pq +from proxypool.schemas.proxy import Proxy +from proxypool.crawlers.base import BaseCrawler +from loguru import logger +import re + + +BASE_URL = 'https://www.zdaye.com/dayProxy/{page}.html' +MAX_PAGE = 5 * 2 + + +class ZhandayeCrawler(BaseCrawler): + """ + zhandaye crawler, https://www.zdaye.com/dayProxy/ + """ + urls_catalog = [BASE_URL.format(page=page) for page in range(1, MAX_PAGE)] + headers = { + 'User-Agent': 'User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.61 Safari/537.36' + } + urls = [] + ignore = True + + def crawl(self): + self.crawl_catalog() + yield from super().crawl() + + def crawl_catalog(self): + for url in self.urls_catalog: + logger.info(f'fetching {url}') + html = self.fetch(url, headers=self.headers) + self.parse_catalog(html) + + def parse_catalog(self, html): + """ + parse html file to get proxies + :return: + """ + doc = pq(html) + for item in doc('#J_posts_list .thread_item div div p a').items(): + url = 'https://www.zdaye.com' + item.attr('href') + logger.info(f'get detail url: {url}') + self.urls.append(url) + + def parse(self, html): + doc = pq(html) + trs = doc('.cont br').items() + for tr in trs: + line = tr[0].tail + match = re.search(r'(\d+\.\d+\.\d+\.\d+):(\d+)', line) + if match: + host = match.group(1) + port = match.group(2) + yield Proxy(host=host, port=port) + + +if __name__ == '__main__': + crawler = ZhandayeCrawler() + for proxy in crawler.crawl(): + print(proxy) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/exceptions/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/exceptions/__init__.py new file mode 100644 index 0000000..b54b1e8 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/exceptions/__init__.py @@ -0,0 +1 @@ +from .empty import PoolEmptyException \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/exceptions/empty.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/exceptions/empty.py new file mode 100644 index 0000000..255c7fb --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/exceptions/empty.py @@ -0,0 +1,7 @@ +class PoolEmptyException(Exception): + def __str__(self): + """ + proxypool is used out + :return: + """ + return repr('no proxy in proxypool') diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/getter.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/getter.py new file mode 100644 index 0000000..ca4105d --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/getter.py @@ -0,0 +1,43 @@ +from loguru import logger +from proxypool.storages.redis1 import RedisClient +from proxypool.setting import PROXY_NUMBER_MAX +from proxypool.crawlers import __all__ as crawlers_cls + + +class Getter(object): + """ + getter of proxypool + """ + + def __init__(self): + """ + init db and crawlers + """ + self.redis = RedisClient() + self.crawlers_cls = crawlers_cls + self.crawlers = [crawler_cls() for crawler_cls in self.crawlers_cls] + + def is_full(self): + """ + if proxypool if full + return: bool + """ + return self.redis.count() >= PROXY_NUMBER_MAX + + @logger.catch + def run(self): + """ + run crawlers to get proxy + :return: + """ + if self.is_full(): + return + for crawler in self.crawlers: + logger.info(f'crawler {crawler} to get proxy') + for proxy in crawler.crawl(): + self.redis.add(proxy) + + +if __name__ == '__main__': + getter = Getter() + getter.run() diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/server.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/server.py new file mode 100644 index 0000000..a953e36 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/server.py @@ -0,0 +1,92 @@ +from flask import Flask, g, request +from proxypool.storages.redis1 import RedisClient +from proxypool.setting import API_HOST, API_PORT, API_THREADED, API_KEY, IS_DEV +import functools + +__all__ = ['app'] + +app = Flask(__name__) +if IS_DEV: + app.debug = True + + +def auth_required(func): + @functools.wraps(func) + def decorator(*args, **kwargs): + # conditional decorator, when setting API_KEY is set, otherwise just ignore this decorator + if API_KEY == "": + return func(*args, **kwargs) + if request.headers.get('API-KEY', None) is not None: + api_key = request.headers.get('API-KEY') + else: + return {"message": "Please provide an API key in header"}, 400 + # Check if API key is correct and valid + if request.method == "GET" and api_key == API_KEY: + return func(*args, **kwargs) + else: + return {"message": "The provided API key is not valid"}, 403 + + return decorator + + +def get_conn(): + """ + get redis client object + :return: + """ + if not hasattr(g, 'redis'): + g.redis = RedisClient() + return g.redis + + +@app.route('/') +@auth_required +def index(): + """ + get home page, you can define your own templates + :return: + """ + return '

    Welcome to Proxy Pool System

    ' + + +@app.route('/random') +@auth_required +def get_proxy(): + """ + get a random proxy + :return: get a random proxy + """ + conn = get_conn() + return conn.random().string() + + +@app.route('/all') +@auth_required +def get_proxy_all(): + """ + get a random proxy + :return: get a random proxy + """ + conn = get_conn() + proxies = conn.all() + proxies_string = '' + if proxies: + for proxy in proxies: + proxies_string += str(proxy) + '\n' + + return proxies_string + + +@app.route('/count') +@auth_required +def get_count(): + """ + get the count of proxies + :return: count, int + """ + conn = get_conn() + return str(conn.count()) + + +if __name__ == '__main__': + app.run(host=API_HOST, port=API_PORT, threaded=API_THREADED) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/tester.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/tester.py new file mode 100644 index 0000000..aa14910 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/processors/tester.py @@ -0,0 +1,108 @@ +import asyncio +import aiohttp +from loguru import logger +from proxypool.schemas import Proxy +from proxypool.storages.redis1 import RedisClient +from proxypool.setting import TEST_TIMEOUT, TEST_BATCH, TEST_URL, TEST_VALID_STATUS, TEST_ANONYMOUS, \ + TEST_DONT_SET_MAX_SCORE,IS_PAID +from aiohttp import ClientProxyConnectionError, ServerDisconnectedError, ClientOSError, ClientHttpProxyError +from asyncio import TimeoutError + +EXCEPTIONS = ( + ClientProxyConnectionError, + ConnectionRefusedError, + TimeoutError, + ServerDisconnectedError, + ClientOSError, + ClientHttpProxyError, + AssertionError +) + + +class Tester(object): + """ + tester for testing proxies in queue + """ + + def __init__(self): + """ + init redis + """ + self.redis = RedisClient() + self.loop = asyncio.get_event_loop() + + async def test(self, proxy: Proxy): + """ + test single proxy + :param proxy: Proxy object + :return: + """ + async with aiohttp.ClientSession(connector=aiohttp.TCPConnector(ssl=False)) as session: + try: + logger.debug(f'testing {proxy.string()}') + # if TEST_ANONYMOUS is True, make sure that + # the proxy has the effect of hiding the real IP + if TEST_ANONYMOUS: + url = 'https://httpbin.org/ip' + auth = "d2118699212:bxb0p3l8" + if IS_PAID: + proxys = f'http://{auth}@{proxy.string()}' + else: + proxys = f'http://{proxy.string()}' + async with session.get(url, timeout=TEST_TIMEOUT) as response: + resp_json = await response.json() + origin_ip = resp_json['origin'] + async with session.get(url, proxy=proxys, timeout=TEST_TIMEOUT) as response: + resp_json = await response.json() + anonymous_ip = resp_json['origin'] + # 通过去获取https://httpbin.org/ip返回ip是否相同来判断是否代理成功 + assert origin_ip != anonymous_ip + assert proxy.host == anonymous_ip + async with session.get(TEST_URL, proxy=proxys, timeout=TEST_TIMEOUT, + allow_redirects=False) as response: + if response.status in TEST_VALID_STATUS: + if TEST_DONT_SET_MAX_SCORE: + logger.debug(f'proxy {proxy.string()} is valid, remain current score') + else: + self.redis.max(proxy) + logger.debug(f'proxy {proxy.string()} is valid, set max score') + else: + self.redis.decrease(proxy) + logger.debug(f'proxy {proxy.string()} is invalid, decrease score') + except EXCEPTIONS: + # 如果报错了就是用redis减分 + self.redis.decrease(proxy) + logger.debug(f'proxy {proxy.string()} is invalid, decrease score') + + @logger.catch + def run(self): + """ + test main method + :return: + """ + # event loop of aiohttp + logger.info('stating tester...') + count = self.redis.count() + logger.debug(f'{count} proxies to test') + cursor = 0 + while True: + logger.debug(f'testing proxies use cursor {cursor}, count {TEST_BATCH}') + cursor, proxies = self.redis.batch(cursor, count=TEST_BATCH) + if proxies: + tasks = [self.test(proxy) for proxy in proxies] + self.loop.run_until_complete(asyncio.wait(tasks)) + if not cursor: + break + + +def run_tester(): + host = '96.113.165.182' + port = '3128' + tasks = [tester.test(Proxy(host=host, port=port))] + tester.loop.run_until_complete(asyncio.wait(tasks)) + + +if __name__ == '__main__': + tester = Tester() + tester.run() + # run_tester() diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/scheduler.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/scheduler.py new file mode 100644 index 0000000..a2d18ab --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/scheduler.py @@ -0,0 +1,143 @@ +import time +import multiprocessing +from proxypool.processors.server import app +from proxypool.processors.getter import Getter +from proxypool.processors.tester import Tester +from proxypool.setting import APP_PROD_METHOD_GEVENT, APP_PROD_METHOD_MEINHELD, APP_PROD_METHOD_TORNADO, CYCLE_GETTER, CYCLE_TESTER, API_HOST, \ + API_THREADED, API_PORT, ENABLE_SERVER, IS_PROD, APP_PROD_METHOD, \ + ENABLE_GETTER, ENABLE_TESTER, IS_WINDOWS +from loguru import logger + + +if IS_WINDOWS: + multiprocessing.freeze_support() + +tester_process, getter_process, server_process = None, None, None + + +class Scheduler(): + """ + scheduler + """ + + def run_tester(self, cycle=CYCLE_TESTER): + """ + run tester + """ + if not ENABLE_TESTER: + logger.info('tester not enabled, exit') + return + tester = Tester() + loop = 0 + while True: + logger.debug(f'tester loop {loop} start...') + tester.run() + loop += 1 + time.sleep(cycle) + + def run_getter(self, cycle=CYCLE_GETTER): + """ + run getter + """ + if not ENABLE_GETTER: + logger.info('getter not enabled, exit') + return + getter = Getter() + loop = 0 + while True: + logger.debug(f'getter loop {loop} start...') + getter.run() + loop += 1 + time.sleep(cycle) + + def run_server(self): + """ + run server for api + """ + if not ENABLE_SERVER: + logger.info('server not enabled, exit') + return + if IS_PROD: + if APP_PROD_METHOD == APP_PROD_METHOD_GEVENT: + try: + from gevent.pywsgi import WSGIServer + except ImportError as e: + logger.exception(e) + else: + http_server = WSGIServer((API_HOST, API_PORT), app) + http_server.serve_forever() + + elif APP_PROD_METHOD == APP_PROD_METHOD_TORNADO: + try: + from tornado.wsgi import WSGIContainer + from tornado.httpserver import HTTPServer + from tornado.ioloop import IOLoop + except ImportError as e: + logger.exception(e) + else: + http_server = HTTPServer(WSGIContainer(app)) + http_server.listen(API_PORT) + IOLoop.instance().start() + + elif APP_PROD_METHOD == APP_PROD_METHOD_MEINHELD: + try: + import meinheld + except ImportError as e: + logger.exception(e) + else: + meinheld.listen((API_HOST, API_PORT)) + meinheld.run(app) + + else: + logger.error("unsupported APP_PROD_METHOD") + return + else: + app.run(host=API_HOST, port=API_PORT, threaded=API_THREADED, use_reloader=False) + + def run(self): + global tester_process, getter_process, server_process + try: + logger.info('starting proxypool...') + if ENABLE_TESTER: + tester_process = multiprocessing.Process( + target=self.run_tester) + logger.info(f'starting tester, pid {tester_process.pid}...') + tester_process.start() + + if ENABLE_GETTER: + getter_process = multiprocessing.Process( + target=self.run_getter) + logger.info(f'starting getter, pid {getter_process.pid}...') + getter_process.start() + + if ENABLE_SERVER: + server_process = multiprocessing.Process( + target=self.run_server) + logger.info(f'starting server, pid {server_process.pid}...') + server_process.start() + + tester_process and tester_process.join() + getter_process and getter_process.join() + server_process and server_process.join() + except KeyboardInterrupt: + logger.info('received keyboard interrupt signal') + tester_process and tester_process.terminate() + getter_process and getter_process.terminate() + server_process and server_process.terminate() + finally: + # must call join method before calling is_alive + tester_process and tester_process.join() + getter_process and getter_process.join() + server_process and server_process.join() + logger.info( + f'tester is {"alive" if tester_process.is_alive() else "dead"}') + logger.info( + f'getter is {"alive" if getter_process.is_alive() else "dead"}') + logger.info( + f'server is {"alive" if server_process.is_alive() else "dead"}') + logger.info('proxy terminated') + + +if __name__ == '__main__': + scheduler = Scheduler() + scheduler.run() diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/schemas/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/schemas/__init__.py new file mode 100644 index 0000000..699f6dc --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/schemas/__init__.py @@ -0,0 +1 @@ +from .proxy import Proxy \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/schemas/proxy.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/schemas/proxy.py new file mode 100644 index 0000000..8be3fb3 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/schemas/proxy.py @@ -0,0 +1,30 @@ +from attr import attrs, attr + + +@attrs +class Proxy(object): + """ + proxy schema + """ + host = attr(type=str, default=None) + port = attr(type=int, default=None) + + def __str__(self): + """ + to string, for print + :return: + """ + return f'{self.host}:{self.port}' + + def string(self): + """ + to string + :return: : + """ + return self.__str__() + + +if __name__ == '__main__': + proxy = Proxy(host='8.8.8.8', port=8888) + print('proxy', proxy) + print('proxy', proxy.string()) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/setting.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/setting.py new file mode 100644 index 0000000..98eee1a --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/setting.py @@ -0,0 +1,123 @@ +import platform +from os.path import dirname, abspath, join +from environs import Env +from loguru import logger +import shutil + + +env = Env() +env.read_env() + +# definition of flags +IS_WINDOWS = platform.system().lower() == 'windows' + +# definition of dirs +ROOT_DIR = dirname(dirname(abspath(__file__))) +LOG_DIR = join(ROOT_DIR, env.str('LOG_DIR', 'logs')) + +# definition of environments +DEV_MODE, TEST_MODE, PROD_MODE = 'dev', 'test', 'prod' +APP_ENV = env.str('APP_ENV', DEV_MODE).lower() +APP_DEBUG = env.bool('APP_DEBUG', True if APP_ENV == DEV_MODE else False) +APP_DEV = IS_DEV = APP_ENV == DEV_MODE +APP_PROD = IS_PROD = APP_ENV == PROD_MODE +APP_TEST = IS_TEST = APP_ENV == TEST_MODE + + +# Which WSGI container is used to run applications +# - gevent: pip install gevent +# - tornado: pip install tornado +# - meinheld: pip install meinheld +APP_PROD_METHOD_GEVENT = 'gevent' +APP_PROD_METHOD_TORNADO = 'tornado' +APP_PROD_METHOD_MEINHELD = 'meinheld' +APP_PROD_METHOD = env.str('APP_PROD_METHOD', APP_PROD_METHOD_GEVENT).lower() + +# redis host +# 更改了host的权限 +REDIS_HOST = env.str('PROXYPOOL_REDIS_HOST', + env.str('REDIS_HOST', '192.168.118.202')) +# redis port +REDIS_PORT = env.int('PROXYPOOL_REDIS_PORT', env.int('REDIS_PORT', 6379)) +# redis password, if no password, set it to None +REDIS_PASSWORD = env.str('PROXYPOOL_REDIS_PASSWORD', + env.str('REDIS_PASSWORD', None)) +# redis db, if no choice, set it to 0 +REDIS_DB = env.int('PROXYPOOL_REDIS_DB', env.int('REDIS_DB', 0)) +# redis connection string, like redis://[password]@host:port or rediss://[password]@host:port/0, +# please refer to https://redis-py.readthedocs.io/en/stable/connections.html#redis.client.Redis.from_url +REDIS_CONNECTION_STRING = env.str( + 'PROXYPOOL_REDIS_CONNECTION_STRING', env.str('REDIS_CONNECTION_STRING', None)) + +# redis hash table key name +REDIS_KEY = env.str('PROXYPOOL_REDIS_KEY', env.str( + 'REDIS_KEY', 'proxies:universal')) + +# definition of proxy scores +IS_PAID =env.bool('IS_PAID', True) +PROXY_SCORE_MAX = env.int('PROXY_SCORE_MAX', 100) +PROXY_SCORE_MIN = env.int('PROXY_SCORE_MIN', 0) +PROXY_SCORE_INIT = env.int('PROXY_SCORE_INIT', 10) + +# definition of proxy number +PROXY_NUMBER_MAX = 50000 +PROXY_NUMBER_MIN = 0 + +# definition of tester cycle, it will test every CYCLE_TESTER second +CYCLE_TESTER = env.int('CYCLE_TESTER', 20) +# definition of getter cycle, it will get proxy every CYCLE_GETTER second +CYCLE_GETTER = env.int('CYCLE_GETTER', 100) +GET_TIMEOUT = env.int('GET_TIMEOUT', 10) + +# definition of tester +TEST_URL = env.str('TEST_URL', 'http://www.baidu.com') +TEST_TIMEOUT = env.int('TEST_TIMEOUT', 10) +TEST_BATCH = env.int('TEST_BATCH', 20) +# only save anonymous proxy +TEST_ANONYMOUS = env.bool('TEST_ANONYMOUS', True) +# TEST_HEADERS = env.json('TEST_HEADERS', { +# 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/54.0.2840.71 Safari/537.36', +# }) +TEST_VALID_STATUS = env.list('TEST_VALID_STATUS', [200, 206, 302]) +# whether to set max score when one proxy is tested valid +TEST_DONT_SET_MAX_SCORE = env.bool('TEST_DONT_SET_MAX_SCORE', False) + +# definition of api +API_HOST = env.str('API_HOST', '0.0.0.0') +API_PORT = env.int('API_PORT', 5555) +API_THREADED = env.bool('API_THREADED', True) +# add an api key to get proxy +# need a header of `API-KEY` in get request to pass the authenticate +# API_KEY='', do not need `API-KEY` header +API_KEY = env.str('API_KEY', '') + +# flags of enable +ENABLE_TESTER = env.bool('ENABLE_TESTER', True) +ENABLE_GETTER = env.bool('ENABLE_GETTER', True) +ENABLE_SERVER = env.bool('ENABLE_SERVER', True) + + +ENABLE_LOG_FILE = env.bool('ENABLE_LOG_FILE', True) +ENABLE_LOG_RUNTIME_FILE = env.bool('ENABLE_LOG_RUNTIME_FILE', True) +ENABLE_LOG_ERROR_FILE = env.bool('ENABLE_LOG_ERROR_FILE', True) + + +LOG_LEVEL_MAP = { + DEV_MODE: "DEBUG", + TEST_MODE: "INFO", + PROD_MODE: "ERROR" +} + +LOG_LEVEL = LOG_LEVEL_MAP.get(APP_ENV) +LOG_ROTATION = env.str('LOG_ROTATION', '500MB') +LOG_RETENTION = env.str('LOG_RETENTION', '1 week') + +if ENABLE_LOG_FILE: + if ENABLE_LOG_RUNTIME_FILE: + logger.add(env.str('LOG_RUNTIME_FILE', join(LOG_DIR, 'runtime.log')), + level=LOG_LEVEL, rotation=LOG_ROTATION, retention=LOG_RETENTION) + if ENABLE_LOG_ERROR_FILE: + logger.add(env.str('LOG_ERROR_FILE', join(LOG_DIR, 'error.log')), + level='ERROR', rotation=LOG_ROTATION) +else: + shutil.rmtree(LOG_DIR, ignore_errors=True) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/storages/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/storages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/storages/redis1.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/storages/redis1.py new file mode 100644 index 0000000..0482fa1 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/storages/redis1.py @@ -0,0 +1,149 @@ +import redis +from proxypool.exceptions import PoolEmptyException +from proxypool.schemas.proxy import Proxy +from proxypool.setting import REDIS_CONNECTION_STRING, REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_DB, REDIS_KEY, PROXY_SCORE_MAX, PROXY_SCORE_MIN, \ + PROXY_SCORE_INIT +from random import choice +from typing import List +from loguru import logger +from proxypool.utils.proxy import is_valid_proxy, convert_proxy_or_proxies + + +REDIS_CLIENT_VERSION = redis.__version__ +print(REDIS_CLIENT_VERSION) +IS_REDIS_VERSION_2 = REDIS_CLIENT_VERSION.startswith('2.') + + +class RedisClient(object): + """ + redis connection client of proxypool + """ + + def __init__(self, host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWORD, db=REDIS_DB, + connection_string=REDIS_CONNECTION_STRING, **kwargs): + """ + init redis client + :param host: redis host + :param port: redis port + :param password: redis password + :param connection_string: redis connection_string + """ + # if set connection_string, just use it + if connection_string: + self.db = redis.StrictRedis.from_url(connection_string, decode_responses=True, **kwargs) + else: + self.db = redis.StrictRedis( + host=host, port=port, password=password, db=db, decode_responses=True, **kwargs) + + # 增加可用代理 + def add(self, proxy: Proxy, score=PROXY_SCORE_INIT) -> int: + """ + add proxy and set it to init score + :param proxy: proxy, ip:port, like 8.8.8.8:88 + :param score: int score + :return: result + """ + if not is_valid_proxy(f'{proxy.host}:{proxy.port}'): + logger.info(f'invalid proxy {proxy}, throw it') + return + if not self.exists(proxy): + if IS_REDIS_VERSION_2: + # if False: + return self.db.zadd(REDIS_KEY, score, proxy.string()) + return self.db.zadd(REDIS_KEY, {proxy.string(): score}) + + # 随机挑选一个可以用代理 + def random(self) -> Proxy: + """ + get random proxy + firstly try to get proxy with max score + if not exists, try to get proxy by rank + if not exists, raise error + :return: proxy, like 8.8.8.8:8 + """ + # try to get proxy with max score + proxies = self.db.zrangebyscore( + REDIS_KEY, PROXY_SCORE_MAX, PROXY_SCORE_MAX) + if len(proxies): + return convert_proxy_or_proxies(choice(proxies)) + # else get proxy by rank + proxies = self.db.zrevrange( + REDIS_KEY, PROXY_SCORE_MIN, PROXY_SCORE_MAX) + if len(proxies): + return convert_proxy_or_proxies(choice(proxies)) + # else raise error + raise PoolEmptyException + + # 给不好的代理减分 + def decrease(self, proxy: Proxy) -> int: + """ + decrease score of proxy, if small than PROXY_SCORE_MIN, delete it + :param proxy: proxy + :return: new score + """ + if IS_REDIS_VERSION_2: + # if False: + self.db.zincrby(REDIS_KEY, proxy.string(), -1) + else: + self.db.zincrby(REDIS_KEY, -1, proxy.string()) + score = self.db.zscore(REDIS_KEY, proxy.string()) + logger.info(f'{proxy.string()} score decrease 1, current {score}') + # 小于最小值直接删除 + if score <= PROXY_SCORE_MIN: + logger.info(f'{proxy.string()} current score {score}, remove') + self.db.zrem(REDIS_KEY, proxy.string()) + + # 是否存在这个代理 + def exists(self, proxy: Proxy) -> bool: + """ + if proxy exists + :param proxy: proxy + :return: if exists, bool + """ + return not self.db.zscore(REDIS_KEY, proxy.string()) is None + + # 将代理的score设置成最大的 + def max(self, proxy: Proxy) -> int: + """ + set proxy to max score + :param proxy: proxy + :return: new score + """ + logger.info(f'{proxy.string()} is valid, set to {PROXY_SCORE_MAX}') + if IS_REDIS_VERSION_2: + # if False: + return self.db.zadd(REDIS_KEY, PROXY_SCORE_MAX, proxy.string()) + return self.db.zadd(REDIS_KEY, {proxy.string(): PROXY_SCORE_MAX}) + + # 有多少个代理 + def count(self) -> int: + """ + get count of proxies + :return: count, int + """ + return self.db.zcard(REDIS_KEY) + + # 返回所有代理 + def all(self) -> List[Proxy]: + """ + get all proxies + :return: list of proxies + """ + return convert_proxy_or_proxies(self.db.zrangebyscore(REDIS_KEY, PROXY_SCORE_MIN, PROXY_SCORE_MAX)) + + # 根据游标和数量,返回对应个数的代理 + def batch(self, cursor, count) -> List[Proxy]: + """ + get batch of proxies + :param cursor: scan cursor + :param count: scan count + :return: list of proxies + """ + cursor, proxies = self.db.zscan(REDIS_KEY, cursor, count=count) + return cursor, convert_proxy_or_proxies([i[0] for i in proxies]) + + +if __name__ == '__main__': + conn = RedisClient() + result = conn.random() + print(result) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/utils/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/utils/proxy.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/utils/proxy.py new file mode 100644 index 0000000..2a97ce4 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/proxypool/utils/proxy.py @@ -0,0 +1,94 @@ +from proxypool.schemas import Proxy + +import sys +import os + +# pythonpath= os.path.abspath(os.path.dirname(os.path.dirname(__file__))) +# print(pythonpath) +# sys.path.insert(0,pythonpath) + +def is_valid_proxy(data): + """ + check this string is within proxy format + """ + if is_auth_proxy(data): + host, port = extract_auth_proxy(data) + return is_ip_valid(host) and is_port_valid(port) + elif data.__contains__(':'): + ip = data.split(':')[0] + port = data.split(':')[1] + return is_ip_valid(ip) and is_port_valid(port) + else: + return is_ip_valid(data) + + +def is_ip_valid(ip): + """ + check this string is within ip format + """ + if is_auth_proxy(ip): + ip = ip.split('@')[1] + a = ip.split('.') + if len(a) != 4: + return False + for x in a: + if not x.isdigit(): + return False + i = int(x) + if i < 0 or i > 255: + return False + return True + + +def is_port_valid(port): + return port.isdigit() + + +def convert_proxy_or_proxies(data): + """ + convert list of str to valid proxies or proxy + :param data: + :return: + """ + if not data: + return None + # if list of proxies + if isinstance(data, list): + result = [] + for item in data: + # skip invalid item + item = item.strip() + if not is_valid_proxy(item): continue + if is_auth_proxy(item): + host, port = extract_auth_proxy(item) + else: + host, port = item.split(':') + result.append(Proxy(host=host, port=int(port))) + return result + if isinstance(data, str) and is_valid_proxy(data): + if is_auth_proxy(data): + host, port = extract_auth_proxy(data) + else: + host, port = data.split(':') + return Proxy(host=host, port=int(port)) + + +def is_auth_proxy(data: str) -> bool: + return '@' in data + + +def extract_auth_proxy(data: str) -> (str, str): + """ + extract host and port from a proxy with authentication + """ + auth = data.split('@')[0] + ip_port = data.split('@')[1] + ip = ip_port.split(':')[0] + port = ip_port.split(':')[1] + host = auth + '@' + ip + return host, port + + +if __name__ == '__main__': + proxy = 'test1234:test5678.@117.68.216.212:32425' + print(extract_auth_proxy(proxy)) diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/release.sh b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/release.sh new file mode 100644 index 0000000..342cd06 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/release.sh @@ -0,0 +1,2 @@ +git tag -a "`date +'%Y%m%d'`" -m "Release `date +'%Y%m%d'`" +git push origin --tags \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/requirements.txt b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/requirements.txt new file mode 100644 index 0000000..c9407c7 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/requirements.txt @@ -0,0 +1,17 @@ +environs>=9.3.0,<10.0.0 +Flask>=1.1.2,<2.0.0 +attrs>=20.3.0,<21.0.0 +retrying>=1.3.3,<2.0.0 +aiohttp>=3.8.1,<4.0.0 +requests>=2.25.1,<3.0.0 +loguru>=0.5.3,<1.0.0 +pyquery>=1.4.3,<2.0.0 +supervisor>=4.2.1,<5.0.0 +redis>=3.5.3,<4.0.0 +lxml>=4.6.5,<5.0.0 +fake_headers>=1.0.2,<2.0.0 +maxminddb_geolite2==2018.703 +gevent>=21.8.0,<22.0.0 +tornado>=6.0,<7.0 +itsdangerous==0.24 +MarkupSafe<2.1.0 diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/run.py b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/run.py new file mode 100644 index 0000000..e858da9 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/run.py @@ -0,0 +1,14 @@ +from proxypool.scheduler import Scheduler +import argparse + + +parser = argparse.ArgumentParser(description='ProxyPool') +parser.add_argument('--processor', type=str, help='processor to run') +args = parser.parse_args() + +if __name__ == '__main__': + # if processor set, just run it + if args.processor: + getattr(Scheduler(), f'run_{args.processor}')() + else: + Scheduler().run() diff --git a/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/supervisord.conf b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/supervisord.conf new file mode 100644 index 0000000..aff2cd6 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/ProxyPool/supervisord.conf @@ -0,0 +1,40 @@ +[unix_http_server] +file=/run/supervisor.sock +chmod=0700 + +[supervisord] +pidfile=/run/supervisord.pid +nodaemon=true + +[supervisorctl] +serverurl=unix:///run/supervisor.sock + +[rpcinterface:supervisor] +supervisor.rpcinterface_factory=supervisor.rpcinterface:make_main_rpcinterface + +[program:tester] +process_name=tester +command=python3 run.py --processor tester +directory=/app +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + +[program:getter] +process_name=getter +command=python3 run.py --processor getter +directory=/app +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + +[program:server] +process_name=server +command=python3 run.py --processor server +directory=/app +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/__init__.py b/Spider/Chapter09_代理的使用/代理池的维护/__init__.py new file mode 100644 index 0000000..ed8e7df --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 12:57 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理池的维护/baseinformation.txt b/Spider/Chapter09_代理的使用/代理池的维护/baseinformation.txt new file mode 100644 index 0000000..35ae3f9 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理池的维护/baseinformation.txt @@ -0,0 +1,2 @@ +ProxyPool所有内容参考:https://github.com/Python3WebSpider/ProxyPool +上述详细解释了如何部署代理池,基于docker或者k8s \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理的设置/__init__.py b/Spider/Chapter09_代理的使用/代理的设置/__init__.py new file mode 100644 index 0000000..3c90a3a --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理的设置/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/13 19:12 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理的设置/aiohttpDemo.py b/Spider/Chapter09_代理的使用/代理的设置/aiohttpDemo.py new file mode 100644 index 0000000..f107bf4 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理的设置/aiohttpDemo.py @@ -0,0 +1,40 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/13 19:54 +@Usage : +@Desc : +''' + +import asyncio +import aiohttp + +# 普通http +proxy = 'http://127.0.0.1:7890' +# http_auth +proxy = 'http://username:password@127.0.0.1:7890' + + +async def main(): + async with aiohttp.ClientSession() as session: + async with session.get('https://httpbin.org/get', proxy=proxy) as response: + print(await response.text()) + + +async def socks(): + from aiohttp_socks import ProxyConnector, ProxyType + connector = ProxyConnector( + proxy_type=ProxyType.HTTP, + host='127.0.0.1', + port=7890, + # username='user', + # password='password', + # rdns=True + ) + async with aiohttp.ClientSession(connector=connector) as session: + async with session.get('https://httpbin.org/get') as response: + print(await response.text()) + +if __name__ == '__main__': + asyncio.get_event_loop().run_until_complete(main()) diff --git a/Spider/Chapter09_代理的使用/代理的设置/httpxDemo.py b/Spider/Chapter09_代理的使用/代理的设置/httpxDemo.py new file mode 100644 index 0000000..d078fca --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理的设置/httpxDemo.py @@ -0,0 +1,64 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/13 19:42 +@Usage : +@Desc : +''' + + + +import httpx + +def http(): + proxy = '127.0.0.1:7890' + proxies = { + 'http://': 'http://' + proxy, + 'https://': 'http://' + proxy, + } + + with httpx.Client(proxies=proxies) as client: + response = client.get('https://httpbin.org/get') + print(response.text) + +def http_auth(): + proxy = 'username:password@127.0.0.1:7890' + proxies = { + 'http://': 'http://' + proxy, + 'https://': 'http://' + proxy, + } + + with httpx.Client(proxies=proxies) as client: + response = client.get('https://httpbin.org/get') + print(response.text) + +#socks方式需要额外安装pip install httpx-socks[asyncio] +def socks(): + from httpx_socks import SyncProxyTransport + + + # 同步的方式 + transport = SyncProxyTransport.from_url( + 'socks5://127.0.0.1:7891') + + with httpx.Client(transport=transport) as client: + response = client.get('https://httpbin.org/get') + print(response.text) + + + + +# 异步socks +async def main(): + from httpx_socks import AsyncProxyTransport + transport = AsyncProxyTransport.from_url( + 'socks5://127.0.0.1:7891') + async with httpx.AsyncClient(transport=transport) as client: + response = await client.get('https://httpbin.org/get') + print(response.text) + + +if __name__ == '__main__': + import asyncio + asyncio.get_event_loop().run_until_complete(main()) \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理的设置/playwrightDemo.py b/Spider/Chapter09_代理的使用/代理的设置/playwrightDemo.py new file mode 100644 index 0000000..b410349 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理的设置/playwrightDemo.py @@ -0,0 +1,45 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/14 12:39 +@Usage : +@Desc : +''' + +from playwright.sync_api import sync_playwright + + +def http(): + with sync_playwright() as p: + browser = p.chromium.launch(headless=False, proxy={ + 'server': 'http://127.0.0.1:7890' + }) + page = browser.new_page() + page.goto('https://httpbin.org/get') + print(page.content()) + browser.close() + + +def http_auth(): + with sync_playwright() as p: + browser = p.chromium.launch(proxy={ + 'server': 'http://127.0.0.1:7890', + 'username': 'foo', + 'password': 'bar' + }) + page = browser.new_page() + page.goto('https://httpbin.org/get') + print(page.content()) + browser.close() + + +def socks(): + with sync_playwright() as p: + browser = p.chromium.launch(proxy={ + 'server': 'socks5://127.0.0.1:7891' + }) + page = browser.new_page() + page.goto('https://httpbin.org/get') + print(page.content()) + browser.close() diff --git a/Spider/Chapter09_代理的使用/代理的设置/requestDemo.py b/Spider/Chapter09_代理的使用/代理的设置/requestDemo.py new file mode 100644 index 0000000..4116e4b --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理的设置/requestDemo.py @@ -0,0 +1,65 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/13 19:13 +@Usage : +@Desc : request相关代理的设置 +''' + +import requests + + +def http_demo(): + proxy = '127.0.0.1:7890' + proxies = { + 'http': 'http://' + proxy, + 'https': 'http://' + proxy, + } + try: + # 传入proxies参数即可 + response = requests.get('https://httpbin.org/get', proxies=proxies) + print(response.text) + except requests.exceptions.ConnectionError as e: + print('Error', e.args) + + +def http_auth_demo(): + proxy = 'username:password@127.0.0.1:7890' + proxies = { + 'http': 'http://' + proxy, + 'https': 'http://' + proxy, + } + try: + # 传入proxies参数即可 + response = requests.get('https://httpbin.org/get', proxies=proxies) + print(response.text) + except requests.exceptions.ConnectionError as e: + print('Error', e.args) + + +# 如果代理模式是socks:需要额外安装pip install requests[socks] +def socks(): + proxy = '127.0.0.1:7891' + proxies = { + 'http': 'socks5://' + proxy, + 'https': 'socks5://' + proxy + } + try: + response = requests.get('https://httpbin.org/get', proxies=proxies) + print(response.text) + except requests.exceptions.ConnectionError as e: + print('Error', e.args) + + +# 另一种socks方式,此方法属于全局配置 +def socks2(): + import socks + import socket + socks.set_default_proxy(socks.SOCKS5, '127.0.0.1', 7891) + socket.socket = socks.socksocket + try: + response = requests.get('https://httpbin.org/get') + print(response.text) + except requests.exceptions.ConnectionError as e: + print('Error', e.args) diff --git a/Spider/Chapter09_代理的使用/代理的设置/seleniumDemo.py b/Spider/Chapter09_代理的使用/代理的设置/seleniumDemo.py new file mode 100644 index 0000000..e1c1ae7 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理的设置/seleniumDemo.py @@ -0,0 +1,92 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/13 19:49 +@Usage : +@Desc : +''' + +from selenium import webdriver + + +def http(): + proxy = '127.0.0.1:7890' + options = webdriver.ChromeOptions() + options.add_argument('--proxy-server=http://' + proxy) + browser = webdriver.Chrome(options=options) + browser.get('https://httpbin.org/get') + print(browser.page_source) + browser.close() + +def http_auth(): + from selenium import webdriver + from selenium.webdriver.chrome.options import Options + import zipfile + + ip = '127.0.0.1' + port = 7890 + username = 'foo' + password = 'bar' + + manifest_json = """ + { + "version":"1.0.0", + "manifest_version": 2, + "name":"Chrome Proxy", + "permissions": ["proxy","tabs","unlimitedStorage","storage","","webRequest","webRequestBlocking"], + "background": { + "scripts": ["background.js"] + } + } + """ + background_js = """ + var config = { + mode: "fixed_servers", + rules: { + singleProxy: { + scheme: "http", + host: "%(ip) s", + port: %(port) s + } + } + } + + chrome.proxy.settings.set({value: config, scope: "regular"}, function() {}); + + function callbackFn(details) { + return { + authCredentials: {username: "%(username) s", + password: "%(password) s" + } + } + } + + chrome.webRequest.onAuthRequired.addListener( + callbackFn, + {urls: [""]}, + ['blocking'] + ) + """ % {'ip': ip, 'port': port, 'username': username, 'password': password} + + plugin_file = 'proxy_auth_plugin.zip' + with zipfile.ZipFile(plugin_file, 'w') as zp: + zp.writestr("manifest.json", manifest_json) + zp.writestr("background.js", background_js) + options = Options() + options.add_argument("--start-maximized") + options.add_extension(plugin_file) + browser = webdriver.Chrome(options=options) + browser.get('https://httpbin.org/get') + print(browser.page_source) + browser.close() + + +def socks(): + proxy = '127.0.0.1:7891' + options = webdriver.ChromeOptions() + options.add_argument('--proxy-server=socks5://' + proxy) + browser = webdriver.Chrome(options=options) + browser.get('https://httpbin.org/get') + print(browser.page_source) + browser.close() \ No newline at end of file diff --git a/Spider/Chapter09_代理的使用/代理的设置/urllibDemo.py b/Spider/Chapter09_代理的使用/代理的设置/urllibDemo.py new file mode 100644 index 0000000..644c8b5 --- /dev/null +++ b/Spider/Chapter09_代理的使用/代理的设置/urllibDemo.py @@ -0,0 +1,41 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/13 19:14 +@Usage : +@Desc : +''' + +from urllib.error import URLError +from urllib.request import ProxyHandler, build_opener + + +# 不带权限验证的http +def http_demo(): + proxy = '127.0.0.1:7890' + proxy_handler = ProxyHandler({ + 'http': 'http://' + proxy, + 'https': 'https://' + proxy + }) + opener = build_opener(proxy_handler) + try: + response = opener.open('https://httpbin.org/get') + print(response.read().decode('utf-8')) + except URLError as e: + print(e.reason) + + +# 带权限验证的http +def http_auth_demo(): + proxy = 'username:password@127.0.0.1:7890' + proxy_handler = ProxyHandler({ + 'http': 'http://' + proxy, + 'https': 'http://' + proxy + }) + opener = build_opener(proxy_handler) + try: + response = opener.open('https://httpbin.org/get') + print(response.read().decode('utf-8')) + except URLError as e: + print(e.reason) diff --git a/Spider/Chapter10_模拟登录/__init__.py b/Spider/Chapter10_模拟登录/__init__.py new file mode 100644 index 0000000..e4cbee3 --- /dev/null +++ b/Spider/Chapter10_模拟登录/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 14:30 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter10_模拟登录/基于JWT模拟登录爬取实战/__init__.py b/Spider/Chapter10_模拟登录/基于JWT模拟登录爬取实战/__init__.py new file mode 100644 index 0000000..a9ce791 --- /dev/null +++ b/Spider/Chapter10_模拟登录/基于JWT模拟登录爬取实战/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 16:17 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter10_模拟登录/基于JWT模拟登录爬取实战/spider1.py b/Spider/Chapter10_模拟登录/基于JWT模拟登录爬取实战/spider1.py new file mode 100644 index 0000000..d6eb3be --- /dev/null +++ b/Spider/Chapter10_模拟登录/基于JWT模拟登录爬取实战/spider1.py @@ -0,0 +1,37 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 16:17 +@Usage : +@Desc : +''' + +import requests +from urllib.parse import urljoin + +BASE_URL = 'https://login3.scrape.center/' +LOGIN_URL = urljoin(BASE_URL, '/api/login') +INDEX_URL = urljoin(BASE_URL, '/api/book') +USERNAME = 'admin' +PASSWORD = 'admin' + +response_login = requests.post(LOGIN_URL, json={ + 'username': USERNAME, + 'password': PASSWORD +}) +data = response_login.json() +print('Response JSON', data) +jwt = data.get('token') +print('JWT', jwt) + +headers = { + 'Authorization': f'jwt {jwt}' +} +response_index = requests.get(INDEX_URL, params={ + 'limit': 18, + 'offset': 0 +}, headers=headers) +print('Response Status', response_index.status_code) +print('Response URL', response_index.url) +print('Response Data', response_index.json()) diff --git a/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/__init__.py b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/__init__.py new file mode 100644 index 0000000..c6f8588 --- /dev/null +++ b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 15:27 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider1.py b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider1.py new file mode 100644 index 0000000..e5fe9fe --- /dev/null +++ b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider1.py @@ -0,0 +1,25 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 15:37 +@Usage : +@Desc : +''' +import requests +from urllib.parse import urljoin + +BASE_URL = 'https://login2.scrape.center/' +LOGIN_URL = urljoin(BASE_URL, '/login') +INDEX_URL = urljoin(BASE_URL, '/page/1') +USERNAME = 'admin' +PASSWORD = 'admin' + +response_login = requests.post(LOGIN_URL, data={ + 'username': USERNAME, + 'password': PASSWORD +}) + +response_index = requests.get(INDEX_URL) +print('Response Status', response_index.status_code) +print('Response URL', response_index.url) diff --git a/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider2.py b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider2.py new file mode 100644 index 0000000..79e819b --- /dev/null +++ b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider2.py @@ -0,0 +1,29 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 15:43 +@Usage : +@Desc : +''' + +import requests +from urllib.parse import urljoin + +BASE_URL = 'https://login2.scrape.center/' +LOGIN_URL = urljoin(BASE_URL, '/login') +INDEX_URL = urljoin(BASE_URL, '/page/1') +USERNAME = 'admin' +PASSWORD = 'admin' + +response_login = requests.post(LOGIN_URL, data={ + 'username': USERNAME, + 'password': PASSWORD +}, allow_redirects=False) + +cookies = response_login.cookies +print('Cookies', cookies) + +response_index = requests.get(INDEX_URL, cookies=cookies) +print('Response Status', response_index.status_code) +print('Response URL', response_index.url) \ No newline at end of file diff --git a/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider3.py b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider3.py new file mode 100644 index 0000000..2531013 --- /dev/null +++ b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider3.py @@ -0,0 +1,31 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 15:48 +@Usage : +@Desc : +''' + +import requests +from urllib.parse import urljoin + +BASE_URL = 'https://login2.scrape.center/' +LOGIN_URL = urljoin(BASE_URL, '/login') +INDEX_URL = urljoin(BASE_URL, '/page/1') +USERNAME = 'admin' +PASSWORD = 'admin' + +session = requests.Session() + +response_login = session.post(LOGIN_URL, data={ + 'username': USERNAME, + 'password': PASSWORD +}) + +cookies = session.cookies +print('Cookies', cookies) + +response_index = session.get(INDEX_URL) +print('Response Status', response_index.status_code) +print('Response URL', response_index.url) \ No newline at end of file diff --git a/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider4.py b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider4.py new file mode 100644 index 0000000..ffd9dbd --- /dev/null +++ b/Spider/Chapter10_模拟登录/基于Session和Cookie的模拟登陆爬取实战/spider4.py @@ -0,0 +1,41 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/15 15:53 +@Usage : +@Desc : +''' + +from urllib.parse import urljoin +from selenium import webdriver +from selenium.webdriver.common.by import By +import requests +import time + +BASE_URL = 'https://login2.scrape.center/' +LOGIN_URL = urljoin(BASE_URL, '/login') +INDEX_URL = urljoin(BASE_URL, '/page/1') +USERNAME = 'admin' +PASSWORD = 'admin' + +browser = webdriver.Chrome() +browser.get(BASE_URL) +browser.find_element(By.CSS_SELECTOR, 'input[name="username"]').send_keys(USERNAME) +browser.find_element(By.CSS_SELECTOR, 'input[name="password"]').send_keys(PASSWORD) +browser.find_element(By.CSS_SELECTOR, 'input[type="submit"]').click() +time.sleep(10) + +# get cookies from selenium +cookies = browser.get_cookies() +print('Cookies', cookies) +browser.close() + +# set cookies to requests +session = requests.Session() +for cookie in cookies: + session.cookies.set(cookie['name'], cookie['value']) + +response_index = session.get(INDEX_URL) +print('Response Status', response_index.status_code) +print('Response URL', response_index.url) diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.github/ISSUE_TEMPLATE/bug_report.md b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.github/ISSUE_TEMPLATE/bug_report.md new file mode 100644 index 0000000..22003f1 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.github/ISSUE_TEMPLATE/bug_report.md @@ -0,0 +1,32 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: bug +assignees: Germey + +--- + +**Describe the bug** +A clear and concise description of what the bug is. + +**To Reproduce** +Steps to reproduce the behavior: +1. Go to '...' +2. Click on '....' +3. Scroll down to '....' +4. See error + +**Expected behavior** +A clear and concise description of what you expected to happen. + +**Screenshots** +If applicable, add screenshots to help explain your problem. + +**Environments (please complete the following information):** + - OS: [e.g. macOS 10.15.2] + - Python [e.g. Python 3.6] + - Browser [e.g. Chrome 67 ] + +**Additional context** +Add any other context about the problem here. diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.github/workflows/build.yml b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.github/workflows/build.yml new file mode 100644 index 0000000..6b1b6c2 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.github/workflows/build.yml @@ -0,0 +1,24 @@ +name: build +on: + push: + branches: + - master + paths-ignore: + - .gitignore + - README.md + - '.github/ISSUE_TEMPLATE/**' +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout Source + uses: actions/checkout@v1 + - name: Docker Login + run: docker login -u germey -p ${{ secrets.DOCKERHUB_LOGIN_PASSWORD }} + - name: Build the Docker Image + run: docker-compose build + - name: Tag and Push Master Version + run: | + docker tag germey/accountpool germey/accountpool:master + docker push germey/accountpool:master + diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.gitignore b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.gitignore new file mode 100644 index 0000000..11b7b2c --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/.gitignore @@ -0,0 +1,144 @@ +/.idea +*.pyc +ghostdriver.log +### Python template +# Byte-compiled / optimized / DLL files +__pycache__/ +*.py[cod] +*$py.class + +# C extensions +*.so + +# Distribution / packaging +.Python +build/ +develop-eggs/ +dist/ +downloads/ +eggs/ +.eggs/ +lib/ +lib64/ +parts/ +sdist/ +var/ +wheels/ +share/python-wheels/ +*.egg-info/ +.installed.cfg +*.egg +MANIFEST + +# PyInstaller +# Usually these files are written by a python script from a template +# before PyInstaller builds the exe, so as to inject date/other infos into it. +*.manifest +*.spec + +# Installer logs +pip-log.txt +pip-delete-this-directory.txt + +# Unit test / coverage reports +htmlcov/ +.tox/ +.nox/ +.coverage +.coverage.* +.cache +nosetests.xml +coverage.xml +*.cover +*.py,cover +.hypothesis/ +.pytest_cache/ +cover/ + +# Translations +*.mo +*.pot + +# Django stuff: +*.log +local_settings.py +db.sqlite3 +db.sqlite3-journal + +# Flask stuff: +instance/ +.webassets-cache + +# Scrapy stuff: +.scrapy + +# Sphinx documentation +docs/_build/ + +# PyBuilder +.pybuilder/ +target/ + +# Jupyter Notebook +.ipynb_checkpoints + +# IPython +profile_default/ +ipython_config.py + +# pyenv +# For a library or package, you might want to ignore these files since the code is +# intended to run in multiple environments; otherwise, check them in: +# .python-version + +# pipenv +# According to pypa/pipenv#598, it is recommended to include Pipfile.lock in version control. +# However, in case of collaboration, if having platform-specific dependencies or dependencies +# having no cross-platform support, pipenv may install dependencies that don't work, or not +# install all needed dependencies. +#Pipfile.lock + +# PEP 582; used by e.g. github.com/David-OConnor/pyflow +__pypackages__/ + +# Celery stuff +celerybeat-schedule +celerybeat.pid + +# SageMath parsed files +*.sage.py + +# Environments +.env +.venv +env/ +venv/ +ENV/ +env.bak/ +venv.bak/ + +# Spyder project settings +.spyderproject +.spyproject + +# Rope project settings +.ropeproject + +# mkdocs documentation +/site + +# mypy +.mypy_cache/ +.dmypy.json +dmypy.json + +# Pyre type checker +.pyre/ + +# pytype static type analyzer +.pytype/ + +# Cython debug symbols +cython_debug/ + +logs/ \ No newline at end of file diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/Dockerfile b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/Dockerfile new file mode 100644 index 0000000..7770153 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/Dockerfile @@ -0,0 +1,6 @@ +FROM python:3.6 +WORKDIR /app +COPY requirements.txt . +RUN pip install -r requirements.txt +COPY . . +CMD ["supervisord", "-c", "supervisord.conf"] diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/README.md b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/README.md new file mode 100644 index 0000000..32b27e6 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/README.md @@ -0,0 +1,216 @@ +# AccountPool + +![build](https://github.com/Python3WebSpider/AccountPool/workflows/build/badge.svg) +![](https://img.shields.io/badge/python-3.6%2B-brightgreen) +![Docker Pulls](https://img.shields.io/docker/pulls/germey/accountpool) + +简易高效的账号池,提供如下功能: + +- 定时模拟登录账号,将 Cookies 或 JWT 等信息存储到 Redis 数据库。 +- 定时测试,剔除不可用 Cookies 或 JWT。 +- 提供 API,随机取用测试通过的可用 Cookies 或 JWT。 + +## 使用要求 + +可以通过两种方式来运行账号池,一种方式是使用 Docker(推荐),另一种方式是常规方式运行。 + +### Docker + +如果使用 Docker,则需要安装如下环境: + +- Docker +- Docker-Compose + +### 常规方式 + +常规方式要求有 Python 环境、Redis 环境,具体要求如下: + +- Python>=3.6 +- Redis + +## Docker 运行 + +如果安装好了 Docker 和 Docker-Compose,只需要一条命令即可运行。 + +```shell script +docker-compose up +``` + +运行结果类似如下: + +``` +redis4accountpool is up-to-date +Recreating accountpool ... done +Attaching to redis4accountpool, accountpool +redis4accountpool | 1:C 31 Aug 2023 03:53:10.335 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo +redis4accountpool | 1:C 31 Aug 2023 03:53:10.335 * Redis version=7.2.0, bits=64, commit=00000000, modified=0, pid=1, just started +redis4accountpool | 1:C 31 Aug 2023 03:53:10.335 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf +redis4accountpool | 1:M 31 Aug 2023 03:53:10.335 * monotonic clock: POSIX clock_gettime +redis4accountpool | 1:M 31 Aug 2023 03:53:10.336 * Running mode=standalone, port=6379. +redis4accountpool | 1:M 31 Aug 2023 03:53:10.336 * Server initialized +redis4accountpool | 1:M 31 Aug 2023 03:53:10.336 * Ready to accept connections tcp +redis4accountpool | 1:C 31 Aug 2023 04:03:11.226 * oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo +redis4accountpool | 1:C 31 Aug 2023 04:03:11.226 * Redis version=7.2.0, bits=64, commit=00000000, modified=0, pid=1, just started +redis4accountpool | 1:C 31 Aug 2023 04:03:11.226 # Warning: no config file specified, using the default config. In order to specify a config file use redis-server /path/to/redis.conf +redis4accountpool | 1:M 31 Aug 2023 04:03:11.226 * monotonic clock: POSIX clock_gettime +redis4accountpool | 1:M 31 Aug 2023 04:03:11.227 * Running mode=standalone, port=6379. +redis4accountpool | 1:M 31 Aug 2023 04:03:11.227 * Server initialized +redis4accountpool | 1:M 31 Aug 2023 04:03:11.227 * Ready to accept connections tcp +accountpool | 2023-08-31 04:06:20,737 CRIT Supervisor is running as root. Privileges were not dropped because no user is specified in the config file. If you intend to run as root, you can set user=root in the config file to avoid this message. +accountpool | 2023-08-31 04:06:20,739 INFO supervisord started with pid 1 +accountpool | 2023-08-31 04:06:21,742 INFO spawned: 'generator' with pid 10 +accountpool | 2023-08-31 04:06:21,744 INFO spawned: 'server' with pid 11 +accountpool | 2023-08-31 04:06:21,746 INFO spawned: 'tester' with pid 12 +accountpool | 2023-08-31 04:06:21.990 | DEBUG | accountpool.scheduler:run_tester:31 - tester loop 0 start... +accountpool | 2023-08-31 04:06:21.990 | DEBUG | accountpool.scheduler:run_generator:46 - getter loop 0 start... +accountpool | * Running on all addresses. +accountpool | WARNING: This is a development server. Do not use it in a production deployment. +accountpool | * Running on http://172.24.0.3:6777/ (Press CTRL+C to quit) +accountpool | 2023-08-31 04:06:22.004 | DEBUG | accountpool.processors.generator:run:39 - start to run generator +accountpool | 2023-08-31 04:06:22.005 | DEBUG | accountpool.processors.generator:run:43 - start to generate credential of admin1 +accountpool | 2023-08-31 04:06:23,007 INFO success: generator entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +accountpool | 2023-08-31 04:06:23,007 INFO success: server entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +accountpool | 2023-08-31 04:06:23,007 INFO success: tester entered RUNNING state, process has stayed up for > than 1 seconds (startsecs) +``` + +可以看到 Redis、Generator、Server、Tester 都已经启动成功。 + +另外还需要导入一些账号信息到 Redis 数据库里面,由于已经用 Docker 启动了 Redis 数据库,运行在 6333 端口上。 + +这时候可以执行脚本: + +``` +export REDIS_PORT=6333 +python3 importer.py antispider7 +``` + +运行完成之后如果没有报错就说明账号导入成功了,可以自行连上 Redis 看下。 + +过一会访问 [http://localhost:6777/antispider7/random](http://localhost:6777/antispider7/random) 即可获取一个 [antispider7](https://antispider7.scrape.center) 的随机可用 Cookies。 + +## 常规方式运行 + +如果不使用 Docker 运行,配置好 Python、Redis 环境之后也可运行,步骤如下。 + +### 安装和配置 Redis + +本地安装 Redis、Docker 启动 Redis、远程 Redis 都是可以的,只要能正常连接使用即可。 + +首先可以需要一下环境变量,代理池会通过环境变量读取这些值。 + +设置 Redis 的环境变量有两种方式,一种是分别设置 host、port、password,另一种是设置连接字符串,设置方法分别如下: + +设置 host、port、password,如果 password 为空可以设置为空字符串,示例如下: + +```shell script +export REDIS_HOST='localhost' +export REDIS_PORT=6379 +export REDIS_PASSWORD='' +export REDIS_DB=0 +``` + +或者只设置连接字符串: + +```shell script +export REDIS_CONNECTION_STRING='redis://[password]@host:port/db' +``` + +如果没有密码也要设置为: + +```shell script +export REDIS_CONNECTION_STRING='redis://@host:port/db' +``` + +这里连接字符串的格式需要符合 `redis://[password]@host:port/db` 的格式,注意不要遗漏 `@`。 + +以上两种设置任选其一即可。 + +### 安装依赖包 + +这里强烈推荐使用 [Conda](https://docs.conda.io/projects/conda/en/latest/user-guide/tasks/manage-environments.html#creating-an-environment-with-commands) +或 [virtualenv](https://virtualenv.pypa.io/en/latest/user_guide.html) 创建虚拟环境,Python 版本不低于 3.6。 + +然后 pip 安装依赖即可: + +```shell script +pip3 install -r requirements.txt +``` + +### 运行代理池 + +两种方式运行账号池,一种是 Tester、Generator、Server 全部运行,另一种是按需分别运行。 + +一般来说可以选择全部运行,命令如下: + +```shell script +python3 run.py +``` + +运行之后会启动 Tester、Generator、Server,这时访问 [http://localhost:6777//random](http://localhost:6777//random) 即可获取一个随机可用代理。 + +或者如果你弄清楚了账号池的架构,可以按需分别运行,命令如下: + +```shell script +python3 run.py --processor getter +python3 run.py --processor tester +python3 run.py --processor server +``` + +这里 processor 可以指定运行 Tester、Generator 还是 Server。 + +## 可配置项 + +账号池可以通过设置环境变量来配置一些参数。 + +### 开关 + +- ENABLE_TESTER:允许 Tester 启动,默认 true +- ENABLE_GENERATOR:允许 Generator 启动,默认 true +- ENABLE_SERVER:运行 Server 启动,默认 true + +### 环境 + +- APP_ENV:运行环境,可以设置 dev、test、prod,即开发、测试、生产环境,默认 dev +- APP_DEBUG:调试模式,可以设置 true 或 false,默认 true + +### Redis 连接 + +- REDIS_HOST:Redis 的 Host +- REDIS_PORT:Redis 的端口 +- REDIS_PASSWORD:Redis 的密码 +- REDIS_DB:Redis 的数据库索引,如 0、1 +- REDIS_CONNECTION_STRING:Redis 连接字符串 +- REDIS_KEY:Redis 储存代理使用字典的名称 + +### 处理器 + +- CYCLE_TESTER:Tester 运行周期,即间隔多久运行一次测试,默认 20 秒 +- CYCLE_GETTER:Getter 运行周期,即间隔多久运行一次代理获取,默认 100 秒 +- API_HOST:代理 Server 运行 Host,默认 0.0.0.0 +- API_PORT:代理 Server 运行端口,默认 6777 +- API_THREADED:代理 Server 是否使用多线程,默认 true + +### 日志 + +- LOG_DIR:日志相对路径 +- LOG_RUNTIME_FILE:运行日志文件名称 +- LOG_ERROR_FILE:错误日志文件名称 + +## 部署 + +本项目提供了 Kubernetes 部署脚本,如需部署到 Kubernetes,执行如下命令即可: + +```shell script +cat deployment.yml | sed 's/\${TAG}/latest/g' | kubectl apply -f - +``` + +## 待开发 + +- [ ] 前端页面管理 +- [ ] 使用情况统计分析 + +如有一起开发的兴趣可以在 Issue 留言,非常感谢! + +## LICENSE + +MIT diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/__init__.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/exceptions/__init__.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/exceptions/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/exceptions/init.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/exceptions/init.py new file mode 100644 index 0000000..bcf9b3e --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/exceptions/init.py @@ -0,0 +1,7 @@ +class InitException(Exception): + def __str__(self): + """ + init error + :return: + """ + return repr('init failed') diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/__init__.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/generator.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/generator.py new file mode 100644 index 0000000..ec656e3 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/generator.py @@ -0,0 +1,114 @@ +from accountpool.exceptions.init import InitException +from accountpool.storages.redis import RedisClient +from loguru import logger + + +class BaseGenerator(object): + def __init__(self, website=None): + """ + init base generator + :param website: name of website + """ + self.website = website + if not self.website: + raise InitException + self.account_operator = RedisClient(type='account', website=self.website) + self.credential_operator = RedisClient(type='credential', website=self.website) + + # 所有子类重写generate方法,写自己的生成逻辑 + def generate(self, username, password): + """ + generate method + :param username: username + :param password: password + :return: + """ + # 这里直接抛出了NotImplementedError异常,因此子类必须实现该方法,否则运行时会报错 + raise NotImplementedError + + def init(self): + """ + do init + """ + pass + + # 模板代码设计模式,写标准的run流程 + def run(self): + """ + run main process + :return: + """ + self.init() + logger.debug('start to run generator') + for username, password in self.account_operator.all().items(): + if self.credential_operator.get(username): + continue + logger.debug(f'start to generate credential of {username}') + self.generate(username, password) + + +import requests + + +class Antispider6Generator(BaseGenerator): + + def init(self): + """ + do init + """ + if self.account_operator.count() == 0: + self.account_operator.set('admin', 'admin') + self.account_operator.set('admin2', 'admin2') + + def generate(self, username, password): + """ + generate main process + """ + if self.credential_operator.get(username): + logger.debug(f'credential of {username} exists, skip') + return + login_url = 'https://antispider6.scrape.center/login' + s = requests.Session() + # 这里省去了注册账号的过程 + s.post(login_url, data={ + 'username': username, + 'password': password + }) + result = [] + for cookie in s.cookies: + print(cookie.name, cookie.value) + result.append(f'{cookie.name}={cookie.value}') + result = ';'.join(result) + logger.debug(f'get credential {result}') + self.credential_operator.set(username, result) + + +class Antispider7Generator(BaseGenerator): + MAX_COUNT = 100 + + def init(self): + """ + do init + """ + for i in range(1, self.MAX_COUNT + 1): + self.account_operator.set(f'admin{i}', f'admin{i}') + + def generate(self, username, password): + """ + generate main process + """ + if self.credential_operator.get(username): + logger.debug(f'credential of {username} exists, skip') + return + login_url = 'https://antispider7.scrape.center/api/login' + s = requests.Session() + r = s.post(login_url, json={ + 'username': username, + 'password': password + }) + if r.status_code != 200: + logger.error(f'error occurred while generating credential of {username}, error code {r.status_code}') + return + token = r.json().get('token') + logger.debug(f'get credential {token}') + self.credential_operator.set(username, token) diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/server.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/server.py new file mode 100644 index 0000000..f334a53 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/server.py @@ -0,0 +1,70 @@ +import json +from flask import Flask, g +from accountpool.storages.redis import RedisClient +from accountpool.setting import GENERATOR_MAP +from loguru import logger + +__all__ = ['app'] + +app = Flask(__name__) + +account = 'account' +credential = 'credential' + + +@app.route('/') +def index(): + return '

    Welcome to Account Pool System

    ' + + +def get_conn(): + """ + get connection + :return: + """ + for website in GENERATOR_MAP: + if not hasattr(g, website): + # 这里的get和set本质上可以看成建立一个map + setattr(g, f'{website}_{credential}', RedisClient(credential, website)) + setattr(g, f'{website}_{account}', RedisClient(account, website)) + return g + + +@app.route('//random') +def random(website): + """ + ger random credential /weibo/random + :return: random credential + """ + g = get_conn() + result = getattr(g, f'{website}_{credential}').random() + logger.debug(f'get credential {result}') + return result + + +@app.route('//add//') +def add(website, username, password): + """ + add account /weibo/add/user/password + :param website: website + :param username: username + :param password: password + :return: + """ + g = get_conn() + getattr(g, f'{website}_{account}').set(username, password) + return json.dumps({'status': '1'}) + + +@app.route('//count') +def count(website): + """ + get count of credential + """ + g = get_conn() + count = getattr(g, f'{website}_{credential}').count() + return json.dumps({'status': 'ok', 'count': count}) + + +if __name__ == '__main__': + app.run(host='0.0.0.0') diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/tester.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/tester.py new file mode 100644 index 0000000..7cc44d9 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/processors/tester.py @@ -0,0 +1,90 @@ +import json +import requests +from requests.exceptions import ConnectionError +from accountpool.storages.redis import * +from accountpool.exceptions.init import InitException +from loguru import logger + + +class BaseTester(object): + """ + base tester + """ + + def __init__(self, website=None): + """ + init base tester + """ + self.website = website + if not self.website: + raise InitException + self.account_operator = RedisClient(type='account', website=self.website) + self.credential_operator = RedisClient(type='credential', website=self.website) + + def test(self, username, credential): + """ + test single credential + """ + raise NotImplementedError + + def run(self): + """ + test all credentials + """ + credentials = self.credential_operator.all() + for username, credential in credentials.items(): + self.test(username, credential) + + +class Antispider6Tester(BaseTester): + """ + tester for antispider6 + """ + + def __init__(self, website=None): + BaseTester.__init__(self, website) + + def test(self, username, credential): + """ + test single credential + """ + logger.info(f'testing credential for {username}') + try: + test_url = TEST_URL_MAP[self.website] + response = requests.get(test_url, headers={ + 'Cookie': credential + }, timeout=5, allow_redirects=False) + if response.status_code == 200: + logger.info('credential is valid') + else: + logger.info('credential is not valid, delete it') + self.credential_operator.delete(username) + except ConnectionError: + logger.info('test failed') + + +class Antispider7Tester(BaseTester): + """ + tester for antispider7 + """ + + def __init__(self, website=None): + BaseTester.__init__(self, website) + + def test(self, username, credential): + """ + test single credential + """ + logger.info(f'testing credential for {username}') + try: + test_url = TEST_URL_MAP[self.website] + response = requests.get(test_url, headers={ + 'authorization': f'jwt {credential}' + }, timeout=5, allow_redirects=False) + if response.status_code == 200: + logger.info('credential is valid') + else: + logger.info('credential is not valid, delete it') + self.credential_operator.delete(username) + except ConnectionError: + logger.info('test failed') diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/scheduler.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/scheduler.py new file mode 100644 index 0000000..12f5b9d --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/scheduler.py @@ -0,0 +1,95 @@ +import time +import multiprocessing +from accountpool.processors.server import app +from accountpool.processors import generator as generators +from accountpool.processors import tester as testers +from accountpool.setting import CYCLE_GENERATOR, CYCLE_TESTER, API_HOST, API_THREADED, API_PORT, ENABLE_SERVER, \ + ENABLE_GENERATOR, ENABLE_TESTER, IS_WINDOWS, TESTER_MAP, GENERATOR_MAP +from loguru import logger + +if IS_WINDOWS: + multiprocessing.freeze_support() + +tester_process, generator_process, server_process = None, None, None + + +class Scheduler(object): + """ + scheduler + """ + + def run_tester(self, website, cycle=CYCLE_TESTER): + """ + run tester + """ + if not ENABLE_TESTER: + logger.info('tester not enabled, exit') + return + tester = getattr(testers, TESTER_MAP[website])(website) + loop = 0 + while True: + logger.debug(f'tester loop {loop} start...') + tester.run() + loop += 1 + time.sleep(cycle) + + def run_generator(self, website, cycle=CYCLE_GENERATOR): + """ + run getter + """ + if not ENABLE_GENERATOR: + logger.info('getter not enabled, exit') + return + generator = getattr(generators, GENERATOR_MAP[website])(website) + loop = 0 + while True: + logger.debug(f'getter loop {loop} start...') + generator.run() + loop += 1 + time.sleep(cycle) + + def run_server(self, _): + """ + run server for api + """ + if not ENABLE_SERVER: + logger.info('server not enabled, exit') + return + app.run(host=API_HOST, port=API_PORT, threaded=API_THREADED) + + def run(self, website): + global tester_process, generator_process, server_process + try: + logger.info(f'starting account pool for website {website}...') + if ENABLE_TESTER: + tester_process = multiprocessing.Process(target=self.run_tester, args=(website,)) + logger.info(f'starting tester, pid {tester_process.pid}...') + tester_process.start() + + if ENABLE_GENERATOR: + generator_process = multiprocessing.Process(target=self.run_generator, args=(website,)) + logger.info(f'starting getter, pid{generator_process.pid}...') + generator_process.start() + + if ENABLE_SERVER: + server_process = multiprocessing.Process(target=self.run_server, args=(website,)) + logger.info(f'starting server, pid{server_process.pid}...') + server_process.start() + + tester_process.join() + generator_process.join() + server_process.join() + except KeyboardInterrupt: + logger.info('received keyboard interrupt signal') + tester_process.terminate() + generator_process.terminate() + server_process.terminate() + finally: + # must call join method before calling is_alive + tester_process.join() + generator_process.join() + server_process.join() + logger.info(f'tester is {"alive" if tester_process.is_alive() else "dead"}') + logger.info(f'getter is {"alive" if generator_process.is_alive() else "dead"}') + logger.info(f'server is {"alive" if server_process.is_alive() else "dead"}') + logger.info('accountpool terminated') diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/setting.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/setting.py new file mode 100644 index 0000000..3176275 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/setting.py @@ -0,0 +1,83 @@ +import platform +from os.path import dirname, abspath, join +from environs import Env +from loguru import logger +from accountpool.utils.parse import parse_redis_connection_string + +env = Env() +env.read_env() + +# definition of flags +IS_WINDOWS = platform.system().lower() == 'windows' + +# definition of dirs +ROOT_DIR = dirname(dirname(abspath(__file__))) +LOG_DIR = join(ROOT_DIR, env.str('LOG_DIR', 'logs')) + +# definition of environments +DEV_MODE, TEST_MODE, PROD_MODE = 'dev', 'test', 'prod' +APP_ENV = env.str('APP_ENV', DEV_MODE).lower() +APP_DEBUG = env.bool('APP_DEBUG', True if APP_ENV == DEV_MODE else False) +APP_DEV = IS_DEV = APP_ENV == DEV_MODE +APP_PROD = IS_PROD = APP_ENV == PROD_MODE +APP_TEST = IS_TEST = APP_ENV == TEST_MODE + +# redis host +REDIS_HOST = env.str('REDIS_HOST', '127.0.0.1') +# redis port +REDIS_PORT = env.int('REDIS_PORT', 6379) +# redis password, if no password, set it to None +REDIS_PASSWORD = env.str('REDIS_PASSWORD', None) +# redis db, if no choice, set it to 0 +REDIS_DB = env.int('REDIS_DB', 0) +# redis connection string, like redis://[password]@host:port or rediss://[password]@host:port/0 +REDIS_CONNECTION_STRING = env.str('REDIS_CONNECTION_STRING', None) + +if REDIS_CONNECTION_STRING: + REDIS_HOST, REDIS_PORT, REDIS_PASSWORD, REDIS_DB = parse_redis_connection_string(REDIS_CONNECTION_STRING) + +# redis hash table key name +REDIS_ACCOUNT_KEY = env.str('REDIS_ACCOUNT_KEY', 'accounts:%s') +REDIS_CREDENTIAL_KEY = env.str('REDIS_CREDENTIAL_KEY', 'credential:%s') + +# integrated generator +GENERATOR_MAP = { + 'antispider6': 'Antispider6Generator', + 'antispider7': 'Antispider7Generator' +} + +# integrated tester +TESTER_MAP = { + 'antispider6': 'Antispider6Tester', + 'antispider7': 'Antispider7Tester', +} + +# definition of tester cycle, it will test every CYCLE_TESTER second +CYCLE_TESTER = env.int('CYCLE_TESTER', 600) +# definition of getter cycle, it will get proxy every CYCLE_GENERATOR second +CYCLE_GENERATOR = env.int('CYCLE_GENERATOR', 600) +GET_TIMEOUT = env.int('GET_TIMEOUT', 10) + +# definition of tester +TEST_URL = env.str('TEST_URL', 'http://www.baidu.com') +TEST_TIMEOUT = env.int('TEST_TIMEOUT', 10) +TEST_BATCH = env.int('TEST_BATCH', 20) +# test url +TEST_URL_MAP = { + 'antispider6': 'https://antispider6.scrape.center/', + 'antispider7': 'https://antispider7.scrape.center/' +} + +# definition of api +API_HOST = env.str('API_HOST', '0.0.0.0') +API_PORT = env.int('API_PORT', 6789) +API_THREADED = env.bool('API_THREADED', True) + +# flags of enable +ENABLE_TESTER = env.bool('ENABLE_TESTER', True) +ENABLE_GENERATOR = env.bool('ENABLE_GENERATOR', True) +ENABLE_SERVER = env.bool('ENABLE_SERVER', True) + +logger.add(env.str('LOG_RUNTIME_FILE', join(LOG_DIR, 'runtime.log')), level='DEBUG', rotation='1 week', + retention='20 days') +logger.add(env.str('LOG_ERROR_FILE', join(LOG_DIR, 'error.log')), level='ERROR', rotation='1 week') diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/storages/__init__.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/storages/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/storages/redis.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/storages/redis.py new file mode 100644 index 0000000..10f7441 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/storages/redis.py @@ -0,0 +1,84 @@ +import random +import redis +from accountpool.setting import * + + +class RedisClient(object): + """ + redis client + """ + + def __init__(self, type, website, host=REDIS_HOST, port=REDIS_PORT, password=REDIS_PASSWORD): + """ + type: 是存储的account信息;还是Cookie相关信息 + website: 爬取的对应网站 + init redis client + :param host: redis host + :param port: redis port + :param password: redis password + """ + self.db = redis.StrictRedis(host=host, port=port, password=password, decode_responses=True) + self.type = type + self.website = website + + # 这里的name相当于redis-key + def name(self): + """ + 这里是做二级分类,二级hash,方便存取 + get hash name + :return: name of hash + """ + return f'{self.type}:{self.website}' + + def set(self, username, value): + """ + set key-value + :param username: username + :param value: password or cookies + :return: + """ + return self.db.hset(self.name(), username, value) + + def get(self, username): + """ + get value + :param username: username + :return: + """ + return self.db.hget(self.name(), username) + + def delete(self, username): + """ + delete key-value + :param username: username + :return: result + """ + return self.db.hdel(self.name(), username) + + def count(self): + """ + get count + :return: count + """ + return self.db.hlen(self.name()) + + def random(self): + """ + get random cookies or password + :return: random cookies or password + """ + return random.choice(self.db.hvals(self.name())) + + def usernames(self): + """ + get all usernames + :return: all usernames + """ + return self.db.hkeys(self.name()) + + def all(self): + """ + get all key-values + :return: map of key-values + """ + return self.db.hgetall(self.name()) diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/utils/__init__.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/utils/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/utils/parse.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/utils/parse.py new file mode 100644 index 0000000..b3f42f5 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/accountpool/utils/parse.py @@ -0,0 +1,13 @@ +import re + +def parse_redis_connection_string(connection_string): + """ + parse a redis connection string, for example: + redis://[password]@host:port + rediss://[password]@host:port + :param connection_string: + :return: + """ + result = re.match('rediss?:\/\/(.*?)@(.*?):(\d+)\/(\d+)', connection_string) + return result.group(2), int(result.group(3)), (result.group(1) or None), (result.group(4) or 0) if result \ + else ('localhost', 6379, None) diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/deployment.yml b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/deployment.yml new file mode 100644 index 0000000..1173c2e --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/deployment.yml @@ -0,0 +1,99 @@ +apiVersion: v1 +kind: Namespace +metadata: + creationTimestamp: null + name: accountpool +--- +apiVersion: v1 +kind: PersistentVolumeClaim +metadata: + name: accountpool + namespace: accountpool +spec: + storageClassName: azure-file + accessModes: + - ReadWriteMany + resources: + requests: + storage: 2Gi +--- +apiVersion: v1 +items: + - apiVersion: v1 + kind: Service + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yml -o deployment.yml + kompose.version: 1.20.0 () + creationTimestamp: null + labels: + io.kompose.service: accountpool + name: accountpool + namespace: accountpool + spec: + ports: + - name: "6777" + port: 6777 + targetPort: 6777 + selector: + io.kompose.service: accountpool + status: + loadBalancer: {} + - apiVersion: apps/v1 + kind: Deployment + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yml -o deployment.yml + kompose.version: 1.20.0 () + creationTimestamp: null + labels: + io.kompose.service: accountpool + name: accountpool + namespace: accountpool + spec: + replicas: 2 + revisionHistoryLimit: 1 + strategy: {} + selector: + matchLabels: + io.kompose.service: accountpool + template: + metadata: + annotations: + kompose.cmd: kompose convert -f docker-compose.yml -o deployment.yml + kompose.version: 1.20.0 () + creationTimestamp: null + labels: + io.kompose.service: accountpool + spec: + containers: + - env: + - name: REDIS_CONNECTION_STRING + valueFrom: + secretKeyRef: + name: redis + key: connection_string + - name: REDIS_PORT + value: '6379' + image: germey/accountpool:${TAG} + name: accountpool + resources: + limits: + memory: "500Mi" + cpu: "300m" + requests: + memory: "500Mi" + cpu: "300m" + ports: + - containerPort: 6777 + volumeMounts: + - mountPath: "/app/accountpool/logs" + name: accountpool + restartPolicy: Always + volumes: + - name: accountpool + persistentVolumeClaim: + claimName: pvc-accountpool + status: {} +kind: List +metadata: {} diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/docker-compose.yml b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/docker-compose.yml new file mode 100644 index 0000000..d2e7044 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/docker-compose.yml @@ -0,0 +1,19 @@ +version: '3' +services: + redis4accountpool: + image: redis:alpine + container_name: redis4accountpool + command: redis-server + ports: + - "6333:6379" + accountpool: + build: . + image: 'germey/accountpool' + container_name: accountpool + ports: + - "6777:6777" + environment: + REDIS_HOST: redis4accountpool + REDIS_PORT: "6379" + API_PORT: "6777" + WEBSITE: antispider7 \ No newline at end of file diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/importer.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/importer.py new file mode 100644 index 0000000..926995b --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/importer.py @@ -0,0 +1,15 @@ +from accountpool.storages.redis import RedisClient +import argparse + +# 将生成的账号导入账号池 +parser = argparse.ArgumentParser(description='AccountPool') +parser.add_argument('website', type=str, help='website') +args = parser.parse_args() +website = args.website + +conn = RedisClient('account', args.website) +start = 1 +end = 100 +for i in range(start, end + 1): + username = password = f'admin{i}' + conn.set(username, password) diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/register.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/register.py new file mode 100644 index 0000000..544f1a8 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/register.py @@ -0,0 +1,30 @@ +import argparse +from acinonyx import run +import requests +from loguru import logger + +# 具体用法参考:https://pypi.org/project/acinonyx/ +# This is a script for registering account for antispider7, using acinonyx to accelerate. + +parser = argparse.ArgumentParser(description='AccountPool') +parser.add_argument('website', type=str, help='website') +args = parser.parse_args() +website = args.website + + +@logger.catch() +def register(username, password): + logger.debug(f'register using {username} and {password}') + response = requests.post(f'https://{website}.scrape.center/api/register', json={ + 'username': username, + 'password': password + }) + print(response.json()) + + +if __name__ == '__main__': + accounts = [] + # 注册 + for index in range(1, 1000): + accounts.append((f'admin{index}', f'admin{index}')) + run(register, accounts) diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/requirements.txt b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/requirements.txt new file mode 100644 index 0000000..fdd46fd --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/requirements.txt @@ -0,0 +1,8 @@ +requests==2.13.0 +selenium==3.4.0 +redis==2.10.5 +Flask==1.1.4 +environs==7.2.0 +loguru==0.3.2 +supervisor==4.1.0 +MarkupSafe==2.0.1 diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/run.py b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/run.py new file mode 100644 index 0000000..3d88310 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/run.py @@ -0,0 +1,15 @@ +from accountpool.scheduler import Scheduler +import argparse + +parser = argparse.ArgumentParser(description='AccountPool') +parser.add_argument('website', type=str, help='website') +parser.add_argument('--processor', type=str, help='processor to run') +args = parser.parse_args() +website = args.website + +if __name__ == '__main__': + # if processor set, just run it + if args.processor: + getattr(Scheduler(), f'run_{args.processor}')(website) + else: + Scheduler().run(website) diff --git a/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/supervisord.conf b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/supervisord.conf new file mode 100644 index 0000000..6d9fd15 --- /dev/null +++ b/Spider/Chapter10_模拟登录/大规模账号池的搭建/AccountPool/supervisord.conf @@ -0,0 +1,29 @@ +[supervisord] +nodaemon=true + +[program:tester] +process_name=tester +command=python3 run.py %(ENV_WEBSITE)s --processor tester +directory=/app +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + +[program:generator] +process_name=generator +command=python3 run.py %(ENV_WEBSITE)s --processor generator +directory=/app +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 + +[program:server] +process_name=server +command=python3 run.py %(ENV_WEBSITE)s --processor server +directory=/app +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/__init__.py b/Spider/Chapter11_JavaScript逆向/__init__.py new file mode 100644 index 0000000..05cf47e --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2024/1/11 16:45 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/hook技术/__init__.py b/Spider/Chapter11_JavaScript逆向/hook技术/__init__.py new file mode 100644 index 0000000..cc55313 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/hook技术/__init__.py @@ -0,0 +1,8 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2024/01/12 15:50 +@Usage : +@Desc : +''' diff --git a/Spider/Chapter11_JavaScript逆向/hook技术/hookTest.js b/Spider/Chapter11_JavaScript逆向/hook技术/hookTest.js new file mode 100644 index 0000000..e11eae7 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/hook技术/hookTest.js @@ -0,0 +1,17 @@ +function hook(object, attr) { + var func = object[attr] + object[attr] = function () { + console.log('hooked', object, attr) + var ret = func.apply(object, arguments) + debugger + return ret + } +} +hook(window, 'btoa') +const form = { + username: "admin", + password: "admin" +} + +const a = window['btoa'].apply(JSON.stringify(form)) +console.log(a) \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/python模拟执行Js/__init__.py b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/__init__.py new file mode 100644 index 0000000..71f6de1 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/__init__.py @@ -0,0 +1,8 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2024/01/12 20:04 +@Usage : +@Desc : +''' diff --git a/Spider/Chapter11_JavaScript逆向/python模拟执行Js/crypto.js b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/crypto.js new file mode 100644 index 0000000..c206e9d --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/crypto.js @@ -0,0 +1,2475 @@ +var CryptoJS; +!function (t, e) { + CryptoJS = e() + "object" == typeof exports ? + module.exports = exports = e() : "function" == typeof define && define.amd ? + define([], e) : t.CryptoJS = e() +}(this, function () { + var h, t, e, r, i, n, f, o, s, c, a, l, d, m, x, b, H, z, A, u, p, _, v, y, g, B, w, k, S, C, D, E, R, M, F, P, W, + O, I, U, K, X, L, j, N, T, q, Z, V, G, J, $, Q, Y, tt, et, rt, it, nt, ot, st, ct, at, ht, lt, ft, dt, ut, pt, + _t, vt, yt, gt, Bt, wt, kt, St, bt = bt || function (l) { + var t; + if ("undefined" != typeof window && window.crypto && (t = window.crypto), + !t && "undefined" != typeof window && window.msCrypto && (t = window.msCrypto), + !t && "undefined" != typeof global && global.crypto && (t = global.crypto), + !t && "function" == typeof require) + try { + t = require("crypto") + } catch (t) { + } + + function i() { + if (t) { + if ("function" == typeof t.getRandomValues) + try { + return t.getRandomValues(new Uint32Array(1))[0] + } catch (t) { + } + if ("function" == typeof t.randomBytes) + try { + return t.randomBytes(4).readInt32LE() + } catch (t) { + } + } + throw new Error("Native crypto module could not be used to get secure random number.") + } + + var r = Object.create || function (t) { + var e; + return n.prototype = t, + e = new n, + n.prototype = null, + e + } + ; + + function n() { + } + + var e = {} + , o = e.lib = {} + , s = o.Base = { + extend: function (t) { + var e = r(this); + return t && e.mixIn(t), + e.hasOwnProperty("init") && this.init !== e.init || (e.init = function () { + e.$super.init.apply(this, arguments) + } + ), + (e.init.prototype = e).$super = this, + e + }, + create: function () { + var t = this.extend(); + return t.init.apply(t, arguments), + t + }, + init: function () { + }, + mixIn: function (t) { + for (var e in t) + t.hasOwnProperty(e) && (this[e] = t[e]); + t.hasOwnProperty("toString") && (this.toString = t.toString) + }, + clone: function () { + return this.init.prototype.extend(this) + } + } + , f = o.WordArray = s.extend({ + init: function (t, e) { + t = this.words = t || [], + this.sigBytes = null != e ? e : 4 * t.length + }, + toString: function (t) { + return (t || a).stringify(this) + }, + concat: function (t) { + var e = this.words + , r = t.words + , i = this.sigBytes + , n = t.sigBytes; + if (this.clamp(), + i % 4) + for (var o = 0; o < n; o++) { + var s = r[o >>> 2] >>> 24 - o % 4 * 8 & 255; + e[i + o >>> 2] |= s << 24 - (i + o) % 4 * 8 + } + else + for (o = 0; o < n; o += 4) + e[i + o >>> 2] = r[o >>> 2]; + return this.sigBytes += n, + this + }, + clamp: function () { + var t = this.words + , e = this.sigBytes; + t[e >>> 2] &= 4294967295 << 32 - e % 4 * 8, + t.length = l.ceil(e / 4) + }, + clone: function () { + var t = s.clone.call(this); + return t.words = this.words.slice(0), + t + }, + random: function (t) { + for (var e = [], r = 0; r < t; r += 4) + e.push(i()); + return new f.init(e, t) + } + }) + , c = e.enc = {} + , a = c.Hex = { + stringify: function (t) { + for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n++) { + var o = e[n >>> 2] >>> 24 - n % 4 * 8 & 255; + i.push((o >>> 4).toString(16)), + i.push((15 & o).toString(16)) + } + return i.join("") + }, + parse: function (t) { + for (var e = t.length, r = [], i = 0; i < e; i += 2) + r[i >>> 3] |= parseInt(t.substr(i, 2), 16) << 24 - i % 8 * 4; + return new f.init(r, e / 2) + } + } + , h = c.Latin1 = { + stringify: function (t) { + for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n++) { + var o = e[n >>> 2] >>> 24 - n % 4 * 8 & 255; + i.push(String.fromCharCode(o)) + } + return i.join("") + }, + parse: function (t) { + for (var e = t.length, r = [], i = 0; i < e; i++) + r[i >>> 2] |= (255 & t.charCodeAt(i)) << 24 - i % 4 * 8; + return new f.init(r, e) + } + } + , d = c.Utf8 = { + stringify: function (t) { + try { + return decodeURIComponent(escape(h.stringify(t))) + } catch (t) { + throw new Error("Malformed UTF-8 data") + } + }, + parse: function (t) { + return h.parse(unescape(encodeURIComponent(t))) + } + } + , u = o.BufferedBlockAlgorithm = s.extend({ + reset: function () { + this._data = new f.init, + this._nDataBytes = 0 + }, + _append: function (t) { + "string" == typeof t && (t = d.parse(t)), + this._data.concat(t), + this._nDataBytes += t.sigBytes + }, + _process: function (t) { + var e, r = this._data, i = r.words, n = r.sigBytes, o = this.blockSize, s = n / (4 * o), + c = (s = t ? l.ceil(s) : l.max((0 | s) - this._minBufferSize, 0)) * o, a = l.min(4 * c, n); + if (c) { + for (var h = 0; h < c; h += o) + this._doProcessBlock(i, h); + e = i.splice(0, c), + r.sigBytes -= a + } + return new f.init(e, a) + }, + clone: function () { + var t = s.clone.call(this); + return t._data = this._data.clone(), + t + }, + _minBufferSize: 0 + }) + , p = (o.Hasher = u.extend({ + cfg: s.extend(), + init: function (t) { + this.cfg = this.cfg.extend(t), + this.reset() + }, + reset: function () { + u.reset.call(this), + this._doReset() + }, + update: function (t) { + return this._append(t), + this._process(), + this + }, + finalize: function (t) { + return t && this._append(t), + this._doFinalize() + }, + blockSize: 16, + _createHelper: function (r) { + return function (t, e) { + return new r.init(e).finalize(t) + } + }, + _createHmacHelper: function (r) { + return function (t, e) { + return new p.HMAC.init(r, e).finalize(t) + } + } + }), + e.algo = {}); + return e + }(Math); + + function mt(t, e, r) { + return t ^ e ^ r + } + + function xt(t, e, r) { + return t & e | ~t & r + } + + function Ht(t, e, r) { + return (t | ~e) ^ r + } + + function zt(t, e, r) { + return t & r | e & ~r + } + + function At(t, e, r) { + return t ^ (e | ~r) + } + + function Ct(t, e) { + return t << e | t >>> 32 - e + } + + function Dt(t, e, r, i) { + var n, o = this._iv; + o ? (n = o.slice(0), + this._iv = void 0) : n = this._prevBlock, + i.encryptBlock(n, 0); + for (var s = 0; s < r; s++) + t[e + s] ^= n[s] + } + + function Et(t) { + if (255 == (t >> 24 & 255)) { + var e = t >> 16 & 255 + , r = t >> 8 & 255 + , i = 255 & t; + 255 === e ? (e = 0, + 255 === r ? (r = 0, + 255 === i ? i = 0 : ++i) : ++r) : ++e, + t = 0, + t += e << 16, + t += r << 8, + t += i + } else + t += 1 << 24; + return t + } + + function Rt() { + for (var t = this._X, e = this._C, r = 0; r < 8; r++) + ft[r] = e[r]; + e[0] = e[0] + 1295307597 + this._b | 0, + e[1] = e[1] + 3545052371 + (e[0] >>> 0 < ft[0] >>> 0 ? 1 : 0) | 0, + e[2] = e[2] + 886263092 + (e[1] >>> 0 < ft[1] >>> 0 ? 1 : 0) | 0, + e[3] = e[3] + 1295307597 + (e[2] >>> 0 < ft[2] >>> 0 ? 1 : 0) | 0, + e[4] = e[4] + 3545052371 + (e[3] >>> 0 < ft[3] >>> 0 ? 1 : 0) | 0, + e[5] = e[5] + 886263092 + (e[4] >>> 0 < ft[4] >>> 0 ? 1 : 0) | 0, + e[6] = e[6] + 1295307597 + (e[5] >>> 0 < ft[5] >>> 0 ? 1 : 0) | 0, + e[7] = e[7] + 3545052371 + (e[6] >>> 0 < ft[6] >>> 0 ? 1 : 0) | 0, + this._b = e[7] >>> 0 < ft[7] >>> 0 ? 1 : 0; + for (r = 0; r < 8; r++) { + var i = t[r] + e[r] + , n = 65535 & i + , o = i >>> 16 + , s = ((n * n >>> 17) + n * o >>> 15) + o * o + , c = ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0); + dt[r] = s ^ c + } + t[0] = dt[0] + (dt[7] << 16 | dt[7] >>> 16) + (dt[6] << 16 | dt[6] >>> 16) | 0, + t[1] = dt[1] + (dt[0] << 8 | dt[0] >>> 24) + dt[7] | 0, + t[2] = dt[2] + (dt[1] << 16 | dt[1] >>> 16) + (dt[0] << 16 | dt[0] >>> 16) | 0, + t[3] = dt[3] + (dt[2] << 8 | dt[2] >>> 24) + dt[1] | 0, + t[4] = dt[4] + (dt[3] << 16 | dt[3] >>> 16) + (dt[2] << 16 | dt[2] >>> 16) | 0, + t[5] = dt[5] + (dt[4] << 8 | dt[4] >>> 24) + dt[3] | 0, + t[6] = dt[6] + (dt[5] << 16 | dt[5] >>> 16) + (dt[4] << 16 | dt[4] >>> 16) | 0, + t[7] = dt[7] + (dt[6] << 8 | dt[6] >>> 24) + dt[5] | 0 + } + + function Mt() { + for (var t = this._X, e = this._C, r = 0; r < 8; r++) + wt[r] = e[r]; + e[0] = e[0] + 1295307597 + this._b | 0, + e[1] = e[1] + 3545052371 + (e[0] >>> 0 < wt[0] >>> 0 ? 1 : 0) | 0, + e[2] = e[2] + 886263092 + (e[1] >>> 0 < wt[1] >>> 0 ? 1 : 0) | 0, + e[3] = e[3] + 1295307597 + (e[2] >>> 0 < wt[2] >>> 0 ? 1 : 0) | 0, + e[4] = e[4] + 3545052371 + (e[3] >>> 0 < wt[3] >>> 0 ? 1 : 0) | 0, + e[5] = e[5] + 886263092 + (e[4] >>> 0 < wt[4] >>> 0 ? 1 : 0) | 0, + e[6] = e[6] + 1295307597 + (e[5] >>> 0 < wt[5] >>> 0 ? 1 : 0) | 0, + e[7] = e[7] + 3545052371 + (e[6] >>> 0 < wt[6] >>> 0 ? 1 : 0) | 0, + this._b = e[7] >>> 0 < wt[7] >>> 0 ? 1 : 0; + for (r = 0; r < 8; r++) { + var i = t[r] + e[r] + , n = 65535 & i + , o = i >>> 16 + , s = ((n * n >>> 17) + n * o >>> 15) + o * o + , c = ((4294901760 & i) * i | 0) + ((65535 & i) * i | 0); + kt[r] = s ^ c + } + t[0] = kt[0] + (kt[7] << 16 | kt[7] >>> 16) + (kt[6] << 16 | kt[6] >>> 16) | 0, + t[1] = kt[1] + (kt[0] << 8 | kt[0] >>> 24) + kt[7] | 0, + t[2] = kt[2] + (kt[1] << 16 | kt[1] >>> 16) + (kt[0] << 16 | kt[0] >>> 16) | 0, + t[3] = kt[3] + (kt[2] << 8 | kt[2] >>> 24) + kt[1] | 0, + t[4] = kt[4] + (kt[3] << 16 | kt[3] >>> 16) + (kt[2] << 16 | kt[2] >>> 16) | 0, + t[5] = kt[5] + (kt[4] << 8 | kt[4] >>> 24) + kt[3] | 0, + t[6] = kt[6] + (kt[5] << 16 | kt[5] >>> 16) + (kt[4] << 16 | kt[4] >>> 16) | 0, + t[7] = kt[7] + (kt[6] << 8 | kt[6] >>> 24) + kt[5] | 0 + } + + return h = bt.lib.WordArray, + bt.enc.Base64 = { + stringify: function (t) { + var e = t.words + , r = t.sigBytes + , i = this._map; + t.clamp(); + for (var n = [], o = 0; o < r; o += 3) + for (var s = (e[o >>> 2] >>> 24 - o % 4 * 8 & 255) << 16 | (e[o + 1 >>> 2] >>> 24 - (o + 1) % 4 * 8 & 255) << 8 | e[o + 2 >>> 2] >>> 24 - (o + 2) % 4 * 8 & 255, c = 0; c < 4 && o + .75 * c < r; c++) + n.push(i.charAt(s >>> 6 * (3 - c) & 63)); + var a = i.charAt(64); + if (a) + for (; n.length % 4;) + n.push(a); + return n.join("") + }, + parse: function (t) { + var e = t.length + , r = this._map + , i = this._reverseMap; + if (!i) { + i = this._reverseMap = []; + for (var n = 0; n < r.length; n++) + i[r.charCodeAt(n)] = n + } + var o = r.charAt(64); + if (o) { + var s = t.indexOf(o); + -1 !== s && (e = s) + } + return function (t, e, r) { + for (var i = [], n = 0, o = 0; o < e; o++) + if (o % 4) { + var s = r[t.charCodeAt(o - 1)] << o % 4 * 2 + , c = r[t.charCodeAt(o)] >>> 6 - o % 4 * 2 + , a = s | c; + i[n >>> 2] |= a << 24 - n % 4 * 8, + n++ + } + return h.create(i, n) + }(t, e, i) + }, + _map: "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=" + }, + function (l) { + var t = bt + , e = t.lib + , r = e.WordArray + , i = e.Hasher + , n = t.algo + , H = []; + !function () { + for (var t = 0; t < 64; t++) + H[t] = 4294967296 * l.abs(l.sin(t + 1)) | 0 + }(); + var o = n.MD5 = i.extend({ + _doReset: function () { + this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878]) + }, + _doProcessBlock: function (t, e) { + for (var r = 0; r < 16; r++) { + var i = e + r + , n = t[i]; + t[i] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8) + } + var o = this._hash.words + , s = t[e + 0] + , c = t[e + 1] + , a = t[e + 2] + , h = t[e + 3] + , l = t[e + 4] + , f = t[e + 5] + , d = t[e + 6] + , u = t[e + 7] + , p = t[e + 8] + , _ = t[e + 9] + , v = t[e + 10] + , y = t[e + 11] + , g = t[e + 12] + , B = t[e + 13] + , w = t[e + 14] + , k = t[e + 15] + , S = o[0] + , m = o[1] + , x = o[2] + , b = o[3]; + S = z(S, m, x, b, s, 7, H[0]), + b = z(b, S, m, x, c, 12, H[1]), + x = z(x, b, S, m, a, 17, H[2]), + m = z(m, x, b, S, h, 22, H[3]), + S = z(S, m, x, b, l, 7, H[4]), + b = z(b, S, m, x, f, 12, H[5]), + x = z(x, b, S, m, d, 17, H[6]), + m = z(m, x, b, S, u, 22, H[7]), + S = z(S, m, x, b, p, 7, H[8]), + b = z(b, S, m, x, _, 12, H[9]), + x = z(x, b, S, m, v, 17, H[10]), + m = z(m, x, b, S, y, 22, H[11]), + S = z(S, m, x, b, g, 7, H[12]), + b = z(b, S, m, x, B, 12, H[13]), + x = z(x, b, S, m, w, 17, H[14]), + S = A(S, m = z(m, x, b, S, k, 22, H[15]), x, b, c, 5, H[16]), + b = A(b, S, m, x, d, 9, H[17]), + x = A(x, b, S, m, y, 14, H[18]), + m = A(m, x, b, S, s, 20, H[19]), + S = A(S, m, x, b, f, 5, H[20]), + b = A(b, S, m, x, v, 9, H[21]), + x = A(x, b, S, m, k, 14, H[22]), + m = A(m, x, b, S, l, 20, H[23]), + S = A(S, m, x, b, _, 5, H[24]), + b = A(b, S, m, x, w, 9, H[25]), + x = A(x, b, S, m, h, 14, H[26]), + m = A(m, x, b, S, p, 20, H[27]), + S = A(S, m, x, b, B, 5, H[28]), + b = A(b, S, m, x, a, 9, H[29]), + x = A(x, b, S, m, u, 14, H[30]), + S = C(S, m = A(m, x, b, S, g, 20, H[31]), x, b, f, 4, H[32]), + b = C(b, S, m, x, p, 11, H[33]), + x = C(x, b, S, m, y, 16, H[34]), + m = C(m, x, b, S, w, 23, H[35]), + S = C(S, m, x, b, c, 4, H[36]), + b = C(b, S, m, x, l, 11, H[37]), + x = C(x, b, S, m, u, 16, H[38]), + m = C(m, x, b, S, v, 23, H[39]), + S = C(S, m, x, b, B, 4, H[40]), + b = C(b, S, m, x, s, 11, H[41]), + x = C(x, b, S, m, h, 16, H[42]), + m = C(m, x, b, S, d, 23, H[43]), + S = C(S, m, x, b, _, 4, H[44]), + b = C(b, S, m, x, g, 11, H[45]), + x = C(x, b, S, m, k, 16, H[46]), + S = D(S, m = C(m, x, b, S, a, 23, H[47]), x, b, s, 6, H[48]), + b = D(b, S, m, x, u, 10, H[49]), + x = D(x, b, S, m, w, 15, H[50]), + m = D(m, x, b, S, f, 21, H[51]), + S = D(S, m, x, b, g, 6, H[52]), + b = D(b, S, m, x, h, 10, H[53]), + x = D(x, b, S, m, v, 15, H[54]), + m = D(m, x, b, S, c, 21, H[55]), + S = D(S, m, x, b, p, 6, H[56]), + b = D(b, S, m, x, k, 10, H[57]), + x = D(x, b, S, m, d, 15, H[58]), + m = D(m, x, b, S, B, 21, H[59]), + S = D(S, m, x, b, l, 6, H[60]), + b = D(b, S, m, x, y, 10, H[61]), + x = D(x, b, S, m, a, 15, H[62]), + m = D(m, x, b, S, _, 21, H[63]), + o[0] = o[0] + S | 0, + o[1] = o[1] + m | 0, + o[2] = o[2] + x | 0, + o[3] = o[3] + b | 0 + }, + _doFinalize: function () { + var t = this._data + , e = t.words + , r = 8 * this._nDataBytes + , i = 8 * t.sigBytes; + e[i >>> 5] |= 128 << 24 - i % 32; + var n = l.floor(r / 4294967296) + , o = r; + e[15 + (64 + i >>> 9 << 4)] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8), + e[14 + (64 + i >>> 9 << 4)] = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), + t.sigBytes = 4 * (e.length + 1), + this._process(); + for (var s = this._hash, c = s.words, a = 0; a < 4; a++) { + var h = c[a]; + c[a] = 16711935 & (h << 8 | h >>> 24) | 4278255360 & (h << 24 | h >>> 8) + } + return s + }, + clone: function () { + var t = i.clone.call(this); + return t._hash = this._hash.clone(), + t + } + }); + + function z(t, e, r, i, n, o, s) { + var c = t + (e & r | ~e & i) + n + s; + return (c << o | c >>> 32 - o) + e + } + + function A(t, e, r, i, n, o, s) { + var c = t + (e & i | r & ~i) + n + s; + return (c << o | c >>> 32 - o) + e + } + + function C(t, e, r, i, n, o, s) { + var c = t + (e ^ r ^ i) + n + s; + return (c << o | c >>> 32 - o) + e + } + + function D(t, e, r, i, n, o, s) { + var c = t + (r ^ (e | ~i)) + n + s; + return (c << o | c >>> 32 - o) + e + } + + t.MD5 = i._createHelper(o), + t.HmacMD5 = i._createHmacHelper(o) + }(Math), + e = (t = bt).lib, + r = e.WordArray, + i = e.Hasher, + n = t.algo, + f = [], + o = n.SHA1 = i.extend({ + _doReset: function () { + this._hash = new r.init([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) + }, + _doProcessBlock: function (t, e) { + for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], s = r[3], c = r[4], a = 0; a < 80; a++) { + if (a < 16) + f[a] = 0 | t[e + a]; + else { + var h = f[a - 3] ^ f[a - 8] ^ f[a - 14] ^ f[a - 16]; + f[a] = h << 1 | h >>> 31 + } + var l = (i << 5 | i >>> 27) + c + f[a]; + l += a < 20 ? 1518500249 + (n & o | ~n & s) : a < 40 ? 1859775393 + (n ^ o ^ s) : a < 60 ? (n & o | n & s | o & s) - 1894007588 : (n ^ o ^ s) - 899497514, + c = s, + s = o, + o = n << 30 | n >>> 2, + n = i, + i = l + } + r[0] = r[0] + i | 0, + r[1] = r[1] + n | 0, + r[2] = r[2] + o | 0, + r[3] = r[3] + s | 0, + r[4] = r[4] + c | 0 + }, + _doFinalize: function () { + var t = this._data + , e = t.words + , r = 8 * this._nDataBytes + , i = 8 * t.sigBytes; + return e[i >>> 5] |= 128 << 24 - i % 32, + e[14 + (64 + i >>> 9 << 4)] = Math.floor(r / 4294967296), + e[15 + (64 + i >>> 9 << 4)] = r, + t.sigBytes = 4 * e.length, + this._process(), + this._hash + }, + clone: function () { + var t = i.clone.call(this); + return t._hash = this._hash.clone(), + t + } + }), + t.SHA1 = i._createHelper(o), + t.HmacSHA1 = i._createHmacHelper(o), + function (n) { + var t = bt + , e = t.lib + , r = e.WordArray + , i = e.Hasher + , o = t.algo + , s = [] + , B = []; + !function () { + function t(t) { + for (var e = n.sqrt(t), r = 2; r <= e; r++) + if (!(t % r)) + return; + return 1 + } + + function e(t) { + return 4294967296 * (t - (0 | t)) | 0 + } + + for (var r = 2, i = 0; i < 64;) + t(r) && (i < 8 && (s[i] = e(n.pow(r, .5))), + B[i] = e(n.pow(r, 1 / 3)), + i++), + r++ + }(); + var w = [] + , c = o.SHA256 = i.extend({ + _doReset: function () { + this._hash = new r.init(s.slice(0)) + }, + _doProcessBlock: function (t, e) { + for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], s = r[3], c = r[4], a = r[5], h = r[6], l = r[7], f = 0; f < 64; f++) { + if (f < 16) + w[f] = 0 | t[e + f]; + else { + var d = w[f - 15] + , u = (d << 25 | d >>> 7) ^ (d << 14 | d >>> 18) ^ d >>> 3 + , p = w[f - 2] + , _ = (p << 15 | p >>> 17) ^ (p << 13 | p >>> 19) ^ p >>> 10; + w[f] = u + w[f - 7] + _ + w[f - 16] + } + var v = i & n ^ i & o ^ n & o + , y = (i << 30 | i >>> 2) ^ (i << 19 | i >>> 13) ^ (i << 10 | i >>> 22) + , + g = l + ((c << 26 | c >>> 6) ^ (c << 21 | c >>> 11) ^ (c << 7 | c >>> 25)) + (c & a ^ ~c & h) + B[f] + w[f]; + l = h, + h = a, + a = c, + c = s + g | 0, + s = o, + o = n, + n = i, + i = g + (y + v) | 0 + } + r[0] = r[0] + i | 0, + r[1] = r[1] + n | 0, + r[2] = r[2] + o | 0, + r[3] = r[3] + s | 0, + r[4] = r[4] + c | 0, + r[5] = r[5] + a | 0, + r[6] = r[6] + h | 0, + r[7] = r[7] + l | 0 + }, + _doFinalize: function () { + var t = this._data + , e = t.words + , r = 8 * this._nDataBytes + , i = 8 * t.sigBytes; + return e[i >>> 5] |= 128 << 24 - i % 32, + e[14 + (64 + i >>> 9 << 4)] = n.floor(r / 4294967296), + e[15 + (64 + i >>> 9 << 4)] = r, + t.sigBytes = 4 * e.length, + this._process(), + this._hash + }, + clone: function () { + var t = i.clone.call(this); + return t._hash = this._hash.clone(), + t + } + }); + t.SHA256 = i._createHelper(c), + t.HmacSHA256 = i._createHmacHelper(c) + }(Math), + function () { + var n = bt.lib.WordArray + , t = bt.enc; + t.Utf16 = t.Utf16BE = { + stringify: function (t) { + for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n += 2) { + var o = e[n >>> 2] >>> 16 - n % 4 * 8 & 65535; + i.push(String.fromCharCode(o)) + } + return i.join("") + }, + parse: function (t) { + for (var e = t.length, r = [], i = 0; i < e; i++) + r[i >>> 1] |= t.charCodeAt(i) << 16 - i % 2 * 16; + return n.create(r, 2 * e) + } + }; + + function s(t) { + return t << 8 & 4278255360 | t >>> 8 & 16711935 + } + + t.Utf16LE = { + stringify: function (t) { + for (var e = t.words, r = t.sigBytes, i = [], n = 0; n < r; n += 2) { + var o = s(e[n >>> 2] >>> 16 - n % 4 * 8 & 65535); + i.push(String.fromCharCode(o)) + } + return i.join("") + }, + parse: function (t) { + for (var e = t.length, r = [], i = 0; i < e; i++) + r[i >>> 1] |= s(t.charCodeAt(i) << 16 - i % 2 * 16); + return n.create(r, 2 * e) + } + } + }(), + function () { + if ("function" == typeof ArrayBuffer) { + var t = bt.lib.WordArray + , n = t.init; + (t.init = function (t) { + if (t instanceof ArrayBuffer && (t = new Uint8Array(t)), + (t instanceof Int8Array || "undefined" != typeof Uint8ClampedArray && t instanceof Uint8ClampedArray || t instanceof Int16Array || t instanceof Uint16Array || t instanceof Int32Array || t instanceof Uint32Array || t instanceof Float32Array || t instanceof Float64Array) && (t = new Uint8Array(t.buffer, t.byteOffset, t.byteLength)), + t instanceof Uint8Array) { + for (var e = t.byteLength, r = [], i = 0; i < e; i++) + r[i >>> 2] |= t[i] << 24 - i % 4 * 8; + n.call(this, r, e) + } else + n.apply(this, arguments) + } + ).prototype = t + } + }(), + Math, + c = (s = bt).lib, + a = c.WordArray, + l = c.Hasher, + d = s.algo, + m = a.create([0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 7, 4, 13, 1, 10, 6, 15, 3, 12, 0, 9, 5, 2, 14, 11, 8, 3, 10, 14, 4, 9, 15, 8, 1, 2, 7, 0, 6, 13, 11, 5, 12, 1, 9, 11, 10, 0, 8, 12, 4, 13, 3, 7, 15, 14, 5, 6, 2, 4, 0, 5, 9, 7, 12, 2, 10, 14, 1, 3, 8, 11, 6, 15, 13]), + x = a.create([5, 14, 7, 0, 9, 2, 11, 4, 13, 6, 15, 8, 1, 10, 3, 12, 6, 11, 3, 7, 0, 13, 5, 10, 14, 15, 8, 12, 4, 9, 1, 2, 15, 5, 1, 3, 7, 14, 6, 9, 11, 8, 12, 2, 10, 0, 4, 13, 8, 6, 4, 1, 3, 11, 15, 0, 5, 12, 2, 13, 9, 7, 10, 14, 12, 15, 10, 4, 1, 5, 8, 7, 6, 2, 13, 14, 0, 3, 9, 11]), + b = a.create([11, 14, 15, 12, 5, 8, 7, 9, 11, 13, 14, 15, 6, 7, 9, 8, 7, 6, 8, 13, 11, 9, 7, 15, 7, 12, 15, 9, 11, 7, 13, 12, 11, 13, 6, 7, 14, 9, 13, 15, 14, 8, 13, 6, 5, 12, 7, 5, 11, 12, 14, 15, 14, 15, 9, 8, 9, 14, 5, 6, 8, 6, 5, 12, 9, 15, 5, 11, 6, 8, 13, 12, 5, 12, 13, 14, 11, 8, 5, 6]), + H = a.create([8, 9, 9, 11, 13, 15, 15, 5, 7, 7, 8, 11, 14, 14, 12, 6, 9, 13, 15, 7, 12, 8, 9, 11, 7, 7, 12, 7, 6, 15, 13, 11, 9, 7, 15, 11, 8, 6, 6, 14, 12, 13, 5, 14, 13, 13, 7, 5, 15, 5, 8, 11, 14, 14, 6, 14, 6, 9, 12, 9, 12, 5, 15, 8, 8, 5, 12, 9, 12, 5, 14, 6, 8, 13, 6, 5, 15, 13, 11, 11]), + z = a.create([0, 1518500249, 1859775393, 2400959708, 2840853838]), + A = a.create([1352829926, 1548603684, 1836072691, 2053994217, 0]), + u = d.RIPEMD160 = l.extend({ + _doReset: function () { + this._hash = a.create([1732584193, 4023233417, 2562383102, 271733878, 3285377520]) + }, + _doProcessBlock: function (t, e) { + for (var r = 0; r < 16; r++) { + var i = e + r + , n = t[i]; + t[i] = 16711935 & (n << 8 | n >>> 24) | 4278255360 & (n << 24 | n >>> 8) + } + var o, s, c, a, h, l, f, d, u, p, _, v = this._hash.words, y = z.words, g = A.words, B = m.words, + w = x.words, k = b.words, S = H.words; + l = o = v[0], + f = s = v[1], + d = c = v[2], + u = a = v[3], + p = h = v[4]; + for (r = 0; r < 80; r += 1) + _ = o + t[e + B[r]] | 0, + _ += r < 16 ? mt(s, c, a) + y[0] : r < 32 ? xt(s, c, a) + y[1] : r < 48 ? Ht(s, c, a) + y[2] : r < 64 ? zt(s, c, a) + y[3] : At(s, c, a) + y[4], + _ = (_ = Ct(_ |= 0, k[r])) + h | 0, + o = h, + h = a, + a = Ct(c, 10), + c = s, + s = _, + _ = l + t[e + w[r]] | 0, + _ += r < 16 ? At(f, d, u) + g[0] : r < 32 ? zt(f, d, u) + g[1] : r < 48 ? Ht(f, d, u) + g[2] : r < 64 ? xt(f, d, u) + g[3] : mt(f, d, u) + g[4], + _ = (_ = Ct(_ |= 0, S[r])) + p | 0, + l = p, + p = u, + u = Ct(d, 10), + d = f, + f = _; + _ = v[1] + c + u | 0, + v[1] = v[2] + a + p | 0, + v[2] = v[3] + h + l | 0, + v[3] = v[4] + o + f | 0, + v[4] = v[0] + s + d | 0, + v[0] = _ + }, + _doFinalize: function () { + var t = this._data + , e = t.words + , r = 8 * this._nDataBytes + , i = 8 * t.sigBytes; + e[i >>> 5] |= 128 << 24 - i % 32, + e[14 + (64 + i >>> 9 << 4)] = 16711935 & (r << 8 | r >>> 24) | 4278255360 & (r << 24 | r >>> 8), + t.sigBytes = 4 * (e.length + 1), + this._process(); + for (var n = this._hash, o = n.words, s = 0; s < 5; s++) { + var c = o[s]; + o[s] = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8) + } + return n + }, + clone: function () { + var t = l.clone.call(this); + return t._hash = this._hash.clone(), + t + } + }), + s.RIPEMD160 = l._createHelper(u), + s.HmacRIPEMD160 = l._createHmacHelper(u), + p = bt.lib.Base, + _ = bt.enc.Utf8, + bt.algo.HMAC = p.extend({ + init: function (t, e) { + t = this._hasher = new t.init, + "string" == typeof e && (e = _.parse(e)); + var r = t.blockSize + , i = 4 * r; + e.sigBytes > i && (e = t.finalize(e)), + e.clamp(); + for (var n = this._oKey = e.clone(), o = this._iKey = e.clone(), s = n.words, c = o.words, a = 0; a < r; a++) + s[a] ^= 1549556828, + c[a] ^= 909522486; + n.sigBytes = o.sigBytes = i, + this.reset() + }, + reset: function () { + var t = this._hasher; + t.reset(), + t.update(this._iKey) + }, + update: function (t) { + return this._hasher.update(t), + this + }, + finalize: function (t) { + var e = this._hasher + , r = e.finalize(t); + return e.reset(), + e.finalize(this._oKey.clone().concat(r)) + } + }), + y = (v = bt).lib, + g = y.Base, + B = y.WordArray, + w = v.algo, + k = w.SHA1, + S = w.HMAC, + C = w.PBKDF2 = g.extend({ + cfg: g.extend({ + keySize: 4, + hasher: k, + iterations: 1 + }), + init: function (t) { + this.cfg = this.cfg.extend(t) + }, + compute: function (t, e) { + for (var r = this.cfg, i = S.create(r.hasher, t), n = B.create(), o = B.create([1]), s = n.words, c = o.words, a = r.keySize, h = r.iterations; s.length < a;) { + var l = i.update(e).finalize(o); + i.reset(); + for (var f = l.words, d = f.length, u = l, p = 1; p < h; p++) { + u = i.finalize(u), + i.reset(); + for (var _ = u.words, v = 0; v < d; v++) + f[v] ^= _[v] + } + n.concat(l), + c[0]++ + } + return n.sigBytes = 4 * a, + n + } + }), + v.PBKDF2 = function (t, e, r) { + return C.create(r).compute(t, e) + } + , + E = (D = bt).lib, + R = E.Base, + M = E.WordArray, + F = D.algo, + P = F.MD5, + W = F.EvpKDF = R.extend({ + cfg: R.extend({ + keySize: 4, + hasher: P, + iterations: 1 + }), + init: function (t) { + this.cfg = this.cfg.extend(t) + }, + compute: function (t, e) { + for (var r, i = this.cfg, n = i.hasher.create(), o = M.create(), s = o.words, c = i.keySize, a = i.iterations; s.length < c;) { + r && n.update(r), + r = n.update(t).finalize(e), + n.reset(); + for (var h = 1; h < a; h++) + r = n.finalize(r), + n.reset(); + o.concat(r) + } + return o.sigBytes = 4 * c, + o + } + }), + D.EvpKDF = function (t, e, r) { + return W.create(r).compute(t, e) + } + , + I = (O = bt).lib.WordArray, + U = O.algo, + K = U.SHA256, + X = U.SHA224 = K.extend({ + _doReset: function () { + this._hash = new I.init([3238371032, 914150663, 812702999, 4144912697, 4290775857, 1750603025, 1694076839, 3204075428]) + }, + _doFinalize: function () { + var t = K._doFinalize.call(this); + return t.sigBytes -= 4, + t + } + }), + O.SHA224 = K._createHelper(X), + O.HmacSHA224 = K._createHmacHelper(X), + L = bt.lib, + j = L.Base, + N = L.WordArray, + (T = bt.x64 = {}).Word = j.extend({ + init: function (t, e) { + this.high = t, + this.low = e + } + }), + T.WordArray = j.extend({ + init: function (t, e) { + t = this.words = t || [], + this.sigBytes = null != e ? e : 8 * t.length + }, + toX32: function () { + for (var t = this.words, e = t.length, r = [], i = 0; i < e; i++) { + var n = t[i]; + r.push(n.high), + r.push(n.low) + } + return N.create(r, this.sigBytes) + }, + clone: function () { + for (var t = j.clone.call(this), e = t.words = this.words.slice(0), r = e.length, i = 0; i < r; i++) + e[i] = e[i].clone(); + return t + } + }), + function (d) { + var t = bt + , e = t.lib + , u = e.WordArray + , i = e.Hasher + , l = t.x64.Word + , r = t.algo + , C = [] + , D = [] + , E = []; + !function () { + for (var t = 1, e = 0, r = 0; r < 24; r++) { + C[t + 5 * e] = (r + 1) * (r + 2) / 2 % 64; + var i = (2 * t + 3 * e) % 5; + t = e % 5, + e = i + } + for (t = 0; t < 5; t++) + for (e = 0; e < 5; e++) + D[t + 5 * e] = e + (2 * t + 3 * e) % 5 * 5; + for (var n = 1, o = 0; o < 24; o++) { + for (var s = 0, c = 0, a = 0; a < 7; a++) { + if (1 & n) { + var h = (1 << a) - 1; + h < 32 ? c ^= 1 << h : s ^= 1 << h - 32 + } + 128 & n ? n = n << 1 ^ 113 : n <<= 1 + } + E[o] = l.create(s, c) + } + }(); + var R = []; + !function () { + for (var t = 0; t < 25; t++) + R[t] = l.create() + }(); + var n = r.SHA3 = i.extend({ + cfg: i.cfg.extend({ + outputLength: 512 + }), + _doReset: function () { + for (var t = this._state = [], e = 0; e < 25; e++) + t[e] = new l.init; + this.blockSize = (1600 - 2 * this.cfg.outputLength) / 32 + }, + _doProcessBlock: function (t, e) { + for (var r = this._state, i = this.blockSize / 2, n = 0; n < i; n++) { + var o = t[e + 2 * n] + , s = t[e + 2 * n + 1]; + o = 16711935 & (o << 8 | o >>> 24) | 4278255360 & (o << 24 | o >>> 8), + s = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8), + (x = r[n]).high ^= s, + x.low ^= o + } + for (var c = 0; c < 24; c++) { + for (var a = 0; a < 5; a++) { + for (var h = 0, l = 0, f = 0; f < 5; f++) { + h ^= (x = r[a + 5 * f]).high, + l ^= x.low + } + var d = R[a]; + d.high = h, + d.low = l + } + for (a = 0; a < 5; a++) { + var u = R[(a + 4) % 5] + , p = R[(a + 1) % 5] + , _ = p.high + , v = p.low; + for (h = u.high ^ (_ << 1 | v >>> 31), + l = u.low ^ (v << 1 | _ >>> 31), + f = 0; f < 5; f++) { + (x = r[a + 5 * f]).high ^= h, + x.low ^= l + } + } + for (var y = 1; y < 25; y++) { + var g = (x = r[y]).high + , B = x.low + , w = C[y]; + l = w < 32 ? (h = g << w | B >>> 32 - w, + B << w | g >>> 32 - w) : (h = B << w - 32 | g >>> 64 - w, + g << w - 32 | B >>> 64 - w); + var k = R[D[y]]; + k.high = h, + k.low = l + } + var S = R[0] + , m = r[0]; + S.high = m.high, + S.low = m.low; + for (a = 0; a < 5; a++) + for (f = 0; f < 5; f++) { + var x = r[y = a + 5 * f] + , b = R[y] + , H = R[(a + 1) % 5 + 5 * f] + , z = R[(a + 2) % 5 + 5 * f]; + x.high = b.high ^ ~H.high & z.high, + x.low = b.low ^ ~H.low & z.low + } + x = r[0]; + var A = E[c]; + x.high ^= A.high, + x.low ^= A.low + } + }, + _doFinalize: function () { + var t = this._data + , e = t.words + , r = (this._nDataBytes, + 8 * t.sigBytes) + , i = 32 * this.blockSize; + e[r >>> 5] |= 1 << 24 - r % 32, + e[(d.ceil((1 + r) / i) * i >>> 5) - 1] |= 128, + t.sigBytes = 4 * e.length, + this._process(); + for (var n = this._state, o = this.cfg.outputLength / 8, s = o / 8, c = [], a = 0; a < s; a++) { + var h = n[a] + , l = h.high + , f = h.low; + l = 16711935 & (l << 8 | l >>> 24) | 4278255360 & (l << 24 | l >>> 8), + f = 16711935 & (f << 8 | f >>> 24) | 4278255360 & (f << 24 | f >>> 8), + c.push(f), + c.push(l) + } + return new u.init(c, o) + }, + clone: function () { + for (var t = i.clone.call(this), e = t._state = this._state.slice(0), r = 0; r < 25; r++) + e[r] = e[r].clone(); + return t + } + }); + t.SHA3 = i._createHelper(n), + t.HmacSHA3 = i._createHmacHelper(n) + }(Math), + function () { + var t = bt + , e = t.lib.Hasher + , r = t.x64 + , i = r.Word + , n = r.WordArray + , o = t.algo; + + function s() { + return i.create.apply(i, arguments) + } + + var mt = [s(1116352408, 3609767458), s(1899447441, 602891725), s(3049323471, 3964484399), s(3921009573, 2173295548), s(961987163, 4081628472), s(1508970993, 3053834265), s(2453635748, 2937671579), s(2870763221, 3664609560), s(3624381080, 2734883394), s(310598401, 1164996542), s(607225278, 1323610764), s(1426881987, 3590304994), s(1925078388, 4068182383), s(2162078206, 991336113), s(2614888103, 633803317), s(3248222580, 3479774868), s(3835390401, 2666613458), s(4022224774, 944711139), s(264347078, 2341262773), s(604807628, 2007800933), s(770255983, 1495990901), s(1249150122, 1856431235), s(1555081692, 3175218132), s(1996064986, 2198950837), s(2554220882, 3999719339), s(2821834349, 766784016), s(2952996808, 2566594879), s(3210313671, 3203337956), s(3336571891, 1034457026), s(3584528711, 2466948901), s(113926993, 3758326383), s(338241895, 168717936), s(666307205, 1188179964), s(773529912, 1546045734), s(1294757372, 1522805485), s(1396182291, 2643833823), s(1695183700, 2343527390), s(1986661051, 1014477480), s(2177026350, 1206759142), s(2456956037, 344077627), s(2730485921, 1290863460), s(2820302411, 3158454273), s(3259730800, 3505952657), s(3345764771, 106217008), s(3516065817, 3606008344), s(3600352804, 1432725776), s(4094571909, 1467031594), s(275423344, 851169720), s(430227734, 3100823752), s(506948616, 1363258195), s(659060556, 3750685593), s(883997877, 3785050280), s(958139571, 3318307427), s(1322822218, 3812723403), s(1537002063, 2003034995), s(1747873779, 3602036899), s(1955562222, 1575990012), s(2024104815, 1125592928), s(2227730452, 2716904306), s(2361852424, 442776044), s(2428436474, 593698344), s(2756734187, 3733110249), s(3204031479, 2999351573), s(3329325298, 3815920427), s(3391569614, 3928383900), s(3515267271, 566280711), s(3940187606, 3454069534), s(4118630271, 4000239992), s(116418474, 1914138554), s(174292421, 2731055270), s(289380356, 3203993006), s(460393269, 320620315), s(685471733, 587496836), s(852142971, 1086792851), s(1017036298, 365543100), s(1126000580, 2618297676), s(1288033470, 3409855158), s(1501505948, 4234509866), s(1607167915, 987167468), s(1816402316, 1246189591)] + , xt = []; + !function () { + for (var t = 0; t < 80; t++) + xt[t] = s() + }(); + var c = o.SHA512 = e.extend({ + _doReset: function () { + this._hash = new n.init([new i.init(1779033703, 4089235720), new i.init(3144134277, 2227873595), new i.init(1013904242, 4271175723), new i.init(2773480762, 1595750129), new i.init(1359893119, 2917565137), new i.init(2600822924, 725511199), new i.init(528734635, 4215389547), new i.init(1541459225, 327033209)]) + }, + _doProcessBlock: function (t, e) { + for (var r = this._hash.words, i = r[0], n = r[1], o = r[2], s = r[3], c = r[4], a = r[5], h = r[6], l = r[7], f = i.high, d = i.low, u = n.high, p = n.low, _ = o.high, v = o.low, y = s.high, g = s.low, B = c.high, w = c.low, k = a.high, S = a.low, m = h.high, x = h.low, b = l.high, H = l.low, z = f, A = d, C = u, D = p, E = _, R = v, M = y, F = g, P = B, W = w, O = k, I = S, U = m, K = x, X = b, L = H, j = 0; j < 80; j++) { + var N, T, q = xt[j]; + if (j < 16) + T = q.high = 0 | t[e + 2 * j], + N = q.low = 0 | t[e + 2 * j + 1]; + else { + var Z = xt[j - 15] + , V = Z.high + , G = Z.low + , J = (V >>> 1 | G << 31) ^ (V >>> 8 | G << 24) ^ V >>> 7 + , $ = (G >>> 1 | V << 31) ^ (G >>> 8 | V << 24) ^ (G >>> 7 | V << 25) + , Q = xt[j - 2] + , Y = Q.high + , tt = Q.low + , et = (Y >>> 19 | tt << 13) ^ (Y << 3 | tt >>> 29) ^ Y >>> 6 + , rt = (tt >>> 19 | Y << 13) ^ (tt << 3 | Y >>> 29) ^ (tt >>> 6 | Y << 26) + , it = xt[j - 7] + , nt = it.high + , ot = it.low + , st = xt[j - 16] + , ct = st.high + , at = st.low; + T = (T = (T = J + nt + ((N = $ + ot) >>> 0 < $ >>> 0 ? 1 : 0)) + et + ((N += rt) >>> 0 < rt >>> 0 ? 1 : 0)) + ct + ((N += at) >>> 0 < at >>> 0 ? 1 : 0), + q.high = T, + q.low = N + } + var ht, lt = P & O ^ ~P & U, ft = W & I ^ ~W & K, dt = z & C ^ z & E ^ C & E, + ut = A & D ^ A & R ^ D & R, + pt = (z >>> 28 | A << 4) ^ (z << 30 | A >>> 2) ^ (z << 25 | A >>> 7), + _t = (A >>> 28 | z << 4) ^ (A << 30 | z >>> 2) ^ (A << 25 | z >>> 7), + vt = (P >>> 14 | W << 18) ^ (P >>> 18 | W << 14) ^ (P << 23 | W >>> 9), + yt = (W >>> 14 | P << 18) ^ (W >>> 18 | P << 14) ^ (W << 23 | P >>> 9), gt = mt[j], + Bt = gt.high, wt = gt.low, kt = X + vt + ((ht = L + yt) >>> 0 < L >>> 0 ? 1 : 0), + St = _t + ut; + X = U, + L = K, + U = O, + K = I, + O = P, + I = W, + P = M + (kt = (kt = (kt = kt + lt + ((ht = ht + ft) >>> 0 < ft >>> 0 ? 1 : 0)) + Bt + ((ht = ht + wt) >>> 0 < wt >>> 0 ? 1 : 0)) + T + ((ht = ht + N) >>> 0 < N >>> 0 ? 1 : 0)) + ((W = F + ht | 0) >>> 0 < F >>> 0 ? 1 : 0) | 0, + M = E, + F = R, + E = C, + R = D, + C = z, + D = A, + z = kt + (pt + dt + (St >>> 0 < _t >>> 0 ? 1 : 0)) + ((A = ht + St | 0) >>> 0 < ht >>> 0 ? 1 : 0) | 0 + } + d = i.low = d + A, + i.high = f + z + (d >>> 0 < A >>> 0 ? 1 : 0), + p = n.low = p + D, + n.high = u + C + (p >>> 0 < D >>> 0 ? 1 : 0), + v = o.low = v + R, + o.high = _ + E + (v >>> 0 < R >>> 0 ? 1 : 0), + g = s.low = g + F, + s.high = y + M + (g >>> 0 < F >>> 0 ? 1 : 0), + w = c.low = w + W, + c.high = B + P + (w >>> 0 < W >>> 0 ? 1 : 0), + S = a.low = S + I, + a.high = k + O + (S >>> 0 < I >>> 0 ? 1 : 0), + x = h.low = x + K, + h.high = m + U + (x >>> 0 < K >>> 0 ? 1 : 0), + H = l.low = H + L, + l.high = b + X + (H >>> 0 < L >>> 0 ? 1 : 0) + }, + _doFinalize: function () { + var t = this._data + , e = t.words + , r = 8 * this._nDataBytes + , i = 8 * t.sigBytes; + return e[i >>> 5] |= 128 << 24 - i % 32, + e[30 + (128 + i >>> 10 << 5)] = Math.floor(r / 4294967296), + e[31 + (128 + i >>> 10 << 5)] = r, + t.sigBytes = 4 * e.length, + this._process(), + this._hash.toX32() + }, + clone: function () { + var t = e.clone.call(this); + return t._hash = this._hash.clone(), + t + }, + blockSize: 32 + }); + t.SHA512 = e._createHelper(c), + t.HmacSHA512 = e._createHmacHelper(c) + }(), + Z = (q = bt).x64, + V = Z.Word, + G = Z.WordArray, + J = q.algo, + $ = J.SHA512, + Q = J.SHA384 = $.extend({ + _doReset: function () { + this._hash = new G.init([new V.init(3418070365, 3238371032), new V.init(1654270250, 914150663), new V.init(2438529370, 812702999), new V.init(355462360, 4144912697), new V.init(1731405415, 4290775857), new V.init(2394180231, 1750603025), new V.init(3675008525, 1694076839), new V.init(1203062813, 3204075428)]) + }, + _doFinalize: function () { + var t = $._doFinalize.call(this); + return t.sigBytes -= 16, + t + } + }), + q.SHA384 = $._createHelper(Q), + q.HmacSHA384 = $._createHmacHelper(Q), + bt.lib.Cipher || function () { + var t = bt + , e = t.lib + , r = e.Base + , a = e.WordArray + , i = e.BufferedBlockAlgorithm + , n = t.enc + , o = (n.Utf8, + n.Base64) + , s = t.algo.EvpKDF + , c = e.Cipher = i.extend({ + cfg: r.extend(), + createEncryptor: function (t, e) { + return this.create(this._ENC_XFORM_MODE, t, e) + }, + createDecryptor: function (t, e) { + return this.create(this._DEC_XFORM_MODE, t, e) + }, + init: function (t, e, r) { + this.cfg = this.cfg.extend(r), + this._xformMode = t, + this._key = e, + this.reset() + }, + reset: function () { + i.reset.call(this), + this._doReset() + }, + process: function (t) { + return this._append(t), + this._process() + }, + finalize: function (t) { + return t && this._append(t), + this._doFinalize() + }, + keySize: 4, + ivSize: 4, + _ENC_XFORM_MODE: 1, + _DEC_XFORM_MODE: 2, + _createHelper: function (i) { + return { + encrypt: function (t, e, r) { + return h(e).encrypt(i, t, e, r) + }, + decrypt: function (t, e, r) { + return h(e).decrypt(i, t, e, r) + } + } + } + }); + + function h(t) { + return "string" == typeof t ? w : g + } + + e.StreamCipher = c.extend({ + _doFinalize: function () { + return this._process(!0) + }, + blockSize: 1 + }); + var l, f = t.mode = {}, d = e.BlockCipherMode = r.extend({ + createEncryptor: function (t, e) { + return this.Encryptor.create(t, e) + }, + createDecryptor: function (t, e) { + return this.Decryptor.create(t, e) + }, + init: function (t, e) { + this._cipher = t, + this._iv = e + } + }), u = f.CBC = ((l = d.extend()).Encryptor = l.extend({ + processBlock: function (t, e) { + var r = this._cipher + , i = r.blockSize; + p.call(this, t, e, i), + r.encryptBlock(t, e), + this._prevBlock = t.slice(e, e + i) + } + }), + l.Decryptor = l.extend({ + processBlock: function (t, e) { + var r = this._cipher + , i = r.blockSize + , n = t.slice(e, e + i); + r.decryptBlock(t, e), + p.call(this, t, e, i), + this._prevBlock = n + } + }), + l); + + function p(t, e, r) { + var i, n = this._iv; + n ? (i = n, + this._iv = void 0) : i = this._prevBlock; + for (var o = 0; o < r; o++) + t[e + o] ^= i[o] + } + + var _ = (t.pad = {}).Pkcs7 = { + pad: function (t, e) { + for (var r = 4 * e, i = r - t.sigBytes % r, n = i << 24 | i << 16 | i << 8 | i, o = [], s = 0; s < i; s += 4) + o.push(n); + var c = a.create(o, i); + t.concat(c) + }, + unpad: function (t) { + var e = 255 & t.words[t.sigBytes - 1 >>> 2]; + t.sigBytes -= e + } + } + , v = (e.BlockCipher = c.extend({ + cfg: c.cfg.extend({ + mode: u, + padding: _ + }), + reset: function () { + var t; + c.reset.call(this); + var e = this.cfg + , r = e.iv + , i = e.mode; + this._xformMode == this._ENC_XFORM_MODE ? t = i.createEncryptor : (t = i.createDecryptor, + this._minBufferSize = 1), + this._mode && this._mode.__creator == t ? this._mode.init(this, r && r.words) : (this._mode = t.call(i, this, r && r.words), + this._mode.__creator = t) + }, + _doProcessBlock: function (t, e) { + this._mode.processBlock(t, e) + }, + _doFinalize: function () { + var t, e = this.cfg.padding; + return this._xformMode == this._ENC_XFORM_MODE ? (e.pad(this._data, this.blockSize), + t = this._process(!0)) : (t = this._process(!0), + e.unpad(t)), + t + }, + blockSize: 4 + }), + e.CipherParams = r.extend({ + init: function (t) { + this.mixIn(t) + }, + toString: function (t) { + return (t || this.formatter).stringify(this) + } + })) + , y = (t.format = {}).OpenSSL = { + stringify: function (t) { + var e = t.ciphertext + , r = t.salt; + return (r ? a.create([1398893684, 1701076831]).concat(r).concat(e) : e).toString(o) + }, + parse: function (t) { + var e, r = o.parse(t), i = r.words; + return 1398893684 == i[0] && 1701076831 == i[1] && (e = a.create(i.slice(2, 4)), + i.splice(0, 4), + r.sigBytes -= 16), + v.create({ + ciphertext: r, + salt: e + }) + } + } + , g = e.SerializableCipher = r.extend({ + cfg: r.extend({ + format: y + }), + encrypt: function (t, e, r, i) { + i = this.cfg.extend(i); + var n = t.createEncryptor(r, i) + , o = n.finalize(e) + , s = n.cfg; + return v.create({ + ciphertext: o, + key: r, + iv: s.iv, + algorithm: t, + mode: s.mode, + padding: s.padding, + blockSize: t.blockSize, + formatter: i.format + }) + }, + decrypt: function (t, e, r, i) { + return i = this.cfg.extend(i), + e = this._parse(e, i.format), + t.createDecryptor(r, i).finalize(e.ciphertext) + }, + _parse: function (t, e) { + return "string" == typeof t ? e.parse(t, this) : t + } + }) + , B = (t.kdf = {}).OpenSSL = { + execute: function (t, e, r, i) { + i = i || a.random(8); + var n = s.create({ + keySize: e + r + }).compute(t, i) + , o = a.create(n.words.slice(e), 4 * r); + return n.sigBytes = 4 * e, + v.create({ + key: n, + iv: o, + salt: i + }) + } + } + , w = e.PasswordBasedCipher = g.extend({ + cfg: g.cfg.extend({ + kdf: B + }), + encrypt: function (t, e, r, i) { + var n = (i = this.cfg.extend(i)).kdf.execute(r, t.keySize, t.ivSize); + i.iv = n.iv; + var o = g.encrypt.call(this, t, e, n.key, i); + return o.mixIn(n), + o + }, + decrypt: function (t, e, r, i) { + i = this.cfg.extend(i), + e = this._parse(e, i.format); + var n = i.kdf.execute(r, t.keySize, t.ivSize, e.salt); + return i.iv = n.iv, + g.decrypt.call(this, t, e, n.key, i) + } + }) + }(), + bt.mode.CFB = ((Y = bt.lib.BlockCipherMode.extend()).Encryptor = Y.extend({ + processBlock: function (t, e) { + var r = this._cipher + , i = r.blockSize; + Dt.call(this, t, e, i, r), + this._prevBlock = t.slice(e, e + i) + } + }), + Y.Decryptor = Y.extend({ + processBlock: function (t, e) { + var r = this._cipher + , i = r.blockSize + , n = t.slice(e, e + i); + Dt.call(this, t, e, i, r), + this._prevBlock = n + } + }), + Y), + bt.mode.ECB = ((tt = bt.lib.BlockCipherMode.extend()).Encryptor = tt.extend({ + processBlock: function (t, e) { + this._cipher.encryptBlock(t, e) + } + }), + tt.Decryptor = tt.extend({ + processBlock: function (t, e) { + this._cipher.decryptBlock(t, e) + } + }), + tt), + bt.pad.AnsiX923 = { + pad: function (t, e) { + var r = t.sigBytes + , i = 4 * e + , n = i - r % i + , o = r + n - 1; + t.clamp(), + t.words[o >>> 2] |= n << 24 - o % 4 * 8, + t.sigBytes += n + }, + unpad: function (t) { + var e = 255 & t.words[t.sigBytes - 1 >>> 2]; + t.sigBytes -= e + } + }, + bt.pad.Iso10126 = { + pad: function (t, e) { + var r = 4 * e + , i = r - t.sigBytes % r; + t.concat(bt.lib.WordArray.random(i - 1)).concat(bt.lib.WordArray.create([i << 24], 1)) + }, + unpad: function (t) { + var e = 255 & t.words[t.sigBytes - 1 >>> 2]; + t.sigBytes -= e + } + }, + bt.pad.Iso97971 = { + pad: function (t, e) { + t.concat(bt.lib.WordArray.create([2147483648], 1)), + bt.pad.ZeroPadding.pad(t, e) + }, + unpad: function (t) { + bt.pad.ZeroPadding.unpad(t), + t.sigBytes-- + } + }, + bt.mode.OFB = (et = bt.lib.BlockCipherMode.extend(), + rt = et.Encryptor = et.extend({ + processBlock: function (t, e) { + var r = this._cipher + , i = r.blockSize + , n = this._iv + , o = this._keystream; + n && (o = this._keystream = n.slice(0), + this._iv = void 0), + r.encryptBlock(o, 0); + for (var s = 0; s < i; s++) + t[e + s] ^= o[s] + } + }), + et.Decryptor = rt, + et), + bt.pad.NoPadding = { + pad: function () { + }, + unpad: function () { + } + }, + it = bt.lib.CipherParams, + nt = bt.enc.Hex, + bt.format.Hex = { + stringify: function (t) { + return t.ciphertext.toString(nt) + }, + parse: function (t) { + var e = nt.parse(t); + return it.create({ + ciphertext: e + }) + } + }, + function () { + var t = bt + , e = t.lib.BlockCipher + , r = t.algo + , h = [] + , l = [] + , f = [] + , d = [] + , u = [] + , p = [] + , _ = [] + , v = [] + , y = [] + , g = []; + !function () { + for (var t = [], e = 0; e < 256; e++) + t[e] = e < 128 ? e << 1 : e << 1 ^ 283; + var r = 0 + , i = 0; + for (e = 0; e < 256; e++) { + var n = i ^ i << 1 ^ i << 2 ^ i << 3 ^ i << 4; + n = n >>> 8 ^ 255 & n ^ 99, + h[r] = n; + var o = t[l[n] = r] + , s = t[o] + , c = t[s] + , a = 257 * t[n] ^ 16843008 * n; + f[r] = a << 24 | a >>> 8, + d[r] = a << 16 | a >>> 16, + u[r] = a << 8 | a >>> 24, + p[r] = a; + a = 16843009 * c ^ 65537 * s ^ 257 * o ^ 16843008 * r; + _[n] = a << 24 | a >>> 8, + v[n] = a << 16 | a >>> 16, + y[n] = a << 8 | a >>> 24, + g[n] = a, + r ? (r = o ^ t[t[t[c ^ o]]], + i ^= t[t[i]]) : r = i = 1 + } + }(); + var B = [0, 1, 2, 4, 8, 16, 32, 64, 128, 27, 54] + , i = r.AES = e.extend({ + _doReset: function () { + if (!this._nRounds || this._keyPriorReset !== this._key) { + for (var t = this._keyPriorReset = this._key, e = t.words, r = t.sigBytes / 4, i = 4 * (1 + (this._nRounds = 6 + r)), n = this._keySchedule = [], o = 0; o < i; o++) + o < r ? n[o] = e[o] : (a = n[o - 1], + o % r ? 6 < r && o % r == 4 && (a = h[a >>> 24] << 24 | h[a >>> 16 & 255] << 16 | h[a >>> 8 & 255] << 8 | h[255 & a]) : (a = h[(a = a << 8 | a >>> 24) >>> 24] << 24 | h[a >>> 16 & 255] << 16 | h[a >>> 8 & 255] << 8 | h[255 & a], + a ^= B[o / r | 0] << 24), + n[o] = n[o - r] ^ a); + for (var s = this._invKeySchedule = [], c = 0; c < i; c++) { + o = i - c; + if (c % 4) + var a = n[o]; + else + a = n[o - 4]; + s[c] = c < 4 || o <= 4 ? a : _[h[a >>> 24]] ^ v[h[a >>> 16 & 255]] ^ y[h[a >>> 8 & 255]] ^ g[h[255 & a]] + } + } + }, + encryptBlock: function (t, e) { + this._doCryptBlock(t, e, this._keySchedule, f, d, u, p, h) + }, + decryptBlock: function (t, e) { + var r = t[e + 1]; + t[e + 1] = t[e + 3], + t[e + 3] = r, + this._doCryptBlock(t, e, this._invKeySchedule, _, v, y, g, l); + r = t[e + 1]; + t[e + 1] = t[e + 3], + t[e + 3] = r + }, + _doCryptBlock: function (t, e, r, i, n, o, s, c) { + for (var a = this._nRounds, h = t[e] ^ r[0], l = t[e + 1] ^ r[1], f = t[e + 2] ^ r[2], d = t[e + 3] ^ r[3], u = 4, p = 1; p < a; p++) { + var _ = i[h >>> 24] ^ n[l >>> 16 & 255] ^ o[f >>> 8 & 255] ^ s[255 & d] ^ r[u++] + , v = i[l >>> 24] ^ n[f >>> 16 & 255] ^ o[d >>> 8 & 255] ^ s[255 & h] ^ r[u++] + , y = i[f >>> 24] ^ n[d >>> 16 & 255] ^ o[h >>> 8 & 255] ^ s[255 & l] ^ r[u++] + , g = i[d >>> 24] ^ n[h >>> 16 & 255] ^ o[l >>> 8 & 255] ^ s[255 & f] ^ r[u++]; + h = _, + l = v, + f = y, + d = g + } + _ = (c[h >>> 24] << 24 | c[l >>> 16 & 255] << 16 | c[f >>> 8 & 255] << 8 | c[255 & d]) ^ r[u++], + v = (c[l >>> 24] << 24 | c[f >>> 16 & 255] << 16 | c[d >>> 8 & 255] << 8 | c[255 & h]) ^ r[u++], + y = (c[f >>> 24] << 24 | c[d >>> 16 & 255] << 16 | c[h >>> 8 & 255] << 8 | c[255 & l]) ^ r[u++], + g = (c[d >>> 24] << 24 | c[h >>> 16 & 255] << 16 | c[l >>> 8 & 255] << 8 | c[255 & f]) ^ r[u++]; + t[e] = _, + t[e + 1] = v, + t[e + 2] = y, + t[e + 3] = g + }, + keySize: 8 + }); + t.AES = e._createHelper(i) + }(), + function () { + var t = bt + , e = t.lib + , n = e.WordArray + , r = e.BlockCipher + , i = t.algo + , + h = [57, 49, 41, 33, 25, 17, 9, 1, 58, 50, 42, 34, 26, 18, 10, 2, 59, 51, 43, 35, 27, 19, 11, 3, 60, 52, 44, 36, 63, 55, 47, 39, 31, 23, 15, 7, 62, 54, 46, 38, 30, 22, 14, 6, 61, 53, 45, 37, 29, 21, 13, 5, 28, 20, 12, 4] + , + l = [14, 17, 11, 24, 1, 5, 3, 28, 15, 6, 21, 10, 23, 19, 12, 4, 26, 8, 16, 7, 27, 20, 13, 2, 41, 52, 31, 37, 47, 55, 30, 40, 51, 45, 33, 48, 44, 49, 39, 56, 34, 53, 46, 42, 50, 36, 29, 32] + , f = [1, 2, 4, 6, 8, 10, 12, 14, 15, 17, 19, 21, 23, 25, 27, 28] + , d = [{ + 0: 8421888, + 268435456: 32768, + 536870912: 8421378, + 805306368: 2, + 1073741824: 512, + 1342177280: 8421890, + 1610612736: 8389122, + 1879048192: 8388608, + 2147483648: 514, + 2415919104: 8389120, + 2684354560: 33280, + 2952790016: 8421376, + 3221225472: 32770, + 3489660928: 8388610, + 3758096384: 0, + 4026531840: 33282, + 134217728: 0, + 402653184: 8421890, + 671088640: 33282, + 939524096: 32768, + 1207959552: 8421888, + 1476395008: 512, + 1744830464: 8421378, + 2013265920: 2, + 2281701376: 8389120, + 2550136832: 33280, + 2818572288: 8421376, + 3087007744: 8389122, + 3355443200: 8388610, + 3623878656: 32770, + 3892314112: 514, + 4160749568: 8388608, + 1: 32768, + 268435457: 2, + 536870913: 8421888, + 805306369: 8388608, + 1073741825: 8421378, + 1342177281: 33280, + 1610612737: 512, + 1879048193: 8389122, + 2147483649: 8421890, + 2415919105: 8421376, + 2684354561: 8388610, + 2952790017: 33282, + 3221225473: 514, + 3489660929: 8389120, + 3758096385: 32770, + 4026531841: 0, + 134217729: 8421890, + 402653185: 8421376, + 671088641: 8388608, + 939524097: 512, + 1207959553: 32768, + 1476395009: 8388610, + 1744830465: 2, + 2013265921: 33282, + 2281701377: 32770, + 2550136833: 8389122, + 2818572289: 514, + 3087007745: 8421888, + 3355443201: 8389120, + 3623878657: 0, + 3892314113: 33280, + 4160749569: 8421378 + }, { + 0: 1074282512, + 16777216: 16384, + 33554432: 524288, + 50331648: 1074266128, + 67108864: 1073741840, + 83886080: 1074282496, + 100663296: 1073758208, + 117440512: 16, + 134217728: 540672, + 150994944: 1073758224, + 167772160: 1073741824, + 184549376: 540688, + 201326592: 524304, + 218103808: 0, + 234881024: 16400, + 251658240: 1074266112, + 8388608: 1073758208, + 25165824: 540688, + 41943040: 16, + 58720256: 1073758224, + 75497472: 1074282512, + 92274688: 1073741824, + 109051904: 524288, + 125829120: 1074266128, + 142606336: 524304, + 159383552: 0, + 176160768: 16384, + 192937984: 1074266112, + 209715200: 1073741840, + 226492416: 540672, + 243269632: 1074282496, + 260046848: 16400, + 268435456: 0, + 285212672: 1074266128, + 301989888: 1073758224, + 318767104: 1074282496, + 335544320: 1074266112, + 352321536: 16, + 369098752: 540688, + 385875968: 16384, + 402653184: 16400, + 419430400: 524288, + 436207616: 524304, + 452984832: 1073741840, + 469762048: 540672, + 486539264: 1073758208, + 503316480: 1073741824, + 520093696: 1074282512, + 276824064: 540688, + 293601280: 524288, + 310378496: 1074266112, + 327155712: 16384, + 343932928: 1073758208, + 360710144: 1074282512, + 377487360: 16, + 394264576: 1073741824, + 411041792: 1074282496, + 427819008: 1073741840, + 444596224: 1073758224, + 461373440: 524304, + 478150656: 0, + 494927872: 16400, + 511705088: 1074266128, + 528482304: 540672 + }, { + 0: 260, + 1048576: 0, + 2097152: 67109120, + 3145728: 65796, + 4194304: 65540, + 5242880: 67108868, + 6291456: 67174660, + 7340032: 67174400, + 8388608: 67108864, + 9437184: 67174656, + 10485760: 65792, + 11534336: 67174404, + 12582912: 67109124, + 13631488: 65536, + 14680064: 4, + 15728640: 256, + 524288: 67174656, + 1572864: 67174404, + 2621440: 0, + 3670016: 67109120, + 4718592: 67108868, + 5767168: 65536, + 6815744: 65540, + 7864320: 260, + 8912896: 4, + 9961472: 256, + 11010048: 67174400, + 12058624: 65796, + 13107200: 65792, + 14155776: 67109124, + 15204352: 67174660, + 16252928: 67108864, + 16777216: 67174656, + 17825792: 65540, + 18874368: 65536, + 19922944: 67109120, + 20971520: 256, + 22020096: 67174660, + 23068672: 67108868, + 24117248: 0, + 25165824: 67109124, + 26214400: 67108864, + 27262976: 4, + 28311552: 65792, + 29360128: 67174400, + 30408704: 260, + 31457280: 65796, + 32505856: 67174404, + 17301504: 67108864, + 18350080: 260, + 19398656: 67174656, + 20447232: 0, + 21495808: 65540, + 22544384: 67109120, + 23592960: 256, + 24641536: 67174404, + 25690112: 65536, + 26738688: 67174660, + 27787264: 65796, + 28835840: 67108868, + 29884416: 67109124, + 30932992: 67174400, + 31981568: 4, + 33030144: 65792 + }, { + 0: 2151682048, + 65536: 2147487808, + 131072: 4198464, + 196608: 2151677952, + 262144: 0, + 327680: 4198400, + 393216: 2147483712, + 458752: 4194368, + 524288: 2147483648, + 589824: 4194304, + 655360: 64, + 720896: 2147487744, + 786432: 2151678016, + 851968: 4160, + 917504: 4096, + 983040: 2151682112, + 32768: 2147487808, + 98304: 64, + 163840: 2151678016, + 229376: 2147487744, + 294912: 4198400, + 360448: 2151682112, + 425984: 0, + 491520: 2151677952, + 557056: 4096, + 622592: 2151682048, + 688128: 4194304, + 753664: 4160, + 819200: 2147483648, + 884736: 4194368, + 950272: 4198464, + 1015808: 2147483712, + 1048576: 4194368, + 1114112: 4198400, + 1179648: 2147483712, + 1245184: 0, + 1310720: 4160, + 1376256: 2151678016, + 1441792: 2151682048, + 1507328: 2147487808, + 1572864: 2151682112, + 1638400: 2147483648, + 1703936: 2151677952, + 1769472: 4198464, + 1835008: 2147487744, + 1900544: 4194304, + 1966080: 64, + 2031616: 4096, + 1081344: 2151677952, + 1146880: 2151682112, + 1212416: 0, + 1277952: 4198400, + 1343488: 4194368, + 1409024: 2147483648, + 1474560: 2147487808, + 1540096: 64, + 1605632: 2147483712, + 1671168: 4096, + 1736704: 2147487744, + 1802240: 2151678016, + 1867776: 4160, + 1933312: 2151682048, + 1998848: 4194304, + 2064384: 4198464 + }, { + 0: 128, + 4096: 17039360, + 8192: 262144, + 12288: 536870912, + 16384: 537133184, + 20480: 16777344, + 24576: 553648256, + 28672: 262272, + 32768: 16777216, + 36864: 537133056, + 40960: 536871040, + 45056: 553910400, + 49152: 553910272, + 53248: 0, + 57344: 17039488, + 61440: 553648128, + 2048: 17039488, + 6144: 553648256, + 10240: 128, + 14336: 17039360, + 18432: 262144, + 22528: 537133184, + 26624: 553910272, + 30720: 536870912, + 34816: 537133056, + 38912: 0, + 43008: 553910400, + 47104: 16777344, + 51200: 536871040, + 55296: 553648128, + 59392: 16777216, + 63488: 262272, + 65536: 262144, + 69632: 128, + 73728: 536870912, + 77824: 553648256, + 81920: 16777344, + 86016: 553910272, + 90112: 537133184, + 94208: 16777216, + 98304: 553910400, + 102400: 553648128, + 106496: 17039360, + 110592: 537133056, + 114688: 262272, + 118784: 536871040, + 122880: 0, + 126976: 17039488, + 67584: 553648256, + 71680: 16777216, + 75776: 17039360, + 79872: 537133184, + 83968: 536870912, + 88064: 17039488, + 92160: 128, + 96256: 553910272, + 100352: 262272, + 104448: 553910400, + 108544: 0, + 112640: 553648128, + 116736: 16777344, + 120832: 262144, + 124928: 537133056, + 129024: 536871040 + }, { + 0: 268435464, + 256: 8192, + 512: 270532608, + 768: 270540808, + 1024: 268443648, + 1280: 2097152, + 1536: 2097160, + 1792: 268435456, + 2048: 0, + 2304: 268443656, + 2560: 2105344, + 2816: 8, + 3072: 270532616, + 3328: 2105352, + 3584: 8200, + 3840: 270540800, + 128: 270532608, + 384: 270540808, + 640: 8, + 896: 2097152, + 1152: 2105352, + 1408: 268435464, + 1664: 268443648, + 1920: 8200, + 2176: 2097160, + 2432: 8192, + 2688: 268443656, + 2944: 270532616, + 3200: 0, + 3456: 270540800, + 3712: 2105344, + 3968: 268435456, + 4096: 268443648, + 4352: 270532616, + 4608: 270540808, + 4864: 8200, + 5120: 2097152, + 5376: 268435456, + 5632: 268435464, + 5888: 2105344, + 6144: 2105352, + 6400: 0, + 6656: 8, + 6912: 270532608, + 7168: 8192, + 7424: 268443656, + 7680: 270540800, + 7936: 2097160, + 4224: 8, + 4480: 2105344, + 4736: 2097152, + 4992: 268435464, + 5248: 268443648, + 5504: 8200, + 5760: 270540808, + 6016: 270532608, + 6272: 270540800, + 6528: 270532616, + 6784: 8192, + 7040: 2105352, + 7296: 2097160, + 7552: 0, + 7808: 268435456, + 8064: 268443656 + }, { + 0: 1048576, + 16: 33555457, + 32: 1024, + 48: 1049601, + 64: 34604033, + 80: 0, + 96: 1, + 112: 34603009, + 128: 33555456, + 144: 1048577, + 160: 33554433, + 176: 34604032, + 192: 34603008, + 208: 1025, + 224: 1049600, + 240: 33554432, + 8: 34603009, + 24: 0, + 40: 33555457, + 56: 34604032, + 72: 1048576, + 88: 33554433, + 104: 33554432, + 120: 1025, + 136: 1049601, + 152: 33555456, + 168: 34603008, + 184: 1048577, + 200: 1024, + 216: 34604033, + 232: 1, + 248: 1049600, + 256: 33554432, + 272: 1048576, + 288: 33555457, + 304: 34603009, + 320: 1048577, + 336: 33555456, + 352: 34604032, + 368: 1049601, + 384: 1025, + 400: 34604033, + 416: 1049600, + 432: 1, + 448: 0, + 464: 34603008, + 480: 33554433, + 496: 1024, + 264: 1049600, + 280: 33555457, + 296: 34603009, + 312: 1, + 328: 33554432, + 344: 1048576, + 360: 1025, + 376: 34604032, + 392: 33554433, + 408: 34603008, + 424: 0, + 440: 34604033, + 456: 1049601, + 472: 1024, + 488: 33555456, + 504: 1048577 + }, { + 0: 134219808, + 1: 131072, + 2: 134217728, + 3: 32, + 4: 131104, + 5: 134350880, + 6: 134350848, + 7: 2048, + 8: 134348800, + 9: 134219776, + 10: 133120, + 11: 134348832, + 12: 2080, + 13: 0, + 14: 134217760, + 15: 133152, + 2147483648: 2048, + 2147483649: 134350880, + 2147483650: 134219808, + 2147483651: 134217728, + 2147483652: 134348800, + 2147483653: 133120, + 2147483654: 133152, + 2147483655: 32, + 2147483656: 134217760, + 2147483657: 2080, + 2147483658: 131104, + 2147483659: 134350848, + 2147483660: 0, + 2147483661: 134348832, + 2147483662: 134219776, + 2147483663: 131072, + 16: 133152, + 17: 134350848, + 18: 32, + 19: 2048, + 20: 134219776, + 21: 134217760, + 22: 134348832, + 23: 131072, + 24: 0, + 25: 131104, + 26: 134348800, + 27: 134219808, + 28: 134350880, + 29: 133120, + 30: 2080, + 31: 134217728, + 2147483664: 131072, + 2147483665: 2048, + 2147483666: 134348832, + 2147483667: 133152, + 2147483668: 32, + 2147483669: 134348800, + 2147483670: 134217728, + 2147483671: 134219808, + 2147483672: 134350880, + 2147483673: 134217760, + 2147483674: 134219776, + 2147483675: 0, + 2147483676: 133120, + 2147483677: 2080, + 2147483678: 131104, + 2147483679: 134350848 + }] + , u = [4160749569, 528482304, 33030144, 2064384, 129024, 8064, 504, 2147483679] + , o = i.DES = r.extend({ + _doReset: function () { + for (var t = this._key.words, e = [], r = 0; r < 56; r++) { + var i = h[r] - 1; + e[r] = t[i >>> 5] >>> 31 - i % 32 & 1 + } + for (var n = this._subKeys = [], o = 0; o < 16; o++) { + var s = n[o] = [] + , c = f[o]; + for (r = 0; r < 24; r++) + s[r / 6 | 0] |= e[(l[r] - 1 + c) % 28] << 31 - r % 6, + s[4 + (r / 6 | 0)] |= e[28 + (l[r + 24] - 1 + c) % 28] << 31 - r % 6; + s[0] = s[0] << 1 | s[0] >>> 31; + for (r = 1; r < 7; r++) + s[r] = s[r] >>> 4 * (r - 1) + 3; + s[7] = s[7] << 5 | s[7] >>> 27 + } + var a = this._invSubKeys = []; + for (r = 0; r < 16; r++) + a[r] = n[15 - r] + }, + encryptBlock: function (t, e) { + this._doCryptBlock(t, e, this._subKeys) + }, + decryptBlock: function (t, e) { + this._doCryptBlock(t, e, this._invSubKeys) + }, + _doCryptBlock: function (t, e, r) { + this._lBlock = t[e], + this._rBlock = t[e + 1], + p.call(this, 4, 252645135), + p.call(this, 16, 65535), + _.call(this, 2, 858993459), + _.call(this, 8, 16711935), + p.call(this, 1, 1431655765); + for (var i = 0; i < 16; i++) { + for (var n = r[i], o = this._lBlock, s = this._rBlock, c = 0, a = 0; a < 8; a++) + c |= d[a][((s ^ n[a]) & u[a]) >>> 0]; + this._lBlock = s, + this._rBlock = o ^ c + } + var h = this._lBlock; + this._lBlock = this._rBlock, + this._rBlock = h, + p.call(this, 1, 1431655765), + _.call(this, 8, 16711935), + _.call(this, 2, 858993459), + p.call(this, 16, 65535), + p.call(this, 4, 252645135), + t[e] = this._lBlock, + t[e + 1] = this._rBlock + }, + keySize: 2, + ivSize: 2, + blockSize: 2 + }); + + function p(t, e) { + var r = (this._lBlock >>> t ^ this._rBlock) & e; + this._rBlock ^= r, + this._lBlock ^= r << t + } + + function _(t, e) { + var r = (this._rBlock >>> t ^ this._lBlock) & e; + this._lBlock ^= r, + this._rBlock ^= r << t + } + + t.DES = r._createHelper(o); + var s = i.TripleDES = r.extend({ + _doReset: function () { + var t = this._key.words; + if (2 !== t.length && 4 !== t.length && t.length < 6) + throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192."); + var e = t.slice(0, 2) + , r = t.length < 4 ? t.slice(0, 2) : t.slice(2, 4) + , i = t.length < 6 ? t.slice(0, 2) : t.slice(4, 6); + this._des1 = o.createEncryptor(n.create(e)), + this._des2 = o.createEncryptor(n.create(r)), + this._des3 = o.createEncryptor(n.create(i)) + }, + encryptBlock: function (t, e) { + this._des1.encryptBlock(t, e), + this._des2.decryptBlock(t, e), + this._des3.encryptBlock(t, e) + }, + decryptBlock: function (t, e) { + this._des3.decryptBlock(t, e), + this._des2.encryptBlock(t, e), + this._des1.decryptBlock(t, e) + }, + keySize: 6, + ivSize: 2, + blockSize: 2 + }); + t.TripleDES = r._createHelper(s) + }(), + function () { + var t = bt + , e = t.lib.StreamCipher + , r = t.algo + , i = r.RC4 = e.extend({ + _doReset: function () { + for (var t = this._key, e = t.words, r = t.sigBytes, i = this._S = [], n = 0; n < 256; n++) + i[n] = n; + n = 0; + for (var o = 0; n < 256; n++) { + var s = n % r + , c = e[s >>> 2] >>> 24 - s % 4 * 8 & 255; + o = (o + i[n] + c) % 256; + var a = i[n]; + i[n] = i[o], + i[o] = a + } + this._i = this._j = 0 + }, + _doProcessBlock: function (t, e) { + t[e] ^= n.call(this) + }, + keySize: 8, + ivSize: 0 + }); + + function n() { + for (var t = this._S, e = this._i, r = this._j, i = 0, n = 0; n < 4; n++) { + r = (r + t[e = (e + 1) % 256]) % 256; + var o = t[e]; + t[e] = t[r], + t[r] = o, + i |= t[(t[e] + t[r]) % 256] << 24 - 8 * n + } + return this._i = e, + this._j = r, + i + } + + t.RC4 = e._createHelper(i); + var o = r.RC4Drop = i.extend({ + cfg: i.cfg.extend({ + drop: 192 + }), + _doReset: function () { + i._doReset.call(this); + for (var t = this.cfg.drop; 0 < t; t--) + n.call(this) + } + }); + t.RC4Drop = e._createHelper(o) + }(), + bt.mode.CTRGladman = (ot = bt.lib.BlockCipherMode.extend(), + st = ot.Encryptor = ot.extend({ + processBlock: function (t, e) { + var r, i = this._cipher, n = i.blockSize, o = this._iv, s = this._counter; + o && (s = this._counter = o.slice(0), + this._iv = void 0), + 0 === ((r = s)[0] = Et(r[0])) && (r[1] = Et(r[1])); + var c = s.slice(0); + i.encryptBlock(c, 0); + for (var a = 0; a < n; a++) + t[e + a] ^= c[a] + } + }), + ot.Decryptor = st, + ot), + at = (ct = bt).lib.StreamCipher, + ht = ct.algo, + lt = [], + ft = [], + dt = [], + ut = ht.Rabbit = at.extend({ + _doReset: function () { + for (var t = this._key.words, e = this.cfg.iv, r = 0; r < 4; r++) + t[r] = 16711935 & (t[r] << 8 | t[r] >>> 24) | 4278255360 & (t[r] << 24 | t[r] >>> 8); + var i = this._X = [t[0], t[3] << 16 | t[2] >>> 16, t[1], t[0] << 16 | t[3] >>> 16, t[2], t[1] << 16 | t[0] >>> 16, t[3], t[2] << 16 | t[1] >>> 16] + , + n = this._C = [t[2] << 16 | t[2] >>> 16, 4294901760 & t[0] | 65535 & t[1], t[3] << 16 | t[3] >>> 16, 4294901760 & t[1] | 65535 & t[2], t[0] << 16 | t[0] >>> 16, 4294901760 & t[2] | 65535 & t[3], t[1] << 16 | t[1] >>> 16, 4294901760 & t[3] | 65535 & t[0]]; + for (r = this._b = 0; r < 4; r++) + Rt.call(this); + for (r = 0; r < 8; r++) + n[r] ^= i[r + 4 & 7]; + if (e) { + var o = e.words + , s = o[0] + , c = o[1] + , a = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8) + , h = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8) + , l = a >>> 16 | 4294901760 & h + , f = h << 16 | 65535 & a; + n[0] ^= a, + n[1] ^= l, + n[2] ^= h, + n[3] ^= f, + n[4] ^= a, + n[5] ^= l, + n[6] ^= h, + n[7] ^= f; + for (r = 0; r < 4; r++) + Rt.call(this) + } + }, + _doProcessBlock: function (t, e) { + var r = this._X; + Rt.call(this), + lt[0] = r[0] ^ r[5] >>> 16 ^ r[3] << 16, + lt[1] = r[2] ^ r[7] >>> 16 ^ r[5] << 16, + lt[2] = r[4] ^ r[1] >>> 16 ^ r[7] << 16, + lt[3] = r[6] ^ r[3] >>> 16 ^ r[1] << 16; + for (var i = 0; i < 4; i++) + lt[i] = 16711935 & (lt[i] << 8 | lt[i] >>> 24) | 4278255360 & (lt[i] << 24 | lt[i] >>> 8), + t[e + i] ^= lt[i] + }, + blockSize: 4, + ivSize: 2 + }), + ct.Rabbit = at._createHelper(ut), + bt.mode.CTR = (pt = bt.lib.BlockCipherMode.extend(), + _t = pt.Encryptor = pt.extend({ + processBlock: function (t, e) { + var r = this._cipher + , i = r.blockSize + , n = this._iv + , o = this._counter; + n && (o = this._counter = n.slice(0), + this._iv = void 0); + var s = o.slice(0); + r.encryptBlock(s, 0), + o[i - 1] = o[i - 1] + 1 | 0; + for (var c = 0; c < i; c++) + t[e + c] ^= s[c] + } + }), + pt.Decryptor = _t, + pt), + yt = (vt = bt).lib.StreamCipher, + gt = vt.algo, + Bt = [], + wt = [], + kt = [], + St = gt.RabbitLegacy = yt.extend({ + _doReset: function () { + for (var t = this._key.words, e = this.cfg.iv, r = this._X = [t[0], t[3] << 16 | t[2] >>> 16, t[1], t[0] << 16 | t[3] >>> 16, t[2], t[1] << 16 | t[0] >>> 16, t[3], t[2] << 16 | t[1] >>> 16], i = this._C = [t[2] << 16 | t[2] >>> 16, 4294901760 & t[0] | 65535 & t[1], t[3] << 16 | t[3] >>> 16, 4294901760 & t[1] | 65535 & t[2], t[0] << 16 | t[0] >>> 16, 4294901760 & t[2] | 65535 & t[3], t[1] << 16 | t[1] >>> 16, 4294901760 & t[3] | 65535 & t[0]], n = this._b = 0; n < 4; n++) + Mt.call(this); + for (n = 0; n < 8; n++) + i[n] ^= r[n + 4 & 7]; + if (e) { + var o = e.words + , s = o[0] + , c = o[1] + , a = 16711935 & (s << 8 | s >>> 24) | 4278255360 & (s << 24 | s >>> 8) + , h = 16711935 & (c << 8 | c >>> 24) | 4278255360 & (c << 24 | c >>> 8) + , l = a >>> 16 | 4294901760 & h + , f = h << 16 | 65535 & a; + i[0] ^= a, + i[1] ^= l, + i[2] ^= h, + i[3] ^= f, + i[4] ^= a, + i[5] ^= l, + i[6] ^= h, + i[7] ^= f; + for (n = 0; n < 4; n++) + Mt.call(this) + } + }, + _doProcessBlock: function (t, e) { + var r = this._X; + Mt.call(this), + Bt[0] = r[0] ^ r[5] >>> 16 ^ r[3] << 16, + Bt[1] = r[2] ^ r[7] >>> 16 ^ r[5] << 16, + Bt[2] = r[4] ^ r[1] >>> 16 ^ r[7] << 16, + Bt[3] = r[6] ^ r[3] >>> 16 ^ r[1] << 16; + for (var i = 0; i < 4; i++) + Bt[i] = 16711935 & (Bt[i] << 8 | Bt[i] >>> 24) | 4278255360 & (Bt[i] << 24 | Bt[i] >>> 8), + t[e + i] ^= Bt[i] + }, + blockSize: 4, + ivSize: 2 + }), + vt.RabbitLegacy = yt._createHelper(St), + bt.pad.ZeroPadding = { + pad: function (t, e) { + var r = 4 * e; + t.clamp(), + t.sigBytes += r - (t.sigBytes % r || r) + }, + unpad: function (t) { + var e = t.words + , r = t.sigBytes - 1; + for (r = t.sigBytes - 1; 0 <= r; r--) + if (e[r >>> 2] >>> 24 - r % 4 * 8 & 255) { + t.sigBytes = r + 1; + break + } + } + }, + bt +}); + +//模拟的getToken方法 +function getToken(player) { + let key = CryptoJS.enc.Utf8.parse("fipFfVsZsTda94hJNKJfLoaqyqMZFFimwLt") + const {name, birthday, height, weight} = player + let base64Name = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(name)) + let encrypted = CryptoJS.DES.encrypt(`${base64Name}${birthday}${height}${weight}`, key, { + mode: CryptoJS.mode.ECB, + padding: CryptoJS.pad.Pkcs7 + }) + return encrypted.toString() +} diff --git a/Spider/Chapter11_JavaScript逆向/python模拟执行Js/test.js b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/test.js new file mode 100644 index 0000000..f6f3e48 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/test.js @@ -0,0 +1,15 @@ +// const ciphertext = CryptoJS.encrypt(message, key).toString(); +// +// +// function getToken(player) { +// let key = CryptoJS.enc.Utf8.parse("fipFfVsZsTda94hJNKJfLoaqyqMZFFimwLt") +// const {name, birthday, height, weight} = player +// let base64Name = CryptoJS.enc.Base64.stringify(CryptoJS.enc.Utf8.parse(name)) +// let encrypted = CryptoJS.DES.encrypt(`${base64Name}${birthday}${height}${weight}`, key, { +// mode: CryptoJS.mode.ECB, +// padding: CryptoJS.pad.Pkcs7 +// }) +// return encrypted.toString() +// } + +!(function(a,b){console.log('result',a,b)})(1,2) diff --git a/Spider/Chapter11_JavaScript逆向/python模拟执行Js/test.py b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/test.py new file mode 100644 index 0000000..4e4fd3b --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/test.py @@ -0,0 +1,14 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2024/01/12 20:11 +@Usage : +@Desc :测试执行js的环境 +''' + +import execjs + + +print(execjs.get().name) + diff --git a/Spider/Chapter11_JavaScript逆向/python模拟执行Js/testCrypto.py b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/testCrypto.py new file mode 100644 index 0000000..c77e8e4 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/python模拟执行Js/testCrypto.py @@ -0,0 +1,30 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2024/01/12 20:28 +@Usage : +@Desc :模拟执行crypto +''' + +import execjs +import json + +player = { + "name": "凯文-杜兰特", + "image": "durant.png", + "birthday": "1988-09-29", + "height": "208cm", + "weight": "108.9KG" +} + +file = 'crypto.js' +node = execjs.get() + +ctx = node.compile(open(file).read()) + +js = f"getToken({json.dumps(player, ensure_ascii=False)})" + +print(js) +result = ctx.eval(js) +print(result) diff --git a/Spider/Chapter11_JavaScript逆向/代码混淆测试/__init__.py b/Spider/Chapter11_JavaScript逆向/代码混淆测试/__init__.py new file mode 100644 index 0000000..05db578 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/代码混淆测试/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2024/1/11 16:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo1_test.js b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo1_test.js new file mode 100644 index 0000000..d826a25 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo1_test.js @@ -0,0 +1,20 @@ +//前提:安装 npm i -D javascript-obfuscator + +const code = ` +let x = '1'+1 +console.log('x',x) +` + +const options = { + compact: false, + controlFlowFlattening: true +} + +const obfuscator = require('javascript-obfuscator') + +function obfuscate(code, options) { + return obfuscator.obfuscate(code, options).getObfuscatedCode() + +} + +console.log(obfuscate(code, options)) \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo2_CodeCompress.js b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo2_CodeCompress.js new file mode 100644 index 0000000..2b5cda6 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo2_CodeCompress.js @@ -0,0 +1,20 @@ +//代码压缩 + +const code = ` +let x = '1'+1 +console.log('x',x) +` + +const options = { + compact: true, + +} + +const obfuscator = require('javascript-obfuscator') + +function obfuscate(code, options) { + return obfuscator.obfuscate(code, options).getObfuscatedCode() + +} + +console.log(obfuscate(code, options)) \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo3_VariableMix.js b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo3_VariableMix.js new file mode 100644 index 0000000..31c896e --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo3_VariableMix.js @@ -0,0 +1,33 @@ +//变量混淆 + +// const code = ` +// let x = '1'+1 +// console.log('x',x) +// ` + +// const options = { +// compact: true, +// identifierNamesGenerator:'mangled' +// } + +// const options = { +// identifiersPrefix:'germey' +// } + + +const code = ` +var $ = function(id){ + return document.getElementById(id); +}; +` +const options = { + renameGlobals: true +} + +const obfuscator = require('javascript-obfuscator') + +function obfuscate(code, options) { + return obfuscator.obfuscate(code, options).getObfuscatedCode() +} + +console.log(obfuscate(code, options)) \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo4_stringmix.js b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo4_stringmix.js new file mode 100644 index 0000000..9d0c738 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo4_stringmix.js @@ -0,0 +1,25 @@ +//字符串混淆 +const code = ` +var a = 'hello world' +` +// const options = { +// stringArray: true, +// rotateStringArray: true, +// stringArrayEncoding: ['none'], // none, 'base64', 'rc4' +// stringArrayThreshold: 1, +// +// } + +const options = { + compact: false, + unicodeEscapeSequence: true +} + + +const obfuscator = require('javascript-obfuscator') + +function obfuscate(code, options) { + return obfuscator.obfuscate(code, options).getObfuscatedCode() +} + +console.log(obfuscate(code, options)) \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo5_codeSelfProtect.js b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo5_codeSelfProtect.js new file mode 100644 index 0000000..737e079 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo5_codeSelfProtect.js @@ -0,0 +1,17 @@ +//代码自我保护 + +const code = ` +console.log('hello world') +` + +const options = { + selfDefending: true +} + +const obfuscator = require('javascript-obfuscator') + +function obfuscate(code, options) { + return obfuscator.obfuscate(code, options).getObfuscatedCode() +} + +console.log(obfuscate(code, options)) \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo6_dead_code_injection.js b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo6_dead_code_injection.js new file mode 100644 index 0000000..31e7fea --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/代码混淆测试/demo6_dead_code_injection.js @@ -0,0 +1,22 @@ +//无用代码注入 + +const code = ` +console.log('abc'); +console.log('cde'); +console.log('efg'); +console.log('hij'); +` + +const options = { + compact: false, + deadCodeInjection: true, + deadCodeInjectionThreshold: 1 +} + +const obfuscator = require('javascript-obfuscator') + +function obfuscate(code, options) { + return obfuscator.obfuscate(code, options).getObfuscatedCode() +} + +console.log(obfuscate(code, options)) \ No newline at end of file diff --git a/Spider/Chapter11_JavaScript逆向/代码混淆测试/test.py b/Spider/Chapter11_JavaScript逆向/代码混淆测试/test.py new file mode 100644 index 0000000..f37d5e1 --- /dev/null +++ b/Spider/Chapter11_JavaScript逆向/代码混淆测试/test.py @@ -0,0 +1,13 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2024/01/12 14:28 +@Usage : +@Desc : +''' + + +a ="eyJ1c2VybmFtZSI6ImFkbWluIiwicGFzc3dvcmQiOiJhZG1pbiJ9" + +print(len(a)) \ No newline at end of file diff --git a/Spider/chapter01_线程相关/__init__.py b/Spider/chapter01_线程相关/__init__.py new file mode 100644 index 0000000..b5e1371 --- /dev/null +++ b/Spider/chapter01_线程相关/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 21:38 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/chapter01_线程相关/多线程/MyThread.py b/Spider/chapter01_线程相关/多线程/MyThread.py new file mode 100644 index 0000000..3876051 --- /dev/null +++ b/Spider/chapter01_线程相关/多线程/MyThread.py @@ -0,0 +1,81 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 20:44 +@Usage : 学习多线程库thread的使用 +@Desc : +''' + +''' +参考: +[1] https://cuiqingcai.com/3325.html +''' + +import queue as Queue +import threading +import time + +exitFlag = 0 + + +class myThread(threading.Thread): + def __init__(self, threadID, name, q): + threading.Thread.__init__(self) + self.threadID = threadID + self.name = name + self.q = q + + def run(self): + print("Starting " + self.name) + process_data(self.name, self.q) + print("Exiting " + self.name) + + +def process_data(threadName, q): + while not exitFlag: + # 获得锁,成功获得锁定后返回True + # 可选的timeout参数不填时将一直阻塞直到获得锁定 + # 否则超时后将返回False + queueLock.acquire() + if not workQueue.empty(): + data = q.get() + queueLock.release() + print("{0} processing {1}".format(threadName, data)) + else: + queueLock.release() + time.sleep(1) + + +threadList = ["Thread-1", "Thread-2", "Thread-3"] +nameList = ["One", "Two", "Three", "Four", "Five"] +queueLock = threading.Lock() +workQueue = Queue.Queue(10) +threads = [] +threadID = 1 + +# 创建新线程 +for tName in threadList: + thread = myThread(threadID, tName, workQueue) + thread.start() + threads.append(thread) + threadID += 1 + +# 填充队列 +queueLock.acquire() +for word in nameList: + workQueue.put(word) +# release一个有一个线程能跑 +queueLock.release() + +# 等待队列清空 +while not workQueue.empty(): + pass + +# 通知线程是时候退出 +exitFlag = 1 + +# 等待所有线程完成 +for t in threads: + t.join() +print("Exiting Main Thread") diff --git a/Spider/chapter01_线程相关/多线程/__init__.py b/Spider/chapter01_线程相关/多线程/__init__.py new file mode 100644 index 0000000..22e8a96 --- /dev/null +++ b/Spider/chapter01_线程相关/多线程/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 20:43 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/chapter01_线程相关/多进程/Lock.py b/Spider/chapter01_线程相关/多进程/Lock.py new file mode 100644 index 0000000..9c8bd73 --- /dev/null +++ b/Spider/chapter01_线程相关/多进程/Lock.py @@ -0,0 +1,36 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 21:08 +@Usage : Lock相关的类:访问临界资源(共享资源)时互斥 +@Desc : +''' + +''' +参考: +[1] https://cuiqingcai.com/3335.html +''' + +from multiprocessing import Process, Lock +import time + + +class MyProcess(Process): + def __init__(self, loop, lock): + Process.__init__(self) + self.loop = loop + self.lock = lock + + def run(self): + for count in range(self.loop): + time.sleep(0.1) + self.lock.acquire() + print('Pid: ' + str(self.pid) + ' LoopCount: ' + str(count)) + self.lock.release() + +if __name__ == '__main__': + lock = Lock() + for i in range(10, 15): + p = MyProcess(i, lock) + p.start() \ No newline at end of file diff --git a/Spider/chapter01_线程相关/多进程/MyMutiProcess.py b/Spider/chapter01_线程相关/多进程/MyMutiProcess.py new file mode 100644 index 0000000..c6424e4 --- /dev/null +++ b/Spider/chapter01_线程相关/多进程/MyMutiProcess.py @@ -0,0 +1,41 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 20:59 +@Usage : 学习多进程库mutiProcessing的使用 +@Desc : +''' + +''' +参考: +[1] https://cuiqingcai.com/3335.html +[2] https://blog.csdn.net/qq_38120851/article/details/122504028 +''' + +from multiprocessing import Process +import time + + +class MyProcess(Process): + def __init__(self, loop): + Process.__init__(self) + self.loop = loop + + def run(self): + for count in range(self.loop): + time.sleep(1) + print('Pid: ' + str(self.pid) + ' LoopCount: ' + str(count)) + + +if __name__ == '__main__': + # 在这里介绍一个属性,叫做 deamon。每个线程都可以单独设置它的属性,如果设置为 True,当父进程结束后,子进程会自动被终止。 + # 如果这里不join,只会打印Main process Ended! + for i in range(2, 10): + p = MyProcess(i) + p.daemon = True + p.start() + p.join() + + + print("Main process Ended!") \ No newline at end of file diff --git a/Spider/chapter01_线程相关/多进程/Semaphore.py b/Spider/chapter01_线程相关/多进程/Semaphore.py new file mode 100644 index 0000000..ea8d825 --- /dev/null +++ b/Spider/chapter01_线程相关/多进程/Semaphore.py @@ -0,0 +1,64 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 21:12 +@Usage : Semaphore相关类:可以控制临界资源的数量,保证各个进程之间的互斥和同步。 +@Desc : 尚且有问题,没法消费,程序卡住 +''' + +from multiprocessing import Process, Semaphore, Lock, Queue +import time +import random + +buffer = Queue(10) +empty = Semaphore(2) +full = Semaphore(1) +lock = Lock() + + +class Consumer(Process): + + def run(self): + global buffer, empty, full, lock + while True: + print('Consumer线程开始运行') + full.acquire() + lock.acquire() + time.sleep(1) + + print('Consumer pop an {0}'.format(buffer.get())) + time.sleep(1) + lock.release() + empty.release() + print('Consumer 释放了锁') + + +class Producer(Process): + def run(self): + global buffer, empty, full, lock + while True: + empty.acquire() + lock.acquire() + print('Producer 添加了锁') + num = random.randint(0,1) + + print('Producer append {0}'.format(num)) + buffer.put(num) + time.sleep(1) + lock.release() + full.release() + print('Producer 释放了锁') + + +if __name__ == '__main__': + p = Producer() + c = Consumer() + p.daemon = c.daemon = True + + p.start() + c.start() + + p.join() + c.join() + print('Ended!') diff --git a/Spider/chapter01_线程相关/多进程/__init__.py b/Spider/chapter01_线程相关/多进程/__init__.py new file mode 100644 index 0000000..1e345cb --- /dev/null +++ b/Spider/chapter01_线程相关/多进程/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 20:58 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/chapter01_线程相关/多进程/pool.py b/Spider/chapter01_线程相关/多进程/pool.py new file mode 100644 index 0000000..505e62d --- /dev/null +++ b/Spider/chapter01_线程相关/多进程/pool.py @@ -0,0 +1,51 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 21:28 +@Usage : pool池相关使用 +@Desc : +''' + +from multiprocessing import Lock, Pool +import time +import requests +from requests.exceptions import ConnectionError + + +def scrape(url): + try: + print(requests.get(url)) + except ConnectionError: + print('Error Occured ', url) + finally: + print('URL ', url, ' Scraped') + + +def function(index): + print('Start process: ', index) + time.sleep(3) + print('End process', index) + + +if __name__ == '__main__': + + # 异步线程池使用 + pool = Pool(processes=3) + for i in range(4): + pool.apply_async(function, (i,)) + + print("Started processes") + pool.close() + pool.join() + print("Subprocess done.") + + # 便捷的map法 + pool = Pool(processes=3) + urls = [ + 'https://www.baidu.com', + 'http://www.meituan.com/', + 'http://blog.csdn.net/', + 'http://xxxyxxx.net' + ] + pool.map(scrape, urls) diff --git a/Spider/chapter02_爬虫基本库/Practice.py b/Spider/chapter02_爬虫基本库/Practice.py new file mode 100644 index 0000000..86d3260 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/Practice.py @@ -0,0 +1,164 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/7 19:09 +@Usage : +@Desc : 一个基本的练习:爬取 https://ssr1.scrape.center 电影描述以及detail等 +''' + +import requests +import logging +import re +from urllib.parse import urljoin +from os import makedirs +from os.path import exists +from pyquery import PyQuery as pq +import json + +# 输出的日志级别 +logging.basicConfig(level=logging.INFO, + format='%(asctime)s - %(levelname)s: %(message)s') +BASE_URL = 'https://ssr1.scrape.center' +TOTAL_PAGE = 10 + +RESULTS_DIR = 'results' +exists(RESULTS_DIR) or makedirs(RESULTS_DIR) + + +def scrape_page(url): + """ + scrape page by url and return its html + :param url: page url + :return: html of page + """ + logging.info('scraping %s...', url) + try: + response = requests.get(url) + if response.status_code == 200: + return response.text + logging.error('get invalid status code %s while scraping %s', response.status_code, url) + except requests.RequestException: + logging.error('error occurred while scraping %s', url, exc_info=True) + + +def scrape_index(page): + index_url = f'{BASE_URL}/page/{page}' + return scrape_page(index_url) + + +# 从页面HTML中获取详情页坐标 +def parse_index(html): + pattern = '' + items = re.findall(pattern, html, re.S) + if not items: + return [] + for item in items: + detail_url = urljoin(BASE_URL, item) + logging.info('get detail url %s', detail_url) + yield detail_url + + +def scrape_detail(url): + return scrape_page(url) + + +def parse_detail(html): + cover_pattern = re.compile( + 'class="item.*?', re.S) + name_pattern = re.compile('(.*?)') + categories_pattern = re.compile( + '(.*?).*?', re.S) + published_at_pattern = re.compile('(\d{4}-\d{2}-\d{2})\s?上映') + drama_pattern = re.compile('.*?(.*?)

    ', re.S) + score_pattern = re.compile('(.*?)

    ', re.S) + + cover = re.search(cover_pattern, html).group( + 1).strip() if re.search(cover_pattern, html) else None + name = re.search(name_pattern, html).group( + 1).strip() if re.search(name_pattern, html) else None + categories = re.findall(categories_pattern, html) if re.findall( + categories_pattern, html) else [] + published_at = re.search(published_at_pattern, html).group( + 1) if re.search(published_at_pattern, html) else None + drama = re.search(drama_pattern, html).group( + 1).strip() if re.search(drama_pattern, html) else None + score = float(re.search(score_pattern, html).group(1).strip() + ) if re.search(score_pattern, html) else None + return { + 'cover': cover, + 'name': name, + 'categories': categories, + 'published_at': published_at, + 'drama': drama, + 'score': score + } + + +def parse_detailByPyQuery(html): + doc = pq(html) + cover = doc('img.cover').attr('src') + name = doc('a > h2').text() + categories = [item.text() for item in doc('.categories button span').items()] + published_at = doc('.info:contains(上映)').text() + published_at = re.search('(\d{4}-\d{2}-\d{2})', published_at).group(1) \ + if published_at and re.search('\d{4}-\d{2}-\d{2}', published_at) else None + drama = doc('.drama p').text() + score = doc('p.score').text() + score = float(score) if score else None + return { + 'cover': cover, + 'name': name, + 'categories': categories, + 'published_at': published_at, + 'drama': drama, + 'score': score + } + + +def save_data(data): + """ + save to json file + :param data: + :return: + """ + name = data.get('name') + data_path = f'{RESULTS_DIR}/{name}.json' + # ensure_ascii值为False,可以保证中文字符在文件内能以正常的正文文本呈现,而不是unicode + # indent为2,可以使json可以两行缩进 + json.dump(data, open(data_path, 'w', encoding='utf-8'), + ensure_ascii=False, indent=2) + + +def main(): + for page in range(1, TOTAL_PAGE): + index_html = scrape_index(page) + detail_urls = parse_index(index_html) + for detail_url in detail_urls: + data = parse_detail(scrape_detail(detail_url)) + logging.info("get detail data %s", data) + save_data(data) + logging.info("save data successfully") + + +def mainByMulti(page): + index_html = scrape_index(page) + detail_urls = parse_index(index_html) + for detail_url in detail_urls: + data = parse_detail(scrape_detail(detail_url)) + logging.info("get detail data %s", data) + save_data(data) + logging.info("save data successfully") + + +if __name__ == '__main__': + # 单进程 + # main() + # 多进程 + import multiprocessing + + pool = multiprocessing.Pool() + pages = range(1, TOTAL_PAGE) + pool.map(mainByMulti, pages) + pool.close() + pool.join() diff --git a/Spider/chapter02_爬虫基本库/__init__.py b/Spider/chapter02_爬虫基本库/__init__.py new file mode 100644 index 0000000..5c918c6 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 21:39 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/chapter02_爬虫基本库/httpx库_http2协议/__init__.py b/Spider/chapter02_爬虫基本库/httpx库_http2协议/__init__.py new file mode 100644 index 0000000..c6aeb28 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/httpx库_http2协议/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/7 18:59 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/chapter02_爬虫基本库/httpx库_http2协议/httpxLearning.py b/Spider/chapter02_爬虫基本库/httpx库_http2协议/httpxLearning.py new file mode 100644 index 0000000..8b50b09 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/httpx库_http2协议/httpxLearning.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/7 19:00 +@Usage : httpx库学习;request不支持http2.0相关协议。需要使用httpx。 +@Desc : httpx用法与request类似,具体内容参考:https://github.com/Python3WebSpider/HttpxTest +''' \ No newline at end of file diff --git a/Spider/chapter02_爬虫基本库/request库/__init__.py b/Spider/chapter02_爬虫基本库/request库/__init__.py new file mode 100644 index 0000000..47f4959 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/request库/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/7 15:51 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/chapter02_爬虫基本库/request库/requestLearning.py b/Spider/chapter02_爬虫基本库/request库/requestLearning.py new file mode 100644 index 0000000..23bb900 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/request库/requestLearning.py @@ -0,0 +1,219 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/7 15:51 +@Usage : +@Desc : request库学习 +''' + +import requests +import re +from requests.packages import urllib3 +from requests.auth import HTTPBasicAuth +from requests_oauthlib import OAuth1 + +''' +基本get使用 +''' + + +def get(): + data = { + 'name': 'germey', + 'age': 25 + } + response = requests.get('https://httpbin.org/get', params=data) + + print(response.text) + print(type(response.json())) # dict + print(response.json()) + pass + + +''' +抓取网页:使用模式匹配,抓取标题 +''' + + +def getPattern(): + response = requests.get('https://ssr1.scrape.center/') + pattern = '(.*?)' + pattern = re.compile(pattern, re.S) + titles = re.findall(pattern, response.text) + + print(titles) + + pass + + +''' +抓取二进制数据:使用模式匹配,抓取标题 +''' + + +def getBinary(): + response = requests.get('https://scrape.center/favicon.ico') + print(response.text) + print(response.content) + + with open('favicon.ico', 'wb') as f: + f.write(response.content) + + pass + + +''' +基本response的相关参数 +''' + + +def getResponse(): + response = requests.get('https://ssr1.scrape.center/') + + print(type(response.status_code), response.status_code) + print(type(response.headers), response.headers) + print(type(response.cookies), response.cookies) + print(type(response.history), response.history) + + exit() if not response.status_code == requests.codes.ok else print('Request Success!') + + +''' +基本post使用 +''' + + +def post(): + data = { + 'name': 'germey', + 'age': 25 + } + response = requests.post('https://httpbin.org/get', data=data) + + print(response.text) + + pass + + +''' +高级用法:上传文件 +''' + + +def postFile(): + file = { + 'file': open('favicon.ico', 'rb') + } + response = requests.post('https://httpbin.org/post', files=file) + + print(response.text) + + pass + + +''' +高级用法:cookie +cookie成功模拟了登录状态,这样就能爬取登录之后才能看到的页面了 +''' + + +def postCookie(): + response = requests.get('https://www.baidu.com') + print(response.cookies) + + for key, value in response.cookies.items(): + print(key, "=", value) + + pass + + +''' +Session维持: +如果第一次请求利用request库的post方法登录了某个网站,第二次想获取成功登录后自己的个人信息, +于是又用requests库的get方法区请求个人信息页面,这实际上相当于打开了两个浏览器,是两个完全独立的操作,这时需要维持Session +''' + + +def session(): + s = requests.Session() + s.get("https://www.httpbin.org/cookies/set/number/123456789") + r = s.get('https://www.httpbin.org/cookies') + print(r.text) # {"cookies": {"number": "123456789"}} + + +''' +SSL证书验证: +有些网站的HTTPS证书可能并不被CA机构认可,出现SSL证书错误 +''' + + +def SSL(): + # response = requests.get("https://ssr2.scrape.center/") + # print(response.status_code) # requests.exceptions.SSLError: HTTPSConnectionPool(host='ssr2.scrape.center', port=443): Max retries exceeded with url + + urllib3.disable_warnings() + response = requests.get("https://ssr2.scrape.center/", verify=False) + print(response.status_code) # 200 + + +''' +超时验证: +防止服务器不能即时响应 +''' + + +def timeout(): + # 设置超时时间1秒 + response = requests.get("https://www.httpbin.org/get", timeout=1) + # 如果不设置,则永久等待,如果设置为timeout=(5,30)则连接超时时间5秒,读取超时时间30秒 + print(response.status_code) + + +''' +身份认证: +在访问启用了基本身份认证的网站时,首先会弹出一个认证窗口 +''' + + +def Auth(): + # 用户名和密码都是admin + response = requests.get("https://ssr3.scrape.center/", auth=('admin', 'admin')) + + print(response.status_code) + + +''' +request还提供了其他认证方式,如OAuth认证,不过此时需要安装requests_oauthlib包 +''' +def OAuth(): + # 用户名和密码都是admin + url = 'https://api.twitter.com/1.1/account/verify_credentials.json' + auth = OAuth('your_app_key', 'your_app_sercet', 'user_oauth_token', 'user_oauth_token_secret') + response = requests.get(url, auth=auth) + + print(response.status_code) + + + +''' +代理设置: +某些网站请求几次可以正常获取内容。但一旦开始大规模爬取,可能弹出验证码或者挑战到登录认证页面等 +可以使用代理来解决这个问题 +''' +def proxy(): + # 用户名和密码都是admin + url = 'https://api.twitter.com/1.1/account/verify_credentials.json' + + proxies ={ + 'http':'http://10.10.10.10:1080', + 'https':'http://user:password@10.10.10.10:1080/' + } + + response = requests.get(url, proxy=proxies) + + print(response.status_code) + + +if __name__ == '__main__': + Auth() diff --git a/Spider/chapter02_爬虫基本库/request库/ssr1_scrape_center.html b/Spider/chapter02_爬虫基本库/request库/ssr1_scrape_center.html new file mode 100644 index 0000000..62df4f8 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/request库/ssr1_scrape_center.html @@ -0,0 +1,953 @@ + + + + + + + + Scrape | Movie + + + + + + + + +
    + + +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    霸王别姬 - Farewell My Concubine

    +
    +
    + + + + + +
    +
    + 中国内地、中国香港 + / + 171 分钟 +
    +
    + + 1993-07-26 上映 + +
    +
    +
    +

    + 9.5

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    这个杀手不太冷 - Léon

    +
    +
    + + + + + + + +
    +
    + 法国 + / + 110 分钟 +
    +
    + + 1994-09-14 上映 + +
    +
    +
    +

    + 9.5

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    肖申克的救赎 - The Shawshank Redemption

    +
    +
    + + + + + +
    +
    + 美国 + / + 142 分钟 +
    +
    + + 1994-09-10 上映 + +
    +
    +
    +

    + 9.5

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    泰坦尼克号 - Titanic

    +
    +
    + + + + + + + +
    +
    + 美国 + / + 194 分钟 +
    +
    + + 1998-04-03 上映 + +
    +
    +
    +

    + 9.5

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    罗马假日 - Roman Holiday

    +
    +
    + + + + + + + +
    +
    + 美国 + / + 118 分钟 +
    +
    + + 1953-08-20 上映 + +
    +
    +
    +

    + 9.5

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    唐伯虎点秋香 - Flirting Scholar

    +
    +
    + + + + + + + +
    +
    + 中国香港 + / + 102 分钟 +
    +
    + + 1993-07-01 上映 + +
    +
    +
    +

    + 9.5

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    乱世佳人 - Gone with the Wind

    +
    +
    + + + + + + + + + +
    +
    + 美国 + / + 238 分钟 +
    +
    + + 1939-12-15 上映 + +
    +
    +
    +

    + 9.5

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    喜剧之王 - The King of Comedy

    +
    +
    + + + + + + + +
    +
    + 中国香港 + / + 85 分钟 +
    +
    + + 1999-02-13 上映 + +
    +
    +
    +

    + 9.5

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    楚门的世界 - The Truman Show

    +
    +
    + + + + + +
    +
    + 美国 + / + 103 分钟 +
    +
    + +
    +
    +
    +

    + 9.0

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    +
    +
    +
    + + + +
    +
    + +

    狮子王 - The Lion King

    +
    +
    + + + + + + + +
    +
    + 美国 + / + 89 分钟 +
    +
    + + 1995-07-15 上映 + +
    +
    +
    +

    + 9.0

    +

    +

    + + + + + + + + + + + + + + + +
    +

    +
    +
    +
    + +
    + +
    +
    +
    + +
    +
    +
    + +
    + \ No newline at end of file diff --git a/Spider/chapter02_爬虫基本库/re库_正则匹配/__init__.py b/Spider/chapter02_爬虫基本库/re库_正则匹配/__init__.py new file mode 100644 index 0000000..42223ba --- /dev/null +++ b/Spider/chapter02_爬虫基本库/re库_正则匹配/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/7 17:30 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/chapter02_爬虫基本库/re库_正则匹配/reLearning.py b/Spider/chapter02_爬虫基本库/re库_正则匹配/reLearning.py new file mode 100644 index 0000000..524dd54 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/re库_正则匹配/reLearning.py @@ -0,0 +1,179 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/7 17:31 +@Usage : +@Desc : 正则匹配re库基本使用 +''' + +import re + +''' +基本使用 +''' + + +def baseUse(): + content = 'hello 123456789 World_This is a Reges Demo' + pattern = '^hello\s(\d+)\sWorld' + result = re.match(pattern, content) + + print(result) # + print(result.group()) # hello 123456789 World 输出匹配到的内容 + print(result.group(1)) # 123456789 输出第一个被()包围的匹配结果 + print(result.span()) # (0, 21) 输出匹配的范围 + + +# 高级用法 +''' +贪婪匹配与非贪婪匹配 +.*表示尽可能多匹配字符 +.*?表示尽可能少匹配字符 +''' + +''' +re.I 表示匹配对大小写不明感 +re.L 实现本地化识别匹配 +re.M 表示多航匹配,影响^和$ +re.S 表示匹配内容包括换行符在内的所有字符 +re.U 表示根据Unicode解析字符,这个表示会影响\w,\W,\b和\B +re.S 表示匹配内容包括换行符在内的所有字符 +''' +def prior(): + content = '''hello 123456789 World_This + is a Reges Demo + ''' + result = re.match('^he.*?(\d+).*?Demo$', content) + print(result.group(1)) # 未匹配到,报错 AttributeError: 'NoneType' object has no attribute 'group' + result = re.match('^he.*?(\d+).*?Demo$', content, re.S) + print(result.group(1)) # 123456789 + + +''' +search:模糊匹配 +''' +def search(): + content = 'Extra stings Hello 1234567 World_This is a Regex Demo Extra stings' + result = re.match('Hello.*?(\d+).*?Demo', content) # 必须要以Hello开头才能匹配到 + print(result) # None + result = re.search('Hello.*?(\d+).*?Demo', content) + print(result) # + + +def searchHtml(): + html = '''
    +

    经典老歌

    +

    + 经典老歌列表 +

    + +
    ''' + result = re.search('(.*?)', html, re.S) + if result: + print(result.group(1), result.group(2)) + + result = re.search('(.*?)', html, re.S) + if result: + print(result.group(1), result.group(2)) + + result = re.search('(.*?)', html) + if result: + print(result.group(1), result.group(2)) + +''' +findAll:找到所有匹配的 +''' +def findall(): + html = '''
    +

    经典老歌

    +

    + 经典老歌列表 +

    + +
    ''' + results = re.findall('(.*?)', html, re.S) + print(results) + print(type(results)) + for result in results: + print(result) + print(result[0], result[1], result[2]) + + results = re.findall('\s*?()?(\w+)()?\s*?', html, re.S) + for result in results: + print(result[1]) + + +''' +sub:正则匹配修改文本 +使用正则匹配,去除掉能匹配上的内容 +''' +def sub(): + html = '''
    +

    经典老歌

    +

    + 经典老歌列表 +

    + +
    ''' + html = re.sub('|', '', html) + print(html) + results = re.findall('(.*?)', html, re.S) + for result in results: + print(result.strip()) + +''' +compile:编译 +将相关模式编译成pattern对象,进行复用 +''' +def complie(): + content1 = '2019-12-15 12:00' + content2 = '2019-12-17 12:55' + content3 = '2019-12-22 13:21' + pattern = re.compile('\d{2}:\d{2}') + result1 = re.sub(pattern, '', content1) + result2 = re.sub(pattern, '', content2) + result3 = re.sub(pattern, '', content3) + print(result1, result2, result3) + +if __name__ == '__main__': + sub() diff --git a/Spider/chapter02_爬虫基本库/urllib库/__init__.py b/Spider/chapter02_爬虫基本库/urllib库/__init__.py new file mode 100644 index 0000000..5c918c6 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/urllib库/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 21:39 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/Spider/chapter02_爬虫基本库/urllib库/urllibLearning.py b/Spider/chapter02_爬虫基本库/urllib库/urllibLearning.py new file mode 100644 index 0000000..8d0b5d1 --- /dev/null +++ b/Spider/chapter02_爬虫基本库/urllib库/urllibLearning.py @@ -0,0 +1,18 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/17 21:40 +@Usage : urllib库学习 +@Desc : +''' + +import urllib.request + +# 基本使用,返回一个response对象 +# 无data即get请求;有data即post请求,data为bytes类型 +response = urllib.request.urlopen("https://www.python.org") + +print(response.status) +print(response.getheaders()) +print(response.getheader('Server')) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/Bearing1_1.npy b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/Bearing1_1.npy new file mode 100644 index 0000000..25a280f Binary files /dev/null and b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/Bearing1_1.npy differ diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_create.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_create.py new file mode 100644 index 0000000..98e1366 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_create.py @@ -0,0 +1,148 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +# 数据导入 +data = np.load("../data/HI_DATA/HI_data.npy") +print(data.shape) # (2803, 2560) +plt.plot(data[0,:]) +plt.show() +(samples, dims) = data.shape + +# # 24个指标建立 +fs = 25.6 * 1000 +T1 = np.mean(data, axis=1) +print(T1.shape) +# +T2 = np.sqrt(np.var(data, axis=1)) + +T3 = np.mean(np.sqrt(np.abs(data)), axis=1) ** 2 + +T4 = np.sqrt(np.mean(data ** 2, axis=1)) + +T5 = np.max(np.abs(data), axis=1) + +T6 = np.mean((data - np.broadcast_to(np.expand_dims(T1, axis=1), (samples, dims))) ** 3, axis=1) / (T4 ** 3) + +T7 = np.mean((data - np.broadcast_to(np.expand_dims(T1, axis=1), (samples, dims))) ** 4, axis=1) / (T4 ** 4) + +T8 = T5 / T4 + +T9 = T5 / T3 + +T10 = T4 / np.mean(np.abs(data), axis=1) + +T11 = T5 / np.mean(np.abs(data), axis=1) + +# 频域 +sk = np.abs(np.fft.rfft(data, axis=1) * 2 / dims) +sk = sk[:, 0:-1] # (2803,1280) +(samples, k) = sk.shape # (2803,1280) +print("data:", data) +print("sk:", sk) +fk = np.empty(shape=[samples, k]) + +for sample in range(samples): + for i in range(k): + fk[sample][i] = (fs / dims) * (i + 1) +# print(fk) +# print(fk.shape) +# plt.plot(sk[1,:]) +# plt.xlim((0,k)) +# plt.ylim((0,1.5)) +# plt.show() +# print(sk.shape) + +F1 = np.mean(sk, axis=1) + +F2 = np.var(sk, axis=1) * k / (k - 1) + +F3 = np.mean((sk - np.broadcast_to(np.expand_dims(F1, axis=1), (samples, k))) ** 3, axis=1) / (np.sqrt(F2) ** 3) + +F4 = np.mean((sk - np.broadcast_to(np.expand_dims(F1, axis=1), (samples, k))) ** 4, axis=1) / (F2 ** 2) + +F5 = np.sum(np.multiply(fk, sk), axis=1) / np.sum(sk, axis=1) + +F6 = np.sqrt(np.mean(np.multiply((fk - np.broadcast_to(np.expand_dims(F5, axis=1), (samples, k))) ** 2, sk), axis=1)) + +F7 = np.sqrt(np.sum(np.multiply(fk ** 2, sk), axis=1) / np.sum(sk, axis=1)) + +F8 = np.sqrt(np.sum(np.multiply(fk ** 4, sk), axis=1) / np.sum(fk ** 2 * sk, axis=1)) + +F9 = np.sum(np.multiply(fk ** 2, sk), axis=1) / np.sqrt(np.sum(sk, axis=1) * np.sum(np.multiply(fk ** 4, sk), axis=1)) + +F10 = F6 / F5 + +F11 = np.mean(np.multiply((fk - np.broadcast_to(np.expand_dims(F5, axis=1), (samples, k))) ** 3, sk), axis=1) / ( + F6 ** 3) + +F12 = np.mean(np.multiply((fk - np.broadcast_to(np.expand_dims(F5, axis=1), (samples, k))) ** 4, sk), axis=1) / ( + F6 ** 4) + +F13 = np.mean(np.sqrt(np.abs(fk - np.broadcast_to(np.expand_dims(F5, axis=1), (samples, k)))) * sk, axis=1) / np.sqrt( + F6) + +# 归一化处理 +# T1 = (T1 - np.min(T1)) / (np.max(T1) - np.min(T1)) +# T2 = (T2 - np.min(T2)) / (np.max(T2) - np.min(T2)) +# T3 = (T3 - np.min(T3)) / (np.max(T3) - np.min(T3)) +# T4 = (T4 - np.min(T4)) / (np.max(T4) - np.min(T4)) +# T5 = (T5 - np.min(T5)) / (np.max(T5) - np.min(T5)) +# T6 = (T6 - np.min(T6)) / (np.max(T6) - np.min(T6)) +# T7 = (T7 - np.min(T7)) / (np.max(T7) - np.min(T7)) +# T8 = (T8 - np.min(T8)) / (np.max(T8) - np.min(T8)) +# T9 = (T9 - np.min(T9)) / (np.max(T9) - np.min(T9)) +# T10 = (T10 - np.min(T10)) / (np.max(T10) - np.min(T10)) +# T11 = (T11 - np.min(T11)) / (np.max(T11) - np.min(T11)) +# F1 = (F1 - np.min(F1)) / (np.max(F1) - np.min(F1)) +# F2 = (F2 - np.min(F2)) / (np.max(F2) - np.min(F2)) +# F3 = (F3 - np.min(F3)) / (np.max(F3) - np.min(F3)) +# F4 = (F4 - np.min(F4)) / (np.max(F4) - np.min(F4)) +# F5 = (F5 - np.min(F5)) / (np.max(F5) - np.min(F5)) +# F6 = (F6 - np.min(F6)) / (np.max(F6) - np.min(F6)) +# F7 = (F7 - np.min(F7)) / (np.max(F7) - np.min(F7)) +# F8 = (F8 - np.min(F8)) / (np.max(F8) - np.min(F8)) +# F9 = (F9 - np.min(F9)) / (np.max(F9) - np.min(F9)) +# F10 = (F10 - np.min(F10)) / (np.max(F10) - np.min(F10)) +# F11 = (F11 - np.min(F11)) / (np.max(F11) - np.min(F11)) +# F12 = (F12 - np.min(F12)) / (np.max(F12) - np.min(F12)) +# F13 = (F13 - np.min(F13)) / (np.max(F13) - np.min(F13)) +print(F5) +plt.plot(F5) +plt.show() + +# +# if __name__ == '__main__': +# +# T1 = np.expand_dims(T1, axis=1) +# T2 = np.expand_dims(T2, axis=1) +# T3 = np.expand_dims(T3, axis=1) +# T4 = np.expand_dims(T4, axis=1) +# T5 = np.expand_dims(T5, axis=1) +# T6 = np.expand_dims(T6, axis=1) +# T7 = np.expand_dims(T7, axis=1) +# T8 = np.expand_dims(T8, axis=1) +# T9 = np.expand_dims(T9, axis=1) +# T10 = np.expand_dims(T10, axis=1) +# T11 = np.expand_dims(T11, axis=1) +# F1 = np.expand_dims(F1, axis=1) +# F2 = np.expand_dims(F2, axis=1) +# F3 = np.expand_dims(F3, axis=1) +# F4 = np.expand_dims(F4, axis=1) +# F5 = np.expand_dims(F5, axis=1) +# F6 = np.expand_dims(F6, axis=1) +# F7 = np.expand_dims(F7, axis=1) +# F8 = np.expand_dims(F8, axis=1) +# F9 = np.expand_dims(F9, axis=1) +# F10 = np.expand_dims(F10, axis=1) +# F11 = np.expand_dims(F11, axis=1) +# F12 = np.expand_dims(F12, axis=1) +# F13 = np.expand_dims(F13, axis=1) +# feature_data=tf.concat([T1,T2,T3,T4,T5,T6,T7,T8,T9,T10,T11,F1,F2,F3,F4,F5,F6,F7,F8,F9,F10,F11,F12,F13],axis=1) +# np.save('feature_data.npy',feature_data) +# print(feature_data.shape) + + +# print(HI_data.shape) +# np.save("../data/HI_DATA/HIed_data.npy",HI_data) diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_merge.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_merge.py new file mode 100644 index 0000000..bdcce01 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_merge.py @@ -0,0 +1,82 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from keras.callbacks import EarlyStopping + +# 数据读取 +# train_data = np.load("Select_data.npy") +# print(train_data.shape) +feature_data = np.load("../data/HI_DATA/feature_data.npy") +print(feature_data.shape) # (2803,24) +indexs=[1,2,3,11,20,23] +z = 0 +for index in indexs: + if z == 0: + Selected_data = feature_data[:, index] + else: + Selected_data = np.vstack([Selected_data, feature_data[:, index]]) + z += 1 +Selected_data = np.transpose(Selected_data, [1, 0]) # (2803,9) + +plt.plot(Selected_data) +plt.show() + +train_data=Selected_data[1500:-1,:] +print(train_data.shape) +plt.plot(train_data) +plt.show() + + +# 建立模型 +class model(): + + def __init__(self, input_shape=9): + self.input = input + pass + + def getModel(self, model_Type='ae'): + if model_Type == 'ae': + model = self.AE_model() + return model + else: + raise ValueError("模型尚未实现") + + def AE_model(self, input_shape=6): + input = tf.keras.Input(shape=input_shape) + d1 = tf.keras.layers.Dense(4)(input) + # d2 = tf.keras.layers.Dense(2, activation='relu')(d1) + d3 = tf.keras.layers.Dense(2, name='mid', activation='relu')(d1) + # d4 = tf.keras.layers.Dense(2, activation='relu')(d3) + d5 = tf.keras.layers.Dense(4)(d3) + d6 = tf.keras.layers.Dense(input_shape)(d5) + model = tf.keras.Model(inputs=input, outputs=d6) + return model + + +# HI指标训练和合成 +# if __name__ == '__main__': +# model = model(input_shape=6).getModel(model_Type='ae') +# model.compile(optimizer=tf.optimizers.Adam(0.001), loss=tf.losses.mse, metrics=['acc']) +# # model.summary() +# +# checkpoint = tf.keras.callbacks.ModelCheckpoint( +# filepath="AE_model.h5", +# monitor='val_loss', +# verbose=2, +# save_best_only=True, +# mode='min') +# lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=10, min_lr=0.0001) +# +# model.compile(optimizer=tf.optimizers.SGD(), loss=tf.losses.mse) +# # model.compile(optimizer=tf.optimizers.SGD(learning_rate=0.001), loss=FTMSE()) +# model.summary() +# early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=20, mode='min', verbose=1) +# +# history = model.fit(train_data, train_data, epochs=1000, batch_size=100) +# HI_merge_data = tf.keras.models.Model(inputs=model.input, outputs=model.get_layer('mid').output).predict(train_data) +# print(HI_merge_data) +# acc = np.array(history.history.get('acc')) +# # if acc[299] > 0.9: +# np.save("HI_merge_data1.npy", HI_merge_data) +# model.save("AE_model.h5") diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_merge_data.npy b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_merge_data.npy new file mode 100644 index 0000000..74088b7 Binary files /dev/null and b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_merge_data.npy differ diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_score.png b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_score.png new file mode 100644 index 0000000..ba0fe5e Binary files /dev/null and b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_score.png differ diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_select.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_select.py new file mode 100644 index 0000000..a81c40d --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/HI_select.py @@ -0,0 +1,98 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +# 数据导入 +feature_data = np.load("../data/HI_DATA/feature_data.npy") +print(feature_data.shape) # (2803,24) +feature_data = np.transpose(feature_data, [1, 0]) +print(feature_data.shape) # (24,2803) + + +# data.shape:(24,2803) +class HI_select(): + + def __init__(self, data): + self.data = data + + def getScore(self): + score = (self.getTred() + self.getMon() + self.getScale()) / 2 + print(score.shape) + return score + + def getTred(self): + h = self.data + (features, dims) = h.shape + h_mean = np.mean(h, axis=1) + tk = np.broadcast_to(np.expand_dims(np.arange(dims), axis=0), (features, dims)) # (24,2803) + tk_mean = np.mean(tk, axis=1) + tred = np.abs(np.sum(np.multiply((h - np.broadcast_to(np.expand_dims(h_mean, axis=1), (features, dims))), + (tk - np.broadcast_to(np.expand_dims(tk_mean, axis=1), (features, dims)))), + axis=1)) / np.sqrt( + np.sum((h - np.broadcast_to(np.expand_dims(h_mean, axis=1), (features, dims))) ** 2, axis=1) * np.sum( + (tk - np.broadcast_to(np.expand_dims(tk_mean, axis=1), (features, dims))) ** 2, axis=1)) + # print(tred) + + tred = np.expand_dims(tred, axis=1) + # print("tred.shape:", tred.shape) + return tred + + # 单调性 + def getMon(self): + h = self.data + (features, dims) = h.shape + mon = np.empty(shape=[24, 1]) + for feature in range(features): + positive = 0 + negative = 0 + for dim in range(dims): + if dim + 1 >= dims: + break + if h[feature][dim + 1] - h[feature][dim] > 0: + positive += 1 + if h[feature][dim + 1] - h[feature][dim] < 0: + negative += 1 + # print("positive:",positive) + # print("negetive:",negative) + mon[feature] = np.abs((positive - negative) / (dims - 1)) + # print(mon[feature]) + # print(mon) + # print("mon.shape",mon.shape) + return mon + + # 尺度相似性 + def getScale(self): + scale = np.zeros(shape=[24, 1]) + return scale + + +if __name__ == '__main__': + scores = HI_select(feature_data).getScore() + (feature, score) = scores.shape + scores = np.ravel(scores) + print(scores.shape) + + # 归一化处理 + # scores = (scores - np.min(scores)) / (np.max(scores) - np.min(scores)) + # score图 + plt.bar(range(feature),scores,color=['r','g','b','c','m','y']) + plt.show() + + # 获取前9个最大值的索引 + # print(scores) + # indexs = np.argpartition(scores, -12)[-12:] # [ 1 23 16 9 19 20 2 22 18] 自选【1,2,3,11,20,23】 备选【9,16,18】 + # print(indexs) + # # 选出所需的data + # Selected_data = [] + # feature_data = np.transpose(feature_data, [1, 0]) # (2803,24) + # z = 0 + # for index in indexs: + # if z == 0: + # Selected_data = feature_data[:, index] + # else: + # Selected_data = np.vstack([Selected_data, feature_data[:, index]]) + # z += 1 + # Selected_data=np.transpose(Selected_data,[1,0]) #(2803,9) + # # np.save("Select_data.npy",Selected_data) + # print(Selected_data.shape) diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/Select_data.npy b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/Select_data.npy new file mode 100644 index 0000000..9aabb93 Binary files /dev/null and b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/Select_data.npy differ diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/__init__.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/smallVHI.csv b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/smallVHI.csv new file mode 100644 index 0000000..3cc183f --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/smallVHI.csv @@ -0,0 +1,1250 @@ +0.0172 +0.0173 +0.0184 +0.0343 +0.0195 +0.0284 +0 +0.0263 +0.0079 +0.0073 +0.0299 +0.023 +0.0475 +0.0229 +0.0623 +0.0235 +0.0272 +0.0325 +0.0168 +0.0044 +0.0217 +0.052 +0.043 +0.0125 +0.046 +0.0352 +0.0113 +0.0551 +0.0255 +0.0102 +0.0231 +0.018 +0.041 +0.0609 +0.0598 +0.0192 +0.0387 +0.0509 +0.0073 +0.0573 +0.0336 +0.0514 +0.0263 +0.0206 +0.0261 +0.0195 +0.044 +0.0488 +0.0102 +0.0424 +0.0204 +0.0127 +0.0212 +0.0346 +0.0282 +0.0379 +0.0369 +0.0335 +0.0425 +0.0313 +0.0341 +0.0527 +0.0622 +0.0487 +0.0714 +0.06 +0.0654 +0.0241 +0.0403 +0.0755 +0.0403 +0.041 +0.0439 +0.0447 +0.0401 +0.0414 +0.0283 +0.0233 +0.0209 +0.0451 +0.0515 +0.0447 +0.0675 +0.0385 +0.0535 +0.0322 +0.0261 +0.0499 +0.0249 +0.0573 +0.0586 +0.0416 +0.0478 +0.038 +0.028 +0.0102 +0.0164 +0.0322 +0.0204 +0.0626 +0.0405 +0.0538 +0.0495 +0.0585 +0.0283 +0.0489 +0.0488 +0.0475 +0.0429 +0.0316 +0.0442 +0.0476 +0.0507 +0.0375 +0.0316 +0.0318 +0.0695 +0.0515 +0.0343 +0.0336 +0.0308 +0.0211 +0.0286 +0.0324 +0.0706 +0.0618 +0.0366 +0.0718 +0.035 +0.0588 +0.0292 +0.0414 +0.022 +0.0557 +0.064 +0.0645 +0.0722 +0.1067 +0.103 +0.0821 +0.0641 +0.0423 +0.039 +0.0629 +0.0678 +0.0475 +0.057 +0.0517 +0.0711 +0.0728 +0.082 +0.0705 +0.0693 +0.0354 +0.0305 +0.0719 +0.0794 +0.0795 +0.0573 +0.0677 +0.0378 +0.0483 +0.0827 +0.0726 +0.0504 +0.079 +0.0954 +0.0815 +0.071 +0.067 +0.0972 +0.0423 +0.0529 +0.0634 +0.0326 +0.04 +0.0712 +0.0591 +0.0785 +0.0358 +0.0642 +0.0434 +0.0338 +0.0776 +0.0499 +0.0421 +0.0414 +0.0592 +0.0594 +0.0559 +0.0647 +0.029 +0.0501 +0.0602 +0.0543 +0.0488 +0.074 +0.034 +0.0567 +0.0589 +0.0699 +0.064 +0.0409 +0.0663 +0.0722 +0.064 +0.1028 +0.058 +0.0608 +0.0751 +0.0704 +0.0387 +0.0725 +0.0675 +0.0396 +0.0446 +0.0245 +0.0582 +0.0619 +0.051 +0.0596 +0.0637 +0.0686 +0.0578 +0.0951 +0.0749 +0.033 +0.0584 +0.0348 +0.0499 +0.0484 +0.0972 +0.1084 +0.1107 +0.0661 +0.073 +0.0901 +0.0501 +0.0878 +0.0525 +0.076 +0.0646 +0.0773 +0.0881 +0.0628 +0.1025 +0.1127 +0.0581 +0.0916 +0.0858 +0.0868 +0.1234 +0.0811 +0.0522 +0.0624 +0.0568 +0.1198 +0.105 +0.1004 +0.0877 +0.0575 +0.1017 +0.0767 +0.0887 +0.0587 +0.0793 +0.0697 +0.0882 +0.0907 +0.0946 +0.077 +0.0744 +0.0966 +0.076 +0.0354 +0.0779 +0.0686 +0.0926 +0.0898 +0.1199 +0.0632 +0.0912 +0.0736 +0.1014 +0.098 +0.0648 +0.0831 +0.0625 +0.1113 +0.1017 +0.1146 +0.1055 +0.0746 +0.0907 +0.0925 +0.1694 +0.0823 +0.0782 +0.0545 +0.0805 +0.1099 +0.1155 +0.1038 +0.0421 +0.0835 +0.0905 +0.1209 +0.1092 +0.0824 +0.0584 +0.0608 +0.0681 +0.0741 +0.0634 +0.0785 +0.1236 +0.0866 +0.0776 +0.0759 +0.0814 +0.0833 +0.0413 +0.0487 +0.1114 +0.074 +0.0905 +0.0893 +0.0519 +0.0838 +0.1004 +0.0864 +0.1133 +0.0886 +0.0901 +0.0694 +0.0901 +0.0998 +0.0797 +0.0847 +0.1201 +0.0615 +0.0656 +0.1266 +0.1007 +0.0955 +0.0511 +0.0826 +0.0693 +0.0685 +0.1515 +0.0655 +0.1055 +0.0727 +0.0809 +0.0998 +0.139 +0.0532 +0.0739 +0.1126 +0.1364 +0.0789 +0.101 +0.0866 +0.1181 +0.1094 +0.0966 +0.0613 +0.0636 +0.1289 +0.0995 +0.0813 +0.1515 +0.0972 +0.1173 +0.1266 +0.089 +0.1061 +0.1101 +0.1218 +0.1125 +0.1227 +0.113 +0.1263 +0.0578 +0.124 +0.0779 +0.0698 +0.1036 +0.0962 +0.0972 +0.1371 +0.0819 +0.1424 +0.1469 +0.1255 +0.0953 +0.1116 +0.096 +0.1208 +0.1163 +0.191 +0.1107 +0.1281 +0.1235 +0.1206 +0.1571 +0.1084 +0.0933 +0.1093 +0.1016 +0.1056 +0.0762 +0.0792 +0.1287 +0.0879 +0.1012 +0.0891 +0.105 +0.1143 +0.0853 +0.0805 +0.0821 +0.091 +0.1156 +0.1762 +0.1021 +0.1004 +0.1263 +0.0923 +0.1176 +0.1169 +0.1263 +0.1526 +0.2063 +0.1094 +0.1311 +0.1224 +0.19 +0.1229 +0.0918 +0.1145 +0.1675 +0.0923 +0.1179 +0.1415 +0.1301 +0.1456 +0.1443 +0.1555 +0.1051 +0.112 +0.0803 +0.1408 +0.1674 +0.1202 +0.1671 +0.1104 +0.1596 +0.1606 +0.1115 +0.185 +0.1496 +0.1573 +0.1228 +0.1017 +0.1238 +0.1138 +0.1174 +0.1429 +0.1604 +0.1286 +0.1269 +0.117 +0.1648 +0.11 +0.0936 +0.1252 +0.1158 +0.1363 +0.1192 +0.1564 +0.1659 +0.0866 +0.1234 +0.1441 +0.1549 +0.1362 +0.1102 +0.1421 +0.1678 +0.1118 +0.1146 +0.1343 +0.1301 +0.1011 +0.1823 +0.146 +0.1433 +0.1231 +0.1221 +0.1437 +0.1294 +0.1255 +0.1589 +0.0997 +0.1551 +0.1258 +0.1073 +0.131 +0.136 +0.1562 +0.1438 +0.1684 +0.1703 +0.1172 +0.1278 +0.1587 +0.1454 +0.2502 +0.1585 +0.1433 +0.1939 +0.1465 +0.1774 +0.1651 +0.2331 +0.1853 +0.1402 +0.1718 +0.1303 +0.1495 +0.1269 +0.1663 +0.1804 +0.2434 +0.1473 +0.1921 +0.1706 +0.1693 +0.1103 +0.1199 +0.1017 +0.1514 +0.1877 +0.1937 +0.1893 +0.1702 +0.2143 +0.2283 +0.2315 +0.1142 +0.1371 +0.1486 +0.1606 +0.1422 +0.2449 +0.1312 +0.1255 +0.1884 +0.1355 +0.2155 +0.1702 +0.1891 +0.1667 +0.1595 +0.1229 +0.156 +0.1516 +0.1883 +0.1425 +0.1702 +0.1368 +0.1613 +0.1708 +0.133 +0.1137 +0.1426 +0.1428 +0.146 +0.1712 +0.1291 +0.1806 +0.1393 +0.129 +0.1659 +0.1364 +0.1258 +0.1451 +0.188 +0.1495 +0.1251 +0.1955 +0.1553 +0.2071 +0.1557 +0.1533 +0.1341 +0.1565 +0.1308 +0.2062 +0.1284 +0.1162 +0.1312 +0.1397 +0.1607 +0.1403 +0.2012 +0.1944 +0.1398 +0.1114 +0.2279 +0.2039 +0.1746 +0.1646 +0.1905 +0.1928 +0.179 +0.2535 +0.1739 +0.1342 +0.1765 +0.1953 +0.2236 +0.167 +0.1562 +0.1491 +0.2115 +0.1774 +0.2054 +0.1837 +0.1796 +0.2151 +0.1979 +0.2116 +0.2192 +0.192 +0.2278 +0.2001 +0.2563 +0.1912 +0.2174 +0.2191 +0.2168 +0.1597 +0.1376 +0.1651 +0.1836 +0.2059 +0.1305 +0.1586 +0.1908 +0.1827 +0.1883 +0.2125 +0.2171 +0.164 +0.1983 +0.2403 +0.2206 +0.1958 +0.1706 +0.2473 +0.2015 +0.1581 +0.1908 +0.2192 +0.2896 +0.2545 +0.1967 +0.1643 +0.1846 +0.183 +0.201 +0.2145 +0.17 +0.1785 +0.1418 +0.2342 +0.237 +0.2261 +0.2521 +0.1714 +0.185 +0.2326 +0.225 +0.2167 +0.2032 +0.2879 +0.1751 +0.1834 +0.1914 +0.1887 +0.2251 +0.2016 +0.2209 +0.1873 +0.2692 +0.2183 +0.2082 +0.1809 +0.2293 +0.2262 +0.2202 +0.2152 +0.2536 +0.2442 +0.3825 +0.2664 +0.2277 +0.2192 +0.2455 +0.1534 +0.1547 +0.2054 +0.1748 +0.1844 +0.2099 +0.246 +0.1989 +0.2397 +0.2051 +0.1851 +0.3339 +0.19 +0.3349 +0.2158 +0.2426 +0.1891 +0.2486 +0.2328 +0.2353 +0.2586 +0.2783 +0.1974 +0.2128 +0.1494 +0.2046 +0.2105 +0.2317 +0.1946 +0.2395 +0.2304 +0.2216 +0.2267 +0.182 +0.1863 +0.2474 +0.1757 +0.2081 +0.2369 +0.2328 +0.2087 +0.2279 +0.1745 +0.1745 +0.168 +0.2489 +0.3041 +0.1817 +0.2142 +0.2136 +0.2668 +0.2303 +0.2441 +0.2334 +0.2373 +0.2365 +0.2096 +0.199 +0.1817 +0.2348 +0.3724 +0.2099 +0.3305 +0.3063 +0.1907 +0.1297 +0.2612 +0.185 +0.1893 +0.2286 +0.1886 +0.1741 +0.2299 +0.2107 +0.1837 +0.22 +0.1964 +0.2035 +0.195 +0.2165 +0.317 +0.2295 +0.2058 +0.2045 +0.2293 +0.2596 +0.2873 +0.3949 +0.2709 +0.2992 +0.2454 +0.2525 +0.1963 +0.2301 +0.2735 +0.1448 +0.2017 +0.2114 +0.3402 +0.2622 +0.257 +0.2141 +0.3416 +0.2514 +0.2063 +0.2068 +0.2411 +0.2481 +0.2748 +0.2097 +0.1769 +0.213 +0.2531 +0.3399 +0.2114 +0.1741 +0.3608 +0.2595 +0.2129 +0.2026 +0.2791 +0.3923 +0.2736 +0.2739 +0.2974 +0.2936 +0.2706 +0.2565 +0.2346 +0.3494 +0.3222 +0.316 +0.256 +0.3213 +0.3094 +0.3008 +0.2846 +0.223 +0.1944 +0.3038 +0.3075 +0.2477 +0.3725 +0.3159 +0.2407 +0.2855 +0.355 +0.3561 +0.2729 +0.2497 +0.2147 +0.3445 +0.2465 +0.237 +0.2802 +0.4251 +0.2764 +0.2885 +0.3291 +0.2509 +0.2526 +0.2104 +0.2625 +0.2605 +0.3001 +0.2353 +0.1882 +0.2352 +0.233 +0.3604 +0.3438 +0.3816 +0.2953 +0.4096 +0.4453 +0.3545 +0.2791 +0.3215 +0.3582 +0.3165 +0.2832 +0.3268 +0.2956 +0.233 +0.4115 +0.2559 +0.3055 +0.2407 +0.4052 +0.3081 +0.3109 +0.2946 +0.2055 +0.2276 +0.2574 +0.262 +0.2096 +0.1949 +0.4268 +0.3888 +0.2314 +0.2176 +0.2635 +0.4945 +0.275 +0.2142 +0.215 +0.4962 +0.2658 +0.3692 +0.2175 +0.2144 +0.2659 +0.392 +0.269 +0.4556 +0.2631 +0.3976 +0.206 +0.3458 +0.2753 +0.3061 +0.5305 +0.383 +0.3333 +0.4005 +0.3835 +0.2546 +0.3214 +0.3995 +0.3174 +0.3417 +0.2655 +0.4024 +0.3623 +0.3471 +0.323 +0.3178 +0.3838 +0.3689 +0.2826 +0.4032 +0.4184 +0.3008 +0.2677 +0.2952 +0.4304 +0.2814 +0.3265 +0.4046 +0.3735 +0.3982 +0.3849 +0.3772 +0.285 +0.2919 +0.5386 +0.3341 +0.2517 +0.3513 +0.3324 +0.3069 +0.3389 +0.4039 +0.3462 +0.3834 +0.3369 +0.3582 +0.3184 +0.3303 +0.3144 +0.5149 +0.334 +0.2345 +0.4414 +0.2834 +0.3183 +0.3406 +0.3606 +0.2516 +0.3645 +0.3422 +0.3843 +0.2712 +0.3439 +0.2205 +0.261 +0.35 +0.2873 +0.3923 +0.2437 +0.3979 +0.3217 +0.3672 +0.3512 +0.4098 +0.2953 +0.4178 +0.2812 +0.2768 +0.2705 +0.3987 +0.297 +0.3169 +0.3029 +0.3434 +0.3584 +0.2606 +0.3941 +0.5976 +0.3004 +0.242 +0.2621 +0.3839 +0.3487 +0.3627 +0.3603 +0.3469 +0.3268 +0.3947 +0.3415 +0.3474 +0.3926 +0.4104 +0.4281 +0.3367 +0.3126 +0.2975 +0.3191 +0.3085 +0.3141 +0.3719 +0.3386 +0.2989 +0.345 +0.2906 +0.4719 +0.5137 +0.3735 +0.479 +0.2743 +0.3422 +0.3122 +0.3753 +0.4102 +0.2796 +0.3068 +0.3452 +0.2825 +0.2521 +0.3378 +0.3169 +0.2555 +0.4341 +0.3855 +0.2625 +0.2347 +0.332 +0.336 +0.3089 +0.3382 +0.2977 +0.3854 +0.3486 +0.4122 +0.4985 +0.3225 +0.3816 +0.4254 +0.3102 +0.3521 +0.4159 +0.3338 +0.3731 +0.363 +0.3726 +0.3463 +0.3088 +0.3419 +0.3127 +0.3544 +0.4116 +0.3243 +0.3712 +0.3161 +0.7578 +0.3597 +0.4521 +0.4382 +0.4364 +0.4271 +0.4319 +0.5477 +0.407 +0.5028 +0.5233 +0.506 +0.7292 +0.4775 +0.3786 +0.3948 +0.4034 +0.397 +0.4482 +0.3448 +0.4 +0.4172 +0.3773 +0.3239 +0.378 +0.3685 +0.4118 +0.4189 +0.2966 +0.3305 +0.3929 +0.3582 +0.4537 +0.498 +0.4121 +0.28 +0.5949 +0.2929 +0.3407 +0.3226 +0.3548 +0.3405 +0.4428 +0.423 +0.5593 +0.5013 +0.5999 +0.4643 +0.4839 +0.3974 +0.318 +0.3698 +0.3809 +0.4896 +0.4516 +0.4558 +0.6247 +0.5194 +0.445 +0.421 +0.444 +0.5348 +0.451 +0.3977 +0.4136 +0.4262 +0.505 +0.6135 +0.5014 +0.3628 +0.3764 +0.5129 +0.5383 +0.3431 +0.4801 +0.6918 +0.5619 +0.8736 +0.4425 +0.4192 +0.5198 +0.499 +0.4163 +0.5225 +0.5733 +0.536 +0.463 +0.4119 +0.6297 +0.3849 +0.415 +0.4042 +0.3375 +0.4756 +0.4653 +0.4324 +0.5297 +0.6474 +0.6708 +0.5121 +0.6019 +0.432 +0.6021 +0.3995 +0.39 +0.6006 +0.5906 +0.4058 +0.496 +0.4043 +0.5384 +0.5077 +0.6121 +0.5026 +0.603 +0.5689 +0.4687 +0.3425 +0.4013 +0.3686 +0.4575 +0.3759 +0.4816 +0.5345 +0.3585 +0.5818 +0.395 +0.61 +0.7003 +0.4558 +0.6558 +0.5128 +0.4657 +0.4269 +0.378 +0.4797 +0.5866 +0.5424 +0.5726 +0.4407 +0.6187 +0.6722 +0.4974 +0.5763 +0.4132 +0.5569 +0.4977 +0.6013 +0.5545 +0.5177 +0.3972 +0.5198 +0.875 +1 diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/test.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/test.py new file mode 100644 index 0000000..bfb0c31 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/HI_create/test.py @@ -0,0 +1,15 @@ +import tensorflow as tf +import numpy as np +import matplotlib.pyplot as plt + +#数据导入 +# HI_merge_data=np.load("HI_merge_data.npy") +HI_merge_data=np.loadtxt("smallVHI.csv",delimiter=",") +print(HI_merge_data.shape) +# HI_merge_data=HI_merge_data[0:1250,0] +print(HI_merge_data.shape) +print(HI_merge_data) +plt.plot(HI_merge_data) +plt.show() + + diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM.py new file mode 100644 index 0000000..e27ef40 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM.py @@ -0,0 +1,175 @@ +import tensorflow as tf +import numpy as np +import matplotlib.pyplot as plt +from model.LSTM.before.LSTM_realize_self import LSTM_realize + +# 数据读入 +# HI_merge_data = np.load("../HI_create/HI_merge_data.npy") +# # 去除掉退化特征不明显前面的点 +# HI_merge_data = HI_merge_data[0:1250, 1] +# print(HI_merge_data) +# print(HI_merge_data.shape) +# plt.plot(HI_merge_data) +# plt.show() +# (dims,)=HI_merge_data.shape +# # 将其分成重叠采样状态-滑动窗口函数 +# #train_data =np.lib.stride_stricks.sliding_window_view(HI_merge_data, 3) +# # train_data =np.lib.stride_stricks.as_strided(HI_merge_data,(1240,10),(10,)) +# +# train_data=np.empty(shape=[49,1200]) +# train_label=np.empty(shape=[1,1200]) +# predict_data=np.empty(shape=[50,1200]) +# z=0 +# for dim in range(dims): +# +# if dim+1200>=dims: +# break +# predict_data[dim]=HI_merge_data[dim:dim+1200] +# +# if dim+1200==dims-1: +# train_label=HI_merge_data[dim:dim+1200] +# else: +# train_data[dim] = HI_merge_data[dim:dim + 1200] +# +# print(train_data.shape) +# print(train_data) +# print(train_label.shape) +# print(train_label) +# +# print(predict_data.shape) +# print(predict_data) +# # +# np.save("../data/trian_data/train_data.npy", train_data) +# np.save("../data/trian_data/train_label.npy", train_label) +# np.save("../data/trian_data/predict_data.npy",predict_data) +# train_label= + + +# 处理好的trian_data的读取 +train_data = np.load("../data/trian_data/train_data.npy") # (49,1200) +train_label = np.load("../data/trian_data/train_label.npy") # (1200,) +predict_data = np.load("../data/trian_data/predict_data.npy") # (50,1200) +# train_label = np.expand_dims(train_label, axis=0) +# # 数据处理 - 分成一个epoch训练240次 +filter_num = 600 +dims = 49 +batch_size = 1 + +train_data = np.reshape(train_data, [dims, filter_num, -1]) # (49,5,240) +train_data = np.transpose(train_data, [2, 0, 1]) # (240,49,5) + +predict_data = np.reshape(predict_data, [dims + 1, filter_num, -1]) # (50,5,240) +predict_data = np.transpose(predict_data, [2, 0, 1]) # (240,50,5) + +train_label = np.reshape(train_label, [filter_num, -1]) # (5,240) +train_label = np.transpose(train_label, [1, 0]) # (240,5) +# + + +# train_label=np.ravel(train_label) +print(train_data.shape) +print(train_label.shape) +print(predict_data.shape) + + +# LSTM_realize(input=train_data, filters=1200).getLayer(layer='LSTM') + + +def predict_model(): + input = tf.keras.Input(shape=[dims, filter_num]) + input = tf.cast(input, tf.float32) + print(input.shape) + # LSTM=tf.keras.layers.LSTM(filter_num)(input) + LSTM = LSTM_realize(input=input, filters=filter_num, batch_size=batch_size).getLayer(layer='SA_convLSTM', + query=train_label) + d1 = tf.keras.layers.Dense(1000, activation='relu')(LSTM) + # drop = tf.keras.layers.Dropout(0.2)(LSTM) + # bn = tf.keras.layers.BatchNormalization()(Lstm) + output = tf.keras.layers.Dense(filter_num, name='output')(d1) + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +# +if __name__ == '__main__': + + model = predict_model() + model.compile(optimizer=tf.optimizers.Adam(0.01), loss=tf.losses.mse, metrics=['acc']) + model.summary() + history = model.fit(train_data, train_label, validation_data=(train_data, train_label), epochs=200, + batch_size=batch_size) + # model.save("LSTM_model.h5") + # model = tf.keras.models.load_model("LSTM_model.h5") + # + # fig3 = plt.figure() + # ax3 = fig3.add_subplot() + # plt.plot(history.epoch, history.history.get('acc'), label='acc') + # plt.plot(history.epoch, history.history.get('val_acc'), label='val_acc') + # plt.show() + # + # fig4 = plt.figure() + # ax4 = fig3.add_subplot() + # plt.plot(history.epoch, history.history.get('loss'), label='loss') + # plt.plot(history.epoch, history.history.get('val_loss'), label='val_loss') + # plt.show() + + # predict_data.shape=(240,50,5) + # 连续预测五十个点并画出来 + predict_num = 50 + each_predict_data = predict_data[:, 1:, :] # (240,49,5) + all_data = predict_data # (240,50,5) + for each_predict in range(predict_num): + trained_data = tf.keras.models.Model(inputs=model.input, outputs=model.get_layer('output').output).predict( + each_predict_data, batch_size=batch_size) # (240,5) + trained_data = tf.expand_dims(trained_data, axis=1) + + each_predict_data = tf.concat([each_predict_data[:, 1:, :], trained_data], axis=1) + all_data = tf.concat([all_data, trained_data], axis=1) + + # 获取到的所有data进行画图 + print(all_data.shape) # (240,100,5) + epoch, dims, filter_num = all_data.shape + all_data = tf.transpose(all_data, [1, 2, 0]) + all_data = tf.reshape(all_data, shape=[dims, filter_num * epoch]) # (100,240*5) + flatten_all_data = np.empty(shape=[dims + filter_num * epoch, ]) + (all_dims,) = flatten_all_data.shape + + # 将所有数据展平为一维进行画图 + for each in range(dims): + if each == 0: + flatten_all_data[:filter_num * epoch] = all_data[each, :] + else: + flatten_all_data[filter_num * epoch + each] = all_data[each, -1] + + print(flatten_all_data.shape) # (1300,) + plt.plot(flatten_all_data) + (all_dims,) = flatten_all_data.shape + all_x = np.arange(all_dims) + print(all_x.shape) + + # 获取到的所有data进行画图 + print(predict_data.shape) # (240,100,5) + epoch, dims, filter_num = predict_data.shape + predict_data = tf.transpose(predict_data, [1, 2, 0]) + all_data = tf.reshape(predict_data, shape=[dims, filter_num * epoch]) # (100,240*5) + before_data = np.empty(shape=[dims + filter_num * epoch, ]) + # 将所有数据展平为一维进行画图 + for each in range(dims): + if each == 0: + before_data[:filter_num * epoch] = all_data[each, :] + else: + before_data[filter_num * epoch + each] = all_data[each, -1] + + print(before_data.shape) # (1300,) + print(before_data) + (before_dims,) = before_data.shape + plt.plot(before_data) + plt.show() + + before_x = np.arange(before_dims) + all_x = np.arange(all_dims) + + plt.plot(before_x, before_data) + plt.scatter(before_dims, before_data) + plt.scatter(all_x, flatten_all_data) + plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM1.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM1.py new file mode 100644 index 0000000..fbaf693 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM1.py @@ -0,0 +1,215 @@ +import tensorflow as tf +import numpy as np +from model.LSTM.before.LSTM_realize_self3 import LSTM_realize +from keras.callbacks import EarlyStopping + +'''说明:将输入LSTM的维度理解为多少维度个点,LSTM的一个cell所做的事就是根据这dim个点得出dim+1个点的信息''' + +# 超参数设置 +filter_num = 30 # 时间部 +dims = 50 # 表示一个点的维度 +batch_size = 10 +EPOCH = 2 +model_name = 'SA_ConvLSTM' +predict_num = 50 +save_name = "../model/{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}.h5".format(model_name, filter_num, dims, + batch_size, EPOCH) +predict_name = "../data/predict_data/{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}_predict{5}.npy".format(model_name, + filter_num, + dims, + batch_size, + EPOCH, + predict_num) + +# 数据读入 +HI_merge_data = np.load("../HI_create/HI_merge_data.npy") + +# plt.plot(HI_merge_data[0:1250, 1]) +# 去除掉退化特征不明显前面的点 +HI_merge_data = HI_merge_data[0:1201, 1] +print(HI_merge_data) +print(HI_merge_data.shape) +# plt.plot(HI_merge_data) +# plt.show() +(total_dims,) = HI_merge_data.shape +# # 将其分成重叠采样状态-滑动窗口函数 +# # train_data =np.lib.stride_stricks.sliding_window_view(HI_merge_data, 3) +# # train_data =np.lib.stride_stricks.as_strided(HI_merge_data,(1240,10),(10,)) +# +train_data = np.empty(shape=[total_dims - filter_num - 1, filter_num]) + +predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) +z = 0 +# 重叠采样获取时间部和训练次数 +for dim in range(total_dims): + + if dim + filter_num >= total_dims: + break + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + if dim + filter_num < total_dims - 1: + train_data[dim] = HI_merge_data[dim:dim + filter_num] + +a, _ = train_data.shape +train_label = predict_data[dims + 1:, :] +b, _ = predict_data.shape + +# 再重叠采样获取一个点的维度 +'''train_data.shape:(sample,filter_num)''' +resample_train_data = train_data[:a - dims, :] +resample_train_data = np.expand_dims(resample_train_data, axis=0) + +resample_predict_data = predict_data[:b - dims, :] +resample_predict_data = np.expand_dims(resample_predict_data, axis=0) + +for dim in range(dims - 1): + resample_train_data2 = train_data[(dim + 1):(a - dims + dim + 1), :] + resample_train_data2 = np.expand_dims(resample_train_data2, axis=0) + resample_train_data = tf.concat([resample_train_data, resample_train_data2], axis=0) + + resample_predict_data2 = predict_data[(dim + 1):(b - dims + dim + 1), :] + resample_predict_data2 = np.expand_dims(resample_predict_data2, axis=0) + resample_predict_data = tf.concat([resample_predict_data, resample_predict_data2], axis=0) + +resample_train_data = np.transpose(resample_train_data, [1, 2, 0]) +train_data = resample_train_data + +resample_predict_data = np.transpose(resample_predict_data, [1, 2, 0]) +predict_data = resample_predict_data + +print(train_data.shape) # (649,600) +print(train_data) +print(predict_data.shape) # (650,600) +print(predict_data) +print(train_label.shape) # (649,600) +print(train_label) +# # # # +# # np.save("../data/trian_data/train_data.npy", train_data) +# # np.save("../data/trian_data/train_label.npy", train_label) +# # np.save("../data/trian_data/predict_data.npy",predict_data) +# # np.save("../data/trian_data/total_data.npy",HI_merge_data) +# # # train_label= +# +# +# 处理好的train_data的读取 +''' +train_data.shape: (total_dims - filter_num - 1, filter_num,dims) :(570,600,30) +predict_data.shape: (total_dims - filter_num, filter_num) :(571,600,30) +train_label.shape: (total_dims - filter_num - 1, filter_num) :(570,600) +''' + + +def remove(train_data, train_label, batch_size): + epoch, _, _ = train_data.shape + size = int(epoch / batch_size) + return train_data[:size * batch_size], train_label[:size * batch_size] + + +# # 数据处理 - 分成一个epoch训练240次 +train_data, train_label = remove(train_data, train_label, batch_size) # 去除直至能整除 +# train_data = np.expand_dims(train_data, axis=-1) # (649,600,1) +# predict_data = np.expand_dims(predict_data, axis=-1) # (650,600,1) +train_label = train_label +query_label = np.expand_dims(train_label, axis=-1) # (649,600,1) +total_data = HI_merge_data + +train_data = tf.cast(train_data, dtype=tf.float32) +predict_data = tf.cast(predict_data, dtype=tf.float32) +train_label = tf.cast(train_label, dtype=tf.float32) +# query_label = tf.cast(query_label, dtype=tf.float32) +# todo 解决模型保存时,query无法序列化的问题 +query_label = np.array(query_label,dtype=np.float32) + +print("predict_data.shape:", predict_data.shape) # (649,600,1) +print("train_data.shape:", train_data.shape) # (649,600,1) +print("train_label.shape:", train_label.shape) # (650,600,1) +print("query_label.shape:", query_label.shape) + + +def predict_model(): + input = tf.keras.Input(shape=[filter_num, dims]) + input = tf.cast(input, tf.float32) + LSTM_object = LSTM_realize(units=50, batch_size=batch_size, if_SA=True, if_Conv=True,query=query_label) + # LSTM_object = LSTM_realize(units=50, batch_size=batch_size, if_SA=False, if_Conv=False) + LSTM = LSTM_object(inputs=input, layer='SA_ConvLSTM') + # LSTM = LSTM_object(inputs=input, layer='LSTM') + drop = tf.keras.layers.Dropout(0.2)(LSTM) + bn = tf.keras.layers.BatchNormalization()(drop) + d1 = tf.keras.layers.Dense(32)(bn) + drop = tf.keras.layers.Dropout(0.2)(d1) + output = tf.keras.layers.Dense(1, name='output')(drop) + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +# +if __name__ == '__main__': + model = predict_model() + model.compile(optimizer=tf.optimizers.Adam(0.01), loss=tf.losses.mse) + model.summary() + early_stop = EarlyStopping(monitor='loss', min_delta=0.001, patience=8, mode='min', verbose=1) + history = model.fit(train_data, train_label, epochs=EPOCH, + batch_size=batch_size, verbose=1) + model.save(save_name) + # LSTM_object = LSTM_realize(units=50, batch_size=batch_size, if_SA=True, if_Conv=True) + newModel = tf.keras.models.load_model(save_name, custom_objects={'LSTM_realize': LSTM_realize}) + + # ''' + # train_data.shape:(570,600,30) + # predict_data.shape:(571,600,30) + # train_label.shape:(570,600) + # query_label.shape:(570,600,1) + # ''' + # # 连续预测五十个点并画出来 + # predict_num = 50 + # (samples, filter_num, dims) = predict_data.shape + # each_predict_data = predict_data[samples - batch_size:, :, :] # (5,filter_num,30) + # all_data = total_data # (1201,) + # for each_predict in range(predict_num): + # trained_data = tf.keras.models.Model(inputs=model.input, outputs=model.get_layer('output').output).predict( + # each_predict_data, batch_size=batch_size) # (batch_size,filer_num,1) + # + # all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + # trained_data = tf.concat([each_predict_data[-1, :, 1:], trained_data[-1, :, :]], axis=-1) + # # trained_data=tf.reshape(trained_data,[batch_size,filter_num,1]) + # # trained_data = tf.expand_dims(trained_data, axis=0) + # + # each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(trained_data, axis=0)], axis=0) + # + # # 获取到的所有data进行画图 + # + # print(all_data.shape) # (700,600,1) + # (all_dims,) = all_data.shape + # all_x = np.arange(all_dims) + # print(all_x.shape) + # np.save(predict_name,all_data) + # + # before_data = total_data + # (before_dims,) = before_data.shape + # before_x = np.arange(before_dims) + # all_x = np.arange(all_dims) + # + # fig5 = plt.figure() + # ax5 = fig5.add_subplot() + # plt.plot(all_data) + # plt.plot(before_data) + # plt.show() + # + # print("before_data.shape:", before_data.shape) + # print("flatten_all_data.shape:", all_data.shape) + # print("before_x.shape:", before_x.shape) + # print("all_x.shape:", all_x.shape) + # + # fig6 = plt.figure() + # ax6 = fig6.add_subplot() + # plt.plot(before_x, before_data) + # plt.scatter(before_x, before_data) + # plt.scatter(all_x, all_data) + # plt.show() + # + # + # fig4 = plt.figure() + # ax4 = fig4.add_subplot() + # plt.plot(history.epoch, history.history.get('loss'), label='loss') + # # plt.plot(history.epoch, history.history.get('val_loss'), label='val_loss') + # plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM2.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM2.py new file mode 100644 index 0000000..0dd52dd --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM2.py @@ -0,0 +1,204 @@ +import tensorflow as tf +import numpy as np +import matplotlib.pyplot as plt +from model.LSTM.before.LSTM_realize_self2 import LSTM_realize + +'''说明:把所有点都当做维度为1输入进LSTM''' + +# 超参数的设置 +filter_num = 100 # 时间部 +dims = 1 # 表示一个点的维度 +batch_size = 7 +EPOCH = 200 +model_name = 'SA_ConvLSTM' +save_name = "{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}.h5".format(model_name, filter_num, dims, batch_size, EPOCH) + +# 数据读入 +HI_merge_data = np.load("../HI_create/HI_merge_data.npy") +# 去除掉退化特征不明显前面的点 +HI_merge_data = HI_merge_data[0:1250, 1] +print(HI_merge_data) +print(HI_merge_data.shape) +# plt.plot(HI_merge_data) +# plt.show() +(total_dims,) = HI_merge_data.shape +# 将其分成重叠采样状态-滑动窗口函数 +# train_data =np.lib.stride_stricks.sliding_window_view(HI_merge_data, 3) +# train_data =np.lib.stride_stricks.as_strided(HI_merge_data,(1240,10),(10,)) + +train_data = np.empty(shape=[total_dims - filter_num - 1, filter_num]) + +predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) +z = 0 +for dim in range(total_dims): + + if dim + filter_num >= total_dims: + break + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + if dim + filter_num < total_dims - 1: + train_data[dim] = HI_merge_data[dim:dim + filter_num] + +train_label = predict_data[1:, :] + +print(train_data.shape) # (649,600) +print(train_data) +print(predict_data.shape) # (650,600) +print(predict_data) +print(train_label.shape) # (649,600) +print(train_label) +# # +# np.save("../data/trian_data/train_data.npy", train_data) +# np.save("../data/trian_data/train_label.npy", train_label) +# np.save("../data/trian_data/predict_data.npy",predict_data) +# train_label= + +# 让LSTM看50个信息(NONE,50,1) 每一个信息就是一个点,这个点只有一个维度,如果想使用多个维度可以考虑前面使用CNN,增加其channel的数量 + +# 处理好的train_data的读取 +''' +train_data.shape: (total_dims - filter_num - 1, filter_num) :(649,600) +predict_data.shape: (total_dims - filter_num, filter_num) :(650,600) +train_label.shape: (total_dims - filter_num - 1, filter_num) :(649,600) +''' + + +def remove(train_data, train_label, batch_size): + epoch, _ = train_data.shape + size = int(epoch / batch_size) + return train_data[:size * batch_size], train_label[:size * batch_size] + + +# # 数据处理 - 分成一个epoch训练240次 +train_data, train_label = remove(train_data, train_label, batch_size) # 去除直至能整除 +train_data = np.expand_dims(train_data, axis=-1) # (649,600,1) +predict_data = np.expand_dims(predict_data, axis=-1) # (650,600,1) +train_label = train_label +query_label = np.expand_dims(train_label, axis=-1) # (649,600,1) +total_data = HI_merge_data + +train_data = tf.cast(train_data, dtype=tf.float32) +predict_data = tf.cast(predict_data, dtype=tf.float32) +train_label = tf.cast(train_label, dtype=tf.float32) +query_label = tf.cast(query_label, dtype=tf.float32) + +print(train_data.shape) # (649,600,1) +print(train_label.shape) # (650,600,1) +print(query_label.shape) +print(predict_data.shape) # (649,600,1) + + +def predict_model(): + input = tf.keras.Input(shape=[filter_num, dims]) + input = tf.cast(input, tf.float32) + LSTM = LSTM_realize(input=input, units=256, batch_size=batch_size, if_SA=True).getLayer(layer='SA_ConvLSTM', + query=query_label) + + drop = tf.keras.layers.Dropout(0.2)(LSTM) + bn = tf.keras.layers.BatchNormalization()(drop) + d1 = tf.keras.layers.Dense(32)(bn) + drop = tf.keras.layers.Dropout(0.2)(d1) + output = tf.keras.layers.Dense(dims, name='output')(drop) + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +# +if __name__ == '__main__': + # model = predict_model() + # model.compile(optimizer=tf.optimizers.Adam(0.01), loss=tf.losses.mse) + # model.summary() + # early_stop = EarlyStopping(monitor='loss', min_delta=0.001, patience=8, mode='min', verbose=1) + # history = model.fit(train_data, train_label, epochs=EPOCH, + # batch_size=batch_size) + # model.save(save_name) + model = tf.keras.models.load_model(save_name) + + # fig3 = plt.figure() + # ax3 = fig3.add_subplot() + # plt.plot(history.epoch, history.history.get('acc'), label='acc') + # plt.plot(history.epoch, history.history.get('val_acc'), label='val_acc') + # plt.show() + # + # fig4 = plt.figure() + # ax4 = fig3.add_subplot() + # plt.plot(history.epoch, history.history.get('loss'), label='loss') + # plt.plot(history.epoch, history.history.get('val_loss'), label='val_loss') + # plt.show() + + ''' + train_data.shape:(649,600,1) + predict_data.shape:(650,600,1) + train_label.shape:(649,600,1) + ''' + # 连续预测五十个点并画出来 + predict_num = 50 + (samples, filter_num, dims) = predict_data.shape + each_predict_data = predict_data[samples - batch_size:, :, :] # (6,filter_num,1) + all_data = predict_data # (samples,filter_num,1) + for each_predict in range(predict_num): + trained_data = tf.keras.models.Model(inputs=model.input, outputs=model.get_layer('output').output).predict( + each_predict_data, batch_size=batch_size) # (batch_size,filer_num,1) + # trained_data=tf.reshape(trained_data,[batch_size,filter_num,1]) + # trained_data = tf.expand_dims(trained_data, axis=0) + + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(trained_data[-1, :, :], axis=0)], + axis=0) + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, :, :], axis=0)], axis=0) + + # 获取到的所有data进行画图 + print(all_data.shape) # (700,600,1) + samples, filter_num, dims = all_data.shape + # all_data = tf.transpose(all_data, [1, 2, 0]) + all_data = tf.reshape(all_data, shape=[samples, filter_num * dims]) # (100,240*5) + flatten_all_data = np.zeros(shape=[samples + filter_num * dims, ]) + (all_dims,) = flatten_all_data.shape + + # 将所有数据展平为一维进行画图 + for each in range(samples): + if each == 0: + flatten_all_data[:filter_num * dims] = all_data[each, :] + else: + flatten_all_data[filter_num * dims + each] = all_data[each, -1] + + print(flatten_all_data.shape) # (1300,) + + (all_dims,) = flatten_all_data.shape + all_x = np.arange(all_dims) + print(all_x.shape) + # + # # 获取到的所有data进行画图 + # print(predict_data.shape) # (240,100,5) + # epoch, dims, filter_num = predict_data.shape + # predict_data = tf.transpose(predict_data, [1, 2, 0]) + # all_data = tf.reshape(predict_data, shape=[dims, filter_num * epoch]) # (100,240*5) + # before_data = np.empty(shape=[dims + filter_num * epoch, ]) + # # 将所有数据展平为一维进行画图 + # for each in range(dims): + # if each == 0: + # before_data[:filter_num * epoch] = all_data[each, :] + # else: + # before_data[filter_num * epoch + each] = all_data[each, -1] + # + # print(before_data.shape) # (1300,) + # print(before_data) + # (before_dims,) = before_data.shape + + # + before_data = total_data + (before_dims,) = before_data.shape + before_x = np.arange(before_dims) + all_x = np.arange(all_dims) + + plt.plot(flatten_all_data) + plt.plot(before_data) + plt.show() + + print("before_data.shape:",before_data.shape) + print("flatten_all_data.shape:",flatten_all_data.shape) + print("before_x.shape:",before_x.shape) + print("all_x.shape:",all_x.shape) + plt.plot(before_x, before_data) + plt.scatter(before_x, before_data) + plt.scatter(all_x, flatten_all_data) + plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM4.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM4.py new file mode 100644 index 0000000..05d64d8 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM4.py @@ -0,0 +1,481 @@ +import tensorflow as tf +import numpy as np +import matplotlib.pyplot as plt +from model.LSTM.before.LSTM_realize_self4 import LSTM_realize, PredictModel +import os +import shutil + +# TODO 使用函数式编程的方式书写model.fit对应于self4 +'''说明:将输入LSTM的维度理解为多少维度个点,LSTM的一个cell所做的事就是根据这dim个点得出dim+1个点的信息''' + +# 超参数设置 +filter_num = 500 # 时间部 +dims = 50 # 表示一个点的维度 +unit = 20 +batch_size = 10 +EPOCH = 100 +model_name = 'SA_ConvLSTM' +predict_num = 50 + +save_name = "../model/weight/{0}_unit{1}_FilterNum{2}_Dims{3}_Epoch{4}_weight/weight".format(model_name, unit, + filter_num, dims, + EPOCH) +save_loss_name = "../model/loss/{0}_unit{1}_FilterNum{2}_Dims{3}_Epoch{4}_loss.npy".format(model_name, unit, filter_num, + dims, + EPOCH) + +# save_name = "../model/weight/{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}_weight".format(model_name, +# filter_num, dims, +# batch_size, EPOCH) +# save_loss_name = "../model/loss/{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}_loss.npy".format(model_name, unit, +# filter_num, +# dims, +# batch_size, EPOCH) + +predict_name = "../data/predict_data/{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}_predict{5}.npy".format(model_name, + filter_num, + dims, + batch_size, + EPOCH, + predict_num) + +# 数据读入 +HI_merge_data_origin = np.load("../HI_create/HI_merge_data.npy") + +# plt.plot(HI_merge_data[0:1250, 1]) +# 去除掉退化特征不明显前面的点 +HI_merge_data = HI_merge_data_origin[0:1201, 1] +print(HI_merge_data) +print(HI_merge_data.shape) +# plt.plot(HI_merge_data) +# plt.show() +(total_dims,) = HI_merge_data.shape +# # 将其分成重叠采样状态-滑动窗口函数 +# # train_data =np.lib.stride_stricks.sliding_window_view(HI_merge_data, 3) +# # train_data =np.lib.stride_stricks.as_strided(HI_merge_data,(1240,10),(10,)) +# +train_data = np.empty(shape=[total_dims - filter_num - 1, filter_num]) + +predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) +z = 0 +# 重叠采样获取时间部和训练次数 +for dim in range(total_dims): + + if dim + filter_num >= total_dims: + break + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + if dim + filter_num < total_dims - 1: + train_data[dim] = HI_merge_data[dim:dim + filter_num] + +a, _ = train_data.shape +train_label = predict_data[dims + 1:, :] +b, _ = predict_data.shape + +# 再重叠采样获取一个点的维度 +'''train_data.shape:(sample,filter_num)''' +resample_train_data = train_data[:a - dims, :] +resample_train_data = np.expand_dims(resample_train_data, axis=0) + +resample_predict_data = predict_data[:b - dims, :] +resample_predict_data = np.expand_dims(resample_predict_data, axis=0) + +for dim in range(dims - 1): + resample_train_data2 = train_data[(dim + 1):(a - dims + dim + 1), :] + resample_train_data2 = np.expand_dims(resample_train_data2, axis=0) + resample_train_data = tf.concat([resample_train_data, resample_train_data2], axis=0) + + resample_predict_data2 = predict_data[(dim + 1):(b - dims + dim + 1), :] + resample_predict_data2 = np.expand_dims(resample_predict_data2, axis=0) + resample_predict_data = tf.concat([resample_predict_data, resample_predict_data2], axis=0) + +resample_train_data = np.transpose(resample_train_data, [1, 2, 0]) +train_data = resample_train_data + +resample_predict_data = np.transpose(resample_predict_data, [1, 2, 0]) +predict_data = resample_predict_data + +print(train_data.shape) # (649,600) +print(train_data) +print(predict_data.shape) # (650,600) +print(predict_data) +print(train_label.shape) # (649,600) +print(train_label) +# # # # +# # np.save("../data/trian_data/train_data.npy", train_data) +# # np.save("../data/trian_data/train_label.npy", train_label) +# # np.save("../data/trian_data/predict_data.npy",predict_data) +# # np.save("../data/trian_data/total_data.npy",HI_merge_data) +# # # train_label= +# +# +# 处理好的train_data的读取 +''' +train_data.shape: (total_dims - filter_num - 1, filter_num,dims) :(570,600,30) +predict_data.shape: (total_dims - filter_num, filter_num) :(571,600,30) +train_label.shape: (total_dims - filter_num - 1, filter_num) :(570,600) +''' + + +def remove(train_data, train_label, batch_size): + epoch, _, _ = train_data.shape + size = int(epoch / batch_size) + return train_data[:size * batch_size], train_label[:size * batch_size] + + +# # 数据处理 - 分成一个epoch训练240次 +train_data, train_label = remove(train_data, train_label, batch_size) # 去除直至能整除 +# train_data = np.expand_dims(train_data, axis=-1) # (649,600,1) +# predict_data = np.expand_dims(predict_data, axis=-1) # (650,600,1) +train_label = train_label +query_label = np.expand_dims(train_label, axis=-1) # (649,600,1) +total_data = HI_merge_data + +train_data = tf.cast(train_data, dtype=tf.float32) +predict_data = tf.cast(predict_data, dtype=tf.float32) +train_label = tf.cast(train_label, dtype=tf.float32) +# query_label = tf.cast(query_label, dtype=tf.float32) +# todo 解决模型保存时,query无法序列化的问题 +query_label = np.array(query_label, dtype=np.float32) + +print("predict_data.shape:", predict_data.shape) # (21, 1200, 30) +print("train_data.shape:", train_data.shape) # (20, 1200, 30) +print("train_label.shape:", train_label.shape) # (20, 1200) +print("query_label.shape:", query_label.shape) # (20, 1200, 1) + + +def predict_model(): + input = tf.keras.Input(shape=[filter_num, dims]) + input = tf.cast(input, tf.float32) + LSTM_object = LSTM_realize(units=50, batch_size=batch_size, if_SA=True, if_Conv=True, query=query_label) + # LSTM_object = LSTM_realize(units=50, batch_size=batch_size, if_SA=False, if_Conv=False) + LSTM = LSTM_object(inputs=input, layer='SA_ConvLSTM') + # LSTM = LSTM_object(inputs=input, layer='LSTM') + drop = tf.keras.layers.Dropout(0.2)(LSTM) + bn = tf.keras.layers.BatchNormalization()(drop) + d1 = tf.keras.layers.Dense(32)(bn) + drop = tf.keras.layers.Dropout(0.2)(d1) + output = tf.keras.layers.Dense(1, name='output')(drop) + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(predict_data, predict_num=30): + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + each_predict_data = predict_data[samples - batch_size:, :, :] # (5,filter_num,30) + all_data = total_data # (1201,) + for each_predict in range(predict_num): + trained_data = newModel.predict(each_predict_data, batch_size=batch_size) # (batch_size,filer_num,1) + + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + temp1 = tf.concat([each_predict_data[-1, -1, 1:], tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + temp2 = tf.concat([each_predict_data[-1, 1:, :], tf.expand_dims(temp1, axis=0)], axis=0) + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(temp2, axis=0)], axis=0) + + return all_data + + +# 使用最后预测出来的一整行与之前的拼接 +def predictContinued(predict_data, predict_num=30): + # predict_num = 30 + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + each_predict_data = predict_data[samples - batch_size:, :, :] # (5,filter_num,30) + all_data = total_data # (1201,) + for each_predict in range(predict_num): + trained_data = newModel.predict( + each_predict_data, batch_size=batch_size) # (batch_size,filer_num,1) + + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + trained_data = tf.concat([each_predict_data[-1, :, 1:], trained_data[-1, :, :]], axis=-1) + # trained_data=tf.reshape(trained_data,[batch_size,filter_num,1]) + # trained_data = tf.expand_dims(trained_data, axis=0) + + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(trained_data, axis=0)], axis=0) + return all_data + + +# 使用最后预测出来的一整行与之前的拼接,预测函数使用自己的call函数实现,否则传统的两个方法的query就是一直使用的以前的,而且z一直是0 +def selfPredictContinued(predict_data, query_label, predict_num=30): + # predict_num = 30 + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + (samples1, filter_num1, dims1) = query_label.shape + # 只留下最后一个batch + each_predict_data = predict_data[samples - batch_size:, :, :] # (10,1200,30) + each_query_data = query_label[samples1 - batch_size:, :, :] # (10, 1200, 1) + # 当想要的下一个点的数据没有的时候,使用最后一个点当做下一个点的query + temp1 = each_query_data[-1, 1:, :] + temp2 = each_query_data[-1, -1, -1] + temp22 = tf.expand_dims(tf.expand_dims(temp2, axis=-1), axis=-1) + each_query_data = tf.concat([each_query_data[1:, :, :], tf.expand_dims(tf.concat([temp1, temp22], axis=0), axis=0)], + axis=0) + print(each_query_data.shape) # (10,1200,1) + + # 尝试一次预测 + each_query_data = each_query_data[-1, :, :] + each_predict_data = each_predict_data[-1, :, :] + each_predict_data = tf.expand_dims(each_predict_data, axis=0) + each_query_data = tf.expand_dims(each_query_data, axis=0) + + all_data = total_data # (1201,) + i = 1 # 用于看第几次预测了 + for each_predict in range(predict_num): + trained_data = newModel.call(each_predict_data, query=each_query_data, batch_size=1) # (batch_size,filer_num,1) + + print("第", i, "次预测已完成") + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + one_data = tf.concat([each_predict_data[-1, :, 1:], trained_data[-1, :, :]], axis=-1) + # 这里的1:-1是为了去掉上一次重复的那个 + temp1 = each_query_data[-1, 1:-1, :] + temp2 = tf.expand_dims(tf.expand_dims(trained_data[-1, -1, -1], axis=-1), axis=-1) + # 拼接两次上面的值,其中最后一次为与上一次类似的预测点 + temp3 = tf.concat([tf.concat([temp1, temp2], axis=0), temp2], axis=0) + each_query_data = tf.concat( + [each_query_data[1:, :, :], tf.expand_dims(temp3, axis=0)], axis=0) + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(one_data, axis=0)], axis=0) + i += 1 + return all_data + + +# 使用最后预测出来的最后一个与之前的拼接,预测函数使用自己的call函数实现,否则传统的两个方法的query就是一直使用的以前的,而且z一直是0 +def selfPredictOneByOne(predict_data, query_label, predict_num=30): + # predict_num = 30 + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + (samples1, filter_num1, dims1) = query_label.shape + # 只留下最后一个batch + each_predict_data = predict_data[samples - batch_size:, :, :] # (10,1200,30) + each_query_data = query_label[samples1 - batch_size:, :, :] # (10, 1200, 1) + # 当想要的下一个点的数据没有的时候,使用最后一个点当做下一个点的query + temp1 = each_query_data[-1, 1:, :] + temp2 = each_query_data[-1, -1, -1] + temp22 = tf.expand_dims(tf.expand_dims(temp2, axis=-1), axis=-1) + each_query_data = tf.concat([each_query_data[1:, :, :], tf.expand_dims(tf.concat([temp1, temp22], axis=0), axis=0)], + axis=0) + print(each_query_data.shape) # (10,1200,1) + + # 尝试一次预测 + each_query_data = each_query_data[-1, :, :] + each_predict_data = each_predict_data[-1, :, :] + each_predict_data = tf.expand_dims(each_predict_data, axis=0) + each_query_data = tf.expand_dims(each_query_data, axis=0) + + all_data = total_data # (1201,) + i = 1 # 用于看第几次预测了 + for each_predict in range(predict_num): + trained_data = newModel.call(each_predict_data, query=each_query_data, batch_size=1) # (batch_size,filer_num,1) + + print("第", i, "次预测已完成") + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + + _temp1 = tf.concat([each_predict_data[-1, -1, 1:], tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + _temp2 = tf.concat([each_predict_data[-1, 1:, :], tf.expand_dims(_temp1, axis=0)], axis=0) + # one_data = tf.concat([each_predict_data[-1, :, 1:], temp1], axis=-1) + # 这里的1:-1是为了去掉上一次重复的那个 + temp1 = each_query_data[-1, 1:-1, :] + temp2 = tf.expand_dims(tf.expand_dims(trained_data[-1, -1, -1], axis=-1), axis=-1) + # 拼接两次上面的值,其中最后一次为与上一次类似的预测点 + temp3 = tf.concat([tf.concat([temp1, temp2], axis=0), temp2], axis=0) + each_query_data = tf.concat( + [each_query_data[1:, :, :], tf.expand_dims(temp3, axis=0)], axis=0) + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(_temp2, axis=0)], axis=0) + i += 1 + return all_data + + +def folderGenerate(folder_name): + if not os.path.exists(folder_name): + os.mkdir(folder_name) + + +# 递归删除文件夹 +def folderDelete(folder_name): + if os.path.exists(folder_name): + shutil.rmtree(folder_name) + + +# 判断这次是否进行模型保存,history_loss存储历史上的loss +def SaveBestModel(history_loss, loss_value): + weight_folder = save_name[:-7] + + # 如果history_loss为空,那么直接保存 + if len(history_loss) == 0: + folderGenerate(weight_folder) + model.save_weights(save_name) + return + + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.min(history_loss) > loss_value: + # 删除上一次的保存这一次的 + folderDelete(weight_folder) + folderGenerate(weight_folder) + model.save_weights(save_name) + return + + pass + + +def IsStopTraining(history_loss, patience=5): + if len(history_loss) <= patience: + return False + for i in range(1, patience): + if history_loss[-(patience + 1)] > history_loss[-i]: + return False + print(patience, "次loss未下降,训练停止") + return True + + +def shuffle(data, label): + label = tf.expand_dims(label, axis=-1) + total = tf.concat([data, label], axis=-1) + total = tf.random.shuffle(total) + data = total[:, :, :-1] + label = total[:, :, -1] + query = tf.expand_dims(label, axis=-1) + return data, label, query + + +def splitValData(data, label, val_radio=0.2): + size, filter_num, dims = data.shape + val_data = data[:int(size * val_radio), :, :] + train_data = data[int(size * val_radio):, :, :] + val_label = label[:int(size * val_radio), :] + train_label = label[int(size * val_radio):, :] + val_query = tf.expand_dims(val_label, axis=-1) + train_query = tf.expand_dims(train_label, axis=-1) + + return (train_data, train_label, train_query), (val_data, val_label, val_query) + + +def Is_Reduce_learning_rate(history_loss, patience=3): + if len(history_loss) <= patience: + return False + for i in range(patience): + if history_loss[-(patience + 1)] > history_loss[-i]: + return False + print(patience,"次loss未下降,降低学习率") + return True + + +# +if __name__ == '__main__': + # model = predict_model() + # # opt = tf.optimizers.Adam(1e-3) + model = PredictModel(filter_num=filter_num, dims=dims, batch_size=batch_size, query_label=query_label) + # + # # # # TODO 需要运行编译一次,才能打印model.summary() + # model.call(inputs=train_data[0:batch_size], label=train_label[0:batch_size]) + # model.build(input_shape=(batch_size, filter_num, dims)) + # model.summary() + + # + history_loss = [] + history_val_loss = [] + learning_rate = 1e-3 + for epoch in range(EPOCH): + train_data, train_label, query_label = shuffle(train_data, train_label) + if epoch == 0: + (train_data, train_label, query_label), (val_data, val_label, val_query) = splitValData(data=train_data, + label=train_label, + val_radio=0.2) + print() + print("EPOCH:", epoch, "/", EPOCH, ":") + # 用于让train知道,这是这个epoch中的第几次训练 + z = 0 + # 用于batch_size次再训练 + k = 1 + for data_1, label_1 in zip(train_data, train_label): + size, _, _ = train_data.shape + data_1 = tf.expand_dims(data_1, axis=0) + label_1 = tf.expand_dims(label_1, axis=0) + if batch_size != 1: + if k % batch_size == 1: + data = data_1 + label = label_1 + else: + data = tf.concat([data, data_1], axis=0) + label = tf.concat([label, label_1], axis=0) + else: + data = data_1 + label = label_1 + + if k % batch_size == 0: + label = tf.expand_dims(label, axis=-1) + loss_value = model.train(input_tensor=data, label=label, query=query_label, learning_rate=learning_rate, + z=z) + print(z * batch_size, "/", size, ":===============>", "loss:", loss_value.numpy()) + k = 0 + z = z + 1 + k = k + 1 + + val_loss = model.get_val_loss(val_data=val_data, val_label=val_label, val_query=val_query, batch_size=1) + SaveBestModel(history_loss=history_val_loss, loss_value=val_loss.numpy()) + history_val_loss.append(val_loss) + history_loss.append(loss_value.numpy()) + print('Training loss is :', loss_value.numpy()) + print('Validating loss is :', val_loss.numpy()) + if IsStopTraining(history_loss=history_val_loss, patience=7): + break + if Is_Reduce_learning_rate(history_loss=history_val_loss, patience=3): + learning_rate = 1e-4 + + # loss_folder = save_loss_name[:-4] + # folderGenerate(loss_folder) + # np.save(save_loss_name, history_loss) + + model.save_weights(save_name) + newModel = PredictModel(filter_num=filter_num, dims=dims, batch_size=batch_size, query_label=query_label) + # newModel.load_weights(save_name) + # # history_loss=np.load(save_loss_name) + # # print(history_loss) + # + # + # # # ''' + # # # train_data.shape:(570,600,30) + # # # predict_data.shape:(571,600,30) + # # # train_label.shape:(570,600) + # # # query_label.shape:(570,600,1) + # # # ''' + # # 连续预测五十个点并画出来 + predict_num = 50 + # all_data = predictContinued(predict_data=predict_data, predict_num=predict_num) + # all_data = predictOneByOne(predict_data=predict_data, predict_num=predict_num) + # all_data = selfPredictContinued(predict_data=predict_data, query_label=query_label, predict_num=predict_num) + all_data = selfPredictOneByOne(predict_data=predict_data, query_label=query_label, predict_num=predict_num) + + # 获取到的所有data进行画图 + print(all_data.shape) # (700,600,1) + (all_dims,) = all_data.shape + all_x = np.arange(all_dims) + print(all_x.shape) + # np.save(predict_name, all_data) + + before_data = total_data + (before_dims,) = before_data.shape + before_x = np.arange(before_dims) + all_x = np.arange(all_dims) + + fig5 = plt.figure() + ax5 = fig5.add_subplot(2, 1, 1) + ax5.plot(all_data) + ax5.plot(before_data) + ax51 = fig5.add_subplot(2, 1, 2) + ax51.plot(HI_merge_data_origin[0:all_dims, 1]) + plt.show() + + print("before_data.shape:", before_data.shape) + print("flatten_all_data.shape:", all_data.shape) + print("before_x.shape:", before_x.shape) + print("all_x.shape:", all_x.shape) + + fig6 = plt.figure() + ax6 = fig6.add_subplot() + plt.plot(before_x, before_data) + plt.scatter(before_x, before_data) + plt.scatter(all_x, all_data) + plt.show() + + # fig4 = plt.figure() + # ax4 = fig4.add_subplot() + # plt.plot(history.epoch, history.history.get('loss'), label='loss') + # # plt.plot(history.epoch, history.history.get('val_loss'), label='val_loss') + # plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM5.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM5.py new file mode 100644 index 0000000..a25dcba --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/LSTM5.py @@ -0,0 +1,592 @@ +import tensorflow as tf +import numpy as np +from model.LSTM.before.LSTM_realize_self5 import LSTM_realize, PredictModel +from keras.callbacks import EarlyStopping +import os +import shutil +from model.LossFunction.FTMSE import FTMSE + +# TODO 使用函数式编程的方式书写model.fit对应于self5,LSTM参数共享测试 +'''说明:将输入LSTM的维度理解为多少维度个点,LSTM的一个cell所做的事就是根据这dim个点得出dim+1个点的信息''' + + +# save_name = "../model/weight/{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}_weight".format(model_name, +# filter_num, dims, +# batch_size, EPOCH) +# save_loss_name = "../model/loss/{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}_loss.npy".format(model_name, unit, +# filter_num, +# dims, +# batch_size, EPOCH) + + +def getData(filter_num, dims, batch_size): + # 数据读入 + HI_merge_data_origin = np.load("../HI_create/HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1201, 1] + print(HI_merge_data) + print(HI_merge_data.shape) + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + # # 将其分成重叠采样状态-滑动窗口函数 + # # train_data =np.lib.stride_stricks.sliding_window_view(HI_merge_data, 3) + # # train_data =np.lib.stride_stricks.as_strided(HI_merge_data,(1240,10),(10,)) + # + train_data = np.empty(shape=[total_dims - filter_num - 1, filter_num]) + + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + z = 0 + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims): + + if dim + filter_num >= total_dims: + break + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + if dim + filter_num < total_dims - 1: + train_data[dim] = HI_merge_data[dim:dim + filter_num] + + a, _ = train_data.shape + train_label = predict_data[dims + 1:, :] + b, _ = predict_data.shape + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num)''' + resample_train_data = train_data[:a - dims, :] + resample_train_data = np.expand_dims(resample_train_data, axis=0) + + resample_predict_data = predict_data[:b - dims, :] + resample_predict_data = np.expand_dims(resample_predict_data, axis=0) + + for dim in range(dims - 1): + resample_train_data2 = train_data[(dim + 1):(a - dims + dim + 1), :] + resample_train_data2 = np.expand_dims(resample_train_data2, axis=0) + resample_train_data = tf.concat([resample_train_data, resample_train_data2], axis=0) + + resample_predict_data2 = predict_data[(dim + 1):(b - dims + dim + 1), :] + resample_predict_data2 = np.expand_dims(resample_predict_data2, axis=0) + resample_predict_data = tf.concat([resample_predict_data, resample_predict_data2], axis=0) + + resample_train_data = np.transpose(resample_train_data, [1, 2, 0]) + train_data = resample_train_data + + resample_predict_data = np.transpose(resample_predict_data, [1, 2, 0]) + predict_data = resample_predict_data + + print(train_data.shape) # (649,600) + print(train_data) + print(predict_data.shape) # (650,600) + print(predict_data) + print(train_label.shape) # (649,600) + print(train_label) + + # # 数据处理 - 分成一个epoch训练240次 + # train_data, train_label = remove(train_data, train_label, batch_size) # 去除直至能整除 + # train_data = np.expand_dims(train_data, axis=-1) # (649,600,1) + # predict_data = np.expand_dims(predict_data, axis=-1) # (650,600,1) + train_label = train_label + query_label = np.expand_dims(train_label, axis=-1) # (649,600,1) + total_data = HI_merge_data + + train_data = tf.cast(train_data, dtype=tf.float32) + predict_data = tf.cast(predict_data, dtype=tf.float32) + train_label = tf.cast(tf.expand_dims(train_label, axis=-1), dtype=tf.float32) + # query_label = tf.cast(query_label, dtype=tf.float32) + # todo 解决模型保存时,query无法序列化的问题 + query_label = np.array(query_label, dtype=np.float32) + + print("predict_data.shape:", predict_data.shape) # (21, 1200, 30) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("query_label.shape:", query_label.shape) # (20, 1200, 1) + return predict_data, train_data, train_label, query_label, total_data, HI_merge_data_origin + + +# # # # +# # np.save("../data/trian_data/train_data.npy", train_data) +# # np.save("../data/trian_data/train_label.npy", train_label) +# # np.save("../data/trian_data/predict_data.npy",predict_data) +# # np.save("../data/trian_data/total_data.npy",HI_merge_data) +# # # train_label= +# +# +# 处理好的train_data的读取 +''' +train_data.shape: (total_dims - filter_num - 1, filter_num,dims) :(570,600,30) +predict_data.shape: (total_dims - filter_num, filter_num) :(571,600,30) +train_label.shape: (total_dims - filter_num - 1, filter_num) :(570,600) +''' + + +def remove(train_data, train_label, batch_size): + epoch, _, _ = train_data.shape + size = int(epoch / batch_size) + return train_data[:size * batch_size], train_label[:size * batch_size] + + +# 仅使用预测出来的最新的一个点预测以后没有batch_size +def predictOneByOneWithBatch1(newModel, predict_data, predict_num=30): + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + each_predict_data = predict_data[-1, :, :] # (5,filter_num,30) + each_predict_data = tf.expand_dims(each_predict_data, axis=0) + all_data = total_data # (1201,) + i = 1 # 用于看第几次预测 + for each_predict in range(predict_num): + trained_data = newModel.predict(each_predict_data) # (batch_size,filer_num,1) + + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + temp1 = tf.concat([each_predict_data[-1, -1, 1:], tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + temp2 = tf.concat([each_predict_data[-1, 1:, :], tf.expand_dims(temp1, axis=0)], axis=0) + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(temp2, axis=0)], axis=0) + print("第", i, "次预测已经完成") + i += 1 + return all_data + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(newModel, predict_data, predict_num=30): + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + each_predict_data = predict_data[samples - batch_size:, :, :] # (5,filter_num,30) + all_data = total_data # (1201,) + for each_predict in range(predict_num): + trained_data = newModel.predict(each_predict_data, batch_size=batch_size) # (batch_size,filer_num,1) + + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + temp1 = tf.concat([each_predict_data[-1, -1, 1:], tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + temp2 = tf.concat([each_predict_data[-1, 1:, :], tf.expand_dims(temp1, axis=0)], axis=0) + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(temp2, axis=0)], axis=0) + + return all_data + + +# 使用最后预测出来的一整行与之前的拼接 +def predictContinued(newModel, predict_data, predict_num=30): + # predict_num = 30 + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + each_predict_data = predict_data[samples - batch_size:, :, :] # (5,filter_num,30) + all_data = total_data # (1201,) + for each_predict in range(predict_num): + trained_data = newModel.predict( + each_predict_data, batch_size=batch_size) # (batch_size,filer_num,1) + + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + trained_data = tf.concat([each_predict_data[-1, :, 1:], trained_data[-1, :, :]], axis=-1) + # trained_data=tf.reshape(trained_data,[batch_size,filter_num,1]) + # trained_data = tf.expand_dims(trained_data, axis=0) + + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(trained_data, axis=0)], axis=0) + return all_data + + +# 使用最后预测出来的一整行与之前的拼接,预测函数使用自己的call函数实现,否则传统的两个方法的query就是一直使用的以前的,而且z一直是0 +def selfPredictContinued(newModel, predict_data, query_label, predict_num=30): + # predict_num = 30 + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + (samples1, filter_num1, dims1) = query_label.shape + # 只留下最后一个batch + each_predict_data = predict_data[samples - batch_size:, :, :] # (10,1200,30) + each_query_data = query_label[samples1 - batch_size:, :, :] # (10, 1200, 1) + # 当想要的下一个点的数据没有的时候,使用最后一个点当做下一个点的query + temp1 = each_query_data[-1, 1:, :] + temp2 = each_query_data[-1, -1, -1] + temp22 = tf.expand_dims(tf.expand_dims(temp2, axis=-1), axis=-1) + each_query_data = tf.concat([each_query_data[1:, :, :], tf.expand_dims(tf.concat([temp1, temp22], axis=0), axis=0)], + axis=0) + print(each_query_data.shape) # (10,1200,1) + + # 尝试一次预测 + each_query_data = each_query_data[-1, :, :] + each_predict_data = each_predict_data[-1, :, :] + each_predict_data = tf.expand_dims(each_predict_data, axis=0) + each_query_data = tf.expand_dims(each_query_data, axis=0) + + all_data = total_data # (1201,) + i = 1 # 用于看第几次预测了 + for each_predict in range(predict_num): + trained_data = newModel.call(each_predict_data, query=each_query_data, batch_size=1) # (batch_size,filer_num,1) + + print("第", i, "次预测已完成") + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + one_data = tf.concat([each_predict_data[-1, :, 1:], trained_data[-1, :, :]], axis=-1) + # 这里的1:-1是为了去掉上一次重复的那个 + temp1 = each_query_data[-1, 1:-1, :] + temp2 = tf.expand_dims(tf.expand_dims(trained_data[-1, -1, -1], axis=-1), axis=-1) + # 拼接两次上面的值,其中最后一次为与上一次类似的预测点 + temp3 = tf.concat([tf.concat([temp1, temp2], axis=0), temp2], axis=0) + each_query_data = tf.concat( + [each_query_data[1:, :, :], tf.expand_dims(temp3, axis=0)], axis=0) + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(one_data, axis=0)], axis=0) + i += 1 + return all_data + + +# 使用最后预测出来的最后一个与之前的拼接,预测函数使用自己的call函数实现,否则传统的两个方法的query就是一直使用的以前的,而且z一直是0 +def selfPredictOneByOne(newModel, predict_data, query_label, predict_num=30): + # predict_num = 30 + (samples, filter_num, dims) = predict_data.shape # predict_data.shape: (21, 1200, 30) + (samples1, filter_num1, dims1) = query_label.shape + # 只留下最后一个batch + each_predict_data = predict_data[samples - batch_size:, :, :] # (10,1200,30) + each_query_data = query_label[samples1 - batch_size:, :, :] # (10, 1200, 1) + # 当想要的下一个点的数据没有的时候,使用最后一个点当做下一个点的query + temp1 = each_query_data[-1, 1:, :] + temp2 = each_query_data[-1, -1, -1] + temp22 = tf.expand_dims(tf.expand_dims(temp2, axis=-1), axis=-1) + each_query_data = tf.concat([each_query_data[1:, :, :], tf.expand_dims(tf.concat([temp1, temp22], axis=0), axis=0)], + axis=0) + print(each_query_data.shape) # (10,1200,1) + + # 尝试一次预测 + each_query_data = each_query_data[-1, :, :] + each_predict_data = each_predict_data[-1, :, :] + each_predict_data = tf.expand_dims(each_predict_data, axis=0) + each_query_data = tf.expand_dims(each_query_data, axis=0) + + all_data = total_data # (1201,) + i = 1 # 用于看第几次预测了 + for each_predict in range(predict_num): + trained_data = newModel.call(each_predict_data, query=each_query_data, batch_size=1) # (batch_size,filer_num,1) + + print("第", i, "次预测已完成") + all_data = tf.concat([all_data, tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + + _temp1 = tf.concat([each_predict_data[-1, -1, 1:], tf.expand_dims(trained_data[-1, -1, -1], axis=-1)], axis=0) + _temp2 = tf.concat([each_predict_data[-1, 1:, :], tf.expand_dims(_temp1, axis=0)], axis=0) + # one_data = tf.concat([each_predict_data[-1, :, 1:], temp1], axis=-1) + # 这里的1:-1是为了去掉上一次重复的那个 + temp1 = each_query_data[-1, 1:-1, :] + temp2 = tf.expand_dims(tf.expand_dims(trained_data[-1, -1, -1], axis=-1), axis=-1) + # 拼接两次上面的值,其中最后一次为与上一次类似的预测点 + temp3 = tf.concat([tf.concat([temp1, temp2], axis=0), temp2], axis=0) + each_query_data = tf.concat( + [each_query_data[1:, :, :], tf.expand_dims(temp3, axis=0)], axis=0) + each_predict_data = tf.concat([each_predict_data[1:, :, :], tf.expand_dims(_temp2, axis=0)], axis=0) + i += 1 + return all_data + + +def folderGenerate(folder_name): + if not os.path.exists(folder_name): + os.mkdir(folder_name) + + +# 递归删除文件夹 +def folderDelete(folder_name): + if os.path.exists(folder_name): + shutil.rmtree(folder_name) + + +# 判断这次是否进行模型保存,history_loss存储历史上的loss +def SaveBestModel(model, history_loss, loss_value): + weight_folder = save_name[:-7] + + # 如果history_loss为空,那么直接保存 + if len(history_loss) == 0: + folderGenerate(weight_folder) + model.save_weights(save_name) + return + + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.min(history_loss) > loss_value: + # 删除上一次的保存这一次的 + folderDelete(weight_folder) + folderGenerate(weight_folder) + model.save_weights(save_name) + print("保存这次模型") + return + + pass + + +def IsStopTraining(history_loss, patience=5): + if len(history_loss) <= patience: + return False + for i in range(1, patience): + if history_loss[-(patience + 1)] > history_loss[-i]: + return False + print(patience, "次loss未下降,训练停止") + return True + + +def shuffle(data, label): + label = tf.expand_dims(label, axis=-1) + total = tf.concat([data, label], axis=-1) + total = tf.random.shuffle(total) + data = total[:, :, :-1] + label = total[:, :, -1] + query = tf.expand_dims(label, axis=-1) + return data, label, query + + +def splitValData(data, label, val_radio=0.2): + size, filter_num, dims = data.shape + val_data = data[:int(size * val_radio), :, :] + train_data = data[int(size * val_radio):, :, :] + val_label = label[:int(size * val_radio), :] + train_label = label[int(size * val_radio):, :] + val_query = tf.expand_dims(val_label, axis=-1) + train_query = tf.expand_dims(train_label, axis=-1) + + return (train_data, train_label, train_query), (val_data, val_label, val_query) + + +def Is_Reduce_learning_rate(history_loss, patience=3): + if len(history_loss) <= patience: + return False + for i in range(patience): + if history_loss[-(patience + 1)] > history_loss[-i]: + return False + print(patience, "次loss未下降,降低学习率") + return True + + +def predict_model(): + input = tf.keras.Input(shape=[filter_num, dims]) + input = tf.cast(input, tf.float32) + LSTM = LSTM_realize(units=10, batch_size=batch_size, if_SA=False, if_Conv=True, if_mutiHead=False, + num_heads=2)(inputs=input, layer='ConvLSTM') + + # LSTM = LSTM_object(inputs=input, layer='SA_ConvLSTM1') + # LSTM = tf.keras.layers.LSTM(units=20,return_sequences=True)(input) + # LSTM = tf.keras.layers.LSTM(units=10,return_sequences=True)(input) + bn = tf.keras.layers.BatchNormalization()(LSTM) + drop = tf.keras.layers.Dropout(0.2)(bn) + + # # LSTM_object = LSTM_realize(units=256, batch_size=batch_size, if_SA=False, if_Conv=False, if_mutiHead=False, + # # num_heads=2) + # # LSTM = LSTM_object(inputs=drop, layer='LSTM') + # LSTM=tf.keras.layers.LSTM(units=256,return_sequences=True)(drop) + # bn = tf.keras.layers.BatchNormalization()(LSTM) + # drop = tf.keras.layers.Dropout(0.2)(bn) + # + # + # # LSTM_object = LSTM_realize(units=128, batch_size=batch_size, if_SA=False, if_Conv=False, if_mutiHead=False, + # # num_heads=2) + # # LSTM = LSTM_object(inputs=drop, layer='LSTM') + # LSTM = tf.keras.layers.LSTM(units=128, return_sequences=True)(drop) + # bn = tf.keras.layers.BatchNormalization()(LSTM) + # drop = tf.keras.layers.Dropout(0.2)(bn) + # # LSTM = LSTM_object(inputs=input, layer='LSTM') + # d1 = tf.keras.layers.Dense(64)(drop) + # bn = tf.keras.layers.BatchNormalization()(d1) + # drop = tf.keras.layers.Dropout(0.2)(bn) + # + # d1 = tf.keras.layers.Dense(32)(drop) + # bn = tf.keras.layers.BatchNormalization()(d1) + # drop = tf.keras.layers.Dropout(0.2)(bn) + # + d1 = tf.keras.layers.Dense(5)(drop) + bn = tf.keras.layers.BatchNormalization()(d1) + + # drop = tf.keras.layers.Dropout(0.2)(bn) + output = tf.keras.layers.Dense(1, name='output')(bn) + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +def self_train(): + model = PredictModel(batch_size=batch_size) + # # # # TODO 需要运行编译一次,才能打印model.summary() + # model.build(input_shape=(batch_size, filter_num, dims)) + # model.summary() + history_loss = [] + history_val_loss = [] + learning_rate = 1e-3 + for epoch in range(EPOCH): + train_data, train_label, query_label = shuffle(train_data, train_label) + if epoch == 0: + (train_data, train_label, query_label), (val_data, val_label, val_query) = splitValData(data=train_data, + label=train_label, + val_radio=0.2) + print() + print("EPOCH:", epoch, "/", EPOCH, ":") + # 用于让train知道,这是这个epoch中的第几次训练 + z = 0 + # 用于batch_size次再训练 + k = 1 + for data_1, label_1 in zip(train_data, train_label): + size, _, _ = train_data.shape + data_1 = tf.expand_dims(data_1, axis=0) + label_1 = tf.expand_dims(label_1, axis=0) + if batch_size != 1: + if k % batch_size == 1: + data = data_1 + label = label_1 + else: + data = tf.concat([data, data_1], axis=0) + label = tf.concat([label, label_1], axis=0) + else: + data = data_1 + label = label_1 + + if k % batch_size == 0: + label = tf.expand_dims(label, axis=-1) + loss_value = model.train(input_tensor=data, label=label, query=query_label, learning_rate=learning_rate, + z=z) + print(z * batch_size, "/", size, ":===============>", "loss:", loss_value.numpy()) + k = 0 + z = z + 1 + k = k + 1 + + val_loss = model.get_val_loss(val_data=val_data, val_label=val_label, val_query=val_query, batch_size=1) + SaveBestModel(model=model, history_loss=history_val_loss, loss_value=val_loss.numpy()) + history_val_loss.append(val_loss) + history_loss.append(loss_value.numpy()) + print('Training loss is :', loss_value.numpy()) + print('Validating loss is :', val_loss.numpy()) + if IsStopTraining(history_loss=history_val_loss, patience=7): + break + if Is_Reduce_learning_rate(history_loss=history_val_loss, patience=3): + learning_rate = 1e-4 + + +def lr_schedule(epoch): + # Learning Rate Schedule + + lr = 1e-3 + total_epochs = EPOCH + check_1 = int(total_epochs * 0.9) + check_2 = int(total_epochs * 0.8) + check_3 = int(total_epochs * 0.6) + check_4 = int(total_epochs * 0.4) + + if epoch > check_1: + lr *= 1e-4 + elif epoch > check_2: + lr *= 1e-3 + elif epoch > check_3: + lr *= 1e-2 + elif epoch > check_4: + lr *= 1e-1 + + return lr + + +def split_data(train_data, train_label): + return train_data[:1150, :, :], train_label[:1150, :], train_data[-70:, :, :], train_label[-70:, :] + + +# +if __name__ == '__main__': + # 超参数设置 + filter_num = 50 # 时间部 + dims = 10 # 表示一个点的维度 + unit = 20 + batch_size = 32 + EPOCH = 1000 + model_name = 'self_LSTM' + predict_num = 50 + + # save_name = "../model/weight/{0}_unit{1}_FilterNum{2}_Dims{3}_Epoch{4}_weight/weight".format(model_name, unit, + # filter_num, dims, + # EPOCH) + save_name = "../model/{0}_unit{1}_FilterNum{2}_Dims{3}_Epoch{4}.h5".format(model_name, unit, + filter_num, dims, + EPOCH) + save_loss_name = "../model/loss/{0}_unit{1}_FilterNum{2}_Dims{3}_Epoch{4}_loss.npy".format(model_name, unit, + filter_num, + dims, + EPOCH) + predict_name = "../data/predict_data/{0}_FilterNum{1}_Dims{2}_BatchSize{3}_Epoch{4}_predict{5}.npy".format( + model_name, + filter_num, + dims, + batch_size, + EPOCH, + predict_num) + + predict_data, train_data, train_label, query_label, total_data, HI_merge_data_origin = getData( + filter_num=filter_num, dims=dims, batch_size=batch_size) + + model = predict_model() + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=1, + save_best_only=True, + mode='min', + period=1) + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=5, min_lr=0.001) + + model.compile(optimizer=tf.optimizers.Adam(0.01), loss=FTMSE()) + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=200, mode='min', verbose=1) + + train_data, train_label, val_data, val_label = split_data(train_data=train_data, train_label=train_label) + + history = model.fit(train_data, train_label, epochs=EPOCH, + batch_size=batch_size, validation_data=(val_data, val_label), shuffle=False, verbose=1, + callbacks=[checkpoint, lr_scheduler, early_stop]) + # # # # model.save(save_name) + # newModel = tf.keras.models.load_model(save_name, custom_objects={'LSTM_realize': LSTM_realize}) + + # fig4 = plt.figure() + # ax4 = fig4.add_subplot() + # plt.plot(history.epoch, history.history.get('loss'), label='loss') + # plt.plot(history.epoch, history.history.get('val_loss'), label='val_loss') + # plt.show() + + # loss_folder = save_loss_name[:-4] + # folderGenerate(loss_folder) + # np.save(save_loss_name, history_loss) + + # newModel = PredictModel(filter_num=filter_num, dims=dims, batch_size=batch_size, query_label=query_label) + # newModel.load_weights(save_name) + # # history_loss=np.load(save_loss_name) + # # print(history_loss) + # + # + # # # ''' + # # # train_data.shape:(570,600,30) + # # # predict_data.shape:(571,600,30) + # # # train_label.shape:(570,600) + # # # query_label.shape:(570,600,1) # # # ''' + # # 连续预测五十个点并画出来 + # predict_num = 50 + # all_data = predictOneByOneWithBatch1(newModel=newModel, predict_data=predict_data, predict_num=predict_num) + # + # # all_data = predictContinued(predict_data=predict_data, predict_num=predict_num) + # # all_data = predictOneByOne(predict_data=predict_data, predict_num=predict_num) + # # all_data = selfPredictContinued(predict_data=predict_data, query_label=query_label, predict_num=predict_num) + # # all_data = selfPredictOneByOne(predict_data=predict_data, query_label=query_label, predict_num=predict_num) + # + # # 获取到的所有data进行画图 + # print(all_data.shape) # (700,600,1) + # (all_dims,) = all_data.shape + # all_x = np.arange(all_dims) + # print(all_x.shape) + # # np.save(predict_name, all_data) + # + # before_data = total_data + # (before_dims,) = before_data.shape + # before_x = np.arange(before_dims) + # all_x = np.arange(all_dims) + # + # fig5 = plt.figure() + # ax5 = fig5.add_subplot(2, 1, 1) + # ax5.plot(all_data) + # ax5.plot(before_data) + # ax51 = fig5.add_subplot(2, 1, 2) + # ax51.plot(HI_merge_data_origin[0:all_dims, 1]) + # plt.show() + # + # print("before_data.shape:", before_data.shape) + # print("flatten_all_data.shape:", all_data.shape) + # print("before_x.shape:", before_x.shape) + # print("all_x.shape:", all_x.shape) + # + # fig6 = plt.figure() + # ax6 = fig6.add_subplot() + # plt.plot(before_x, before_data) + # plt.scatter(before_x, before_data) + # plt.scatter(all_x, all_data) + # plt.show() + + # fig4 = plt.figure() + # ax4 = fig4.add_subplot() + # plt.plot(history.epoch, history.history.get('loss'), label='loss') + # # plt.plot(history.epoch, history.history.get('val_loss'), label='val_loss') + # plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/__init__.py b/TensorFlow_eaxmple/Model_train_test/2012轴承数据集预测挑战/train/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/FFTUtils.py b/TensorFlow_eaxmple/Model_train_test/RUL/FFTUtils.py new file mode 100644 index 0000000..d7f47f5 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/FFTUtils.py @@ -0,0 +1,55 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/13 21:32 +@Usage : +@Desc : FFT的工具类 +''' +import numpy as np +import tensorflow as tf + + +''' +freq_value: 可以是时域通过np.fft.fft转换而来 +''' +def ifft(freq_value): + # 幅值 + amp = np.abs(freq_value / len(freq_value)) + # 相角 + angle = np.angle(freq_value) + length = len(amp) + + result = [] + for t in range(length): + wk = 2 * np.pi * np.arange(length) / length + cur = np.sum(amp * np.cos(wk * t + angle)) + result.append(cur) + + return result + +def fft(time_value): + + pass + +if __name__ == '__main__': + array = np.array([-0.029078494757, + -0.33095228672, + -0.12124221772, + 0.553512275219, + -0.158036053181, + 0.268739402294, + -0.638222515583, + 0.233140587807, + -0.173265621066, + 0.467218101025, + -0.372010827065, + -0.136630430818, + 0.343256533146, + 0.008932195604]) + + print(np.fft.fft(array)) + array_fft = np.fft.fft(array) + + print(ifft(array)) + # print(array_fft) diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/ResultShowUtils.py b/TensorFlow_eaxmple/Model_train_test/RUL/ResultShowUtils.py new file mode 100644 index 0000000..30b17e0 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/ResultShowUtils.py @@ -0,0 +1,116 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 15:28 +@Usage : +@Desc : 一些画图方法 +''' +from sklearn.metrics import mean_absolute_error, mean_squared_error +from pylab import * + +# 图像上显示中文 +mpl.rcParams['font.sans-serif'] = ['SimHei'] +# 调整使图像支持负号 +mpl.rcParams["axes.unicode_minus"] = False + +font1 = { + 'family': 'Times New Roman', + 'weight': 'normal', + 'size': 12, +} + +font2 = { + 'family': 'Times New Roman', + 'weight': 'normal', + 'size': 15, +} + + +def calScore(y_test, pred): + # TODO 打印误差 + test_mse = round(mean_squared_error(y_test, pred), 4) + test_rmse = round(math.sqrt(mean_squared_error(y_test, pred)), 4) + # mape 暂时这样 + test_mape = round(mean_absolute_error(pred, y_test) * 100, 4) + test_mae = round(mean_absolute_error(pred, y_test), 4) + # TODO 计算得分 + result = list(np.squeeze(pred, 1)) + exceed = list(filter(lambda res: res >= y_test[-1], result)) + print("len(exceed)", len(exceed)) + if len(exceed) > 0: + exceed_index = result.index(exceed[0]) + print("len(result)", len(result)) + # Eri = round((((2750 - (len(result) - exceed_index)) - 2750) / 2750), 4) + Eri = round((exceed_index / len(result)), 4) + print("RUL", 100 - (len(result) - exceed_index)) + print("Eri", Eri) + + if Eri <= 0: + score = round(math.exp(-math.log(0.5, e) * (Eri / 5)), 4) + else: + score = round(math.exp(math.log(0.5, e) * (Eri / 20)), 4) + print("score1", score) + score = exceed_index / len(result) + else: + Eri = nan + score = nan + + print('MSE_testScore: %.4f MSE' % test_mse) + print('RMSE_testScore: %.4f RMSE' % test_rmse) + print('MAE_testScore: %.4f MAE' % test_mae) + print('MAPE_testScore: %.4f MAPE' % test_mape) + print("score: %.4f score" % score) + pass + + +# 画图 +def getPlot(data, feature, time_step, x_train, x_test, pred, truePred, train_pred, + saveName="../store/test"): + train_pred = np.squeeze(train_pred, 1) + print("train_pred", train_pred) + + # TODO 实际值 + # 设置xtick和ytick的方向:in、out、inout + plt.rcParams['xtick.direction'] = 'in' + plt.rcParams['ytick.direction'] = 'in' + plt.plot(list(range(data.shape[0])), data) + # 画出 y=1 这条水平线 + plt.axhline(data[-1], c='green') + plt.grid() + + plt.ylim(0, 1) + plt.xlim(-50, 1300) + + # TODO 真实预测散点图 + + # TODO 图2 + plt.figure(2) + point_len = x_train.shape[0] + feature + time_step - 1 + + # plt.figure(2, figsize=(12, 4)) + # 设置xtick和ytick的方向:in、out、inout + plt.rcParams['xtick.direction'] = 'in' + plt.rcParams['ytick.direction'] = 'in' + + print("pred", pred[:, -1]) + print("truePred", truePred[:, -1]) + figname2 = saveName + "single.png" + plt.scatter(list(range(data.shape[0])), data, c='blue', s=12, label='Actual value') + # # TODO 这里要改成Training value 10(重叠丢失) + 9(转置) +1141(训练数据已知) + 9(转置) = 1169 + 81 (预测数据) =1250 + # # 训练数据传入模型预测一次即为训练数据 + plt.plot(list(range(time_step + feature - 1, point_len)), train_pred, linewidth=2, color='red', + label='Training value') + + plt.scatter(list(range(point_len, point_len + x_test.shape[0])), pred, c='black', s=15, + label='Predictive value') + # 画出 y=1 这条水平线 + plt.axhline(data[-1], linewidth=2, c='green', label='Failure threshold') + plt.ylim(-0.2, 0.95) + plt.xlim(-50, 1300) + plt.xlabel("Serial number of the fusion feature point", font=font2) + plt.ylabel("Virtual health indicator", font=font2) + plt.legend(loc='upper left', prop=font1) + plt.savefig(figname2, ) + + diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/__init__.py new file mode 100644 index 0000000..f0e85e4 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/13 19:42 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/good_model/dctLSTM/LSTMTest.py b/TensorFlow_eaxmple/Model_train_test/RUL/good_model/dctLSTM/LSTMTest.py new file mode 100644 index 0000000..df3969f --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/good_model/dctLSTM/LSTMTest.py @@ -0,0 +1,229 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 14:56 +@Usage : +@Desc : 测试所实现的LSTM +''' + +import tensorflow as tf +import numpy as np +from model.LSTM.DCTAttention_embed_LSTM import AttentionEmbedLSTMLayer as LSTMLayer +# from model.LSTM.LSTM import LSTMLayer as LSTMLayer +import matplotlib.pyplot as plt +from keras.callbacks import EarlyStopping + +from model.LossFunction.FTMSE import FTMSE +import math +from sklearn.metrics import mean_absolute_error, mean_squared_error +from pylab import * + +''' +超参数设置: +''' +hidden_num = 10 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 32 +EPOCH = 1000 +unit = 512 # LSTM的维度 +predict_num = 50 # 预测个数 +model_name = "dctLSTM" +save_name = r"self_{0}_hidden{1}_unit{2}_feature{3}_predict{4}.h5".format(model_name, hidden_num, unit, feature, + predict_num) + + +def getData(filter_num, dims): + # 数据读入 + HI_merge_data_origin = np.load("../../2012轴承数据集预测挑战/HI_create/HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + train_data = tf.transpose(train_data, [1, 2, 0]) + + # todo 解决模型保存时,query无法序列化的问题 + total_data = tf.cast(HI_merge_data, dtype=tf.float32) + train_data = tf.cast(train_data, dtype=tf.float32) + train_label = tf.cast(train_label, dtype=tf.float32) + train_label_single = tf.cast(train_label_single, dtype=tf.float32) + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +''' +train_data.shape: (total_dims - filter_num - 1, filter_num,dims) :(570,600,30) +predict_data.shape: (total_dims - filter_num, filter_num) :(571,600,30) +train_label.shape: (total_dims - filter_num - 1, filter_num) :(570,600) +''' + + +def remove(train_data, train_label, batch_size): + epoch, _, _ = train_data.shape + size = int(epoch / batch_size) + return train_data[:size * batch_size], train_label[:size * batch_size] + + +''' +train_data.shape: (1230, 10, 10) +train_label.shape: (1230, 10) +train_label_single.shape: (1230,) +''' + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def predict_model(filter_num, dims): + input = tf.keras.Input(shape=[filter_num, dims]) + input = tf.cast(input, tf.float32) + + #### 官方 + # LSTM = tf.keras.layers.LSTM(units=512, return_sequences=True)(input) + # LSTM = tf.keras.layers.LSTM(units=256, return_sequences=False)(LSTM) + + #### 自己 + # LSTM = tf.keras.layers.Conv1D(512, kernel_size=8, padding='same')(input) + LSTM = LSTMLayer(units=512, return_sequences=True)(input) + LSTM = LSTMLayer(units=256, return_sequences=False)(LSTM) + + x = tf.keras.layers.Dense(128, activation="relu")(LSTM) + x = tf.keras.layers.Dense(64, activation="relu")(x) + x = tf.keras.layers.Dropout(0.2)(x) + x = tf.keras.layers.BatchNormalization()(x) + x = tf.keras.layers.Dense(32, activation="relu")(x) + x = tf.keras.layers.Dropout(0.2)(x) + x = tf.keras.layers.BatchNormalization()(x) + x = tf.keras.layers.Dense(16, activation="relu")(x) + output = tf.keras.layers.Dense(1, activation="relu", name='output')(x) + + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +def split_data(train_data, train_label): + return train_data[:1150, :, :], train_label[:1150, :], train_data[-70:, :, :], train_label[-70:, :] + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(newModel, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = np.expand_dims(train_data[-1, :, :], axis=0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = newModel.predict(each_predict_data) # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + # (1,1) => (10,1) + temp1 = np.transpose(np.concatenate([each_predict_data[:, 1:, -1], predicted_data], axis=1), [1, 0]) + + each_predict_data = np.expand_dims( + np.concatenate([np.squeeze(each_predict_data[:, :, 1:], axis=0), temp1], axis=1), axis=0) + + return predicted_list + + +# 不使用预测的数据,直接使用已知的数据持续预测 +def predictByEveryData(trained_model: tf.keras.Model, predict_data): + predicted_data = trained_model.predict(predict_data) + predicted_data = np.concatenate([np.expand_dims(total_data[:hidden_num + feature, ], axis=1), predicted_data], + axis=0) + data = predictOneByOne(trained_model, predict_data) + predicted_data = np.concatenate([predicted_data, data], axis=0) + return predicted_data + pass + + +if __name__ == '__main__': + # 数据读取 + # 数据读入 --> 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + # # # #### TODO 训练 + model = predict_model(hidden_num, feature) + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=10, min_lr=0.001) + + model.compile(optimizer=tf.optimizers.SGD(), loss=tf.losses.mse) + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=20, mode='min', verbose=1) + + history = model.fit(train_data, train_label_single, epochs=EPOCH, validation_data=(val_data, val_label_single), + shuffle=True, verbose=1, + callbacks=[checkpoint, lr_scheduler, early_stop]) + + #### TODO 测试 + + trained_model = tf.keras.models.load_model(save_name, custom_objects={'AttentionEmbedLSTMLayer': LSTMLayer}) + + # 使用已知的点进行预测 + print("开始预测") + predicted_data = predictByEveryData(trained_model, train_data) + # 使用预测的点持续预测 + # predicted_data = predictOneByOne(trained_model, total_data, train_data) + + print("predicted_data:", predicted_data) + print("predicted_data.shape:", predicted_data.shape) + + plt.figure(1) + plt.subplot(2, 1, 1) + plt.plot(total_data) + # plt.subplot(2, 1, 2) + plt.plot(predicted_data) + + # plt.scatter() + + plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/adaRNN.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/adaRNN.py new file mode 100644 index 0000000..902909f --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/adaRNN.py @@ -0,0 +1,361 @@ +import torch +import torch.nn as nn +from loss_transfer import TransferLoss +import torch.nn.functional as F +import tensorflow as tf + + +''' +参考: +[1] https://arxiv.org/pdf/2108.04443.pdf +[2] https://github.com/kevinding1125/transferlearning/blob/master/code/deep/adarnn/base/AdaRNN.py +''' + + +class AdaRNN(nn.Module): + """ + model_type: 'Boosting', 'AdaRNN' + """ + + def __init__(self, use_bottleneck=False, bottleneck_width=256, n_input=128, n_hiddens=[64, 64], n_output=6, dropout=0.0, len_seq=9, model_type='AdaRNN', trans_loss='mmd'): + super(AdaRNN, self).__init__() + self.use_bottleneck = use_bottleneck + self.n_input = n_input + self.num_layers = len(n_hiddens) + self.hiddens = n_hiddens + self.n_output = n_output + self.model_type = model_type + self.trans_loss = trans_loss + self.len_seq = len_seq + in_size = self.n_input + + features = nn.ModuleList() + for hidden in n_hiddens: + rnn = nn.GRU( + input_size=in_size, + num_layers=1, + hidden_size=hidden, + batch_first=True, + dropout=dropout + ) + features.append(rnn) + in_size = hidden + self.features = nn.Sequential(*features) + + if use_bottleneck == True: # finance + self.bottleneck = nn.Sequential( + nn.Linear(n_hiddens[-1], bottleneck_width), + nn.Linear(bottleneck_width, bottleneck_width), + nn.BatchNorm1d(bottleneck_width), + nn.ReLU(), + nn.Dropout(), + ) + self.bottleneck[0].weight.data.normal_(0, 0.005) + self.bottleneck[0].bias.data.fill_(0.1) + self.bottleneck[1].weight.data.normal_(0, 0.005) + self.bottleneck[1].bias.data.fill_(0.1) + self.fc = nn.Linear(bottleneck_width, n_output) + torch.nn.init.xavier_normal_(self.fc.weight) + else: + self.fc_out = nn.Linear(n_hiddens[-1], self.n_output) + + if self.model_type == 'AdaRNN': + gate = nn.ModuleList() + for i in range(len(n_hiddens)): + gate_weight = nn.Linear( + len_seq * self.hiddens[i]*2, len_seq) + gate.append(gate_weight) + self.gate = gate + + bnlst = nn.ModuleList() + for i in range(len(n_hiddens)): + bnlst.append(nn.BatchNorm1d(len_seq)) + self.bn_lst = bnlst + self.softmax = torch.nn.Softmax(dim=0) + self.init_layers() + + def init_layers(self): + for i in range(len(self.hiddens)): + self.gate[i].weight.data.normal_(0, 0.05) + self.gate[i].bias.data.fill_(0.0) + + def forward_pre_train(self, x, len_win=0): + out = self.gru_features(x) + fea = out[0] + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + out_list_all, out_weight_list = out[1], out[2] + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)).cuda() + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = j - len_win if j - len_win >= 0 else 0 + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] if self.model_type == 'AdaRNN' else 1 / ( + self.len_seq - h_start) * (2 * len_win + 1) + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def gru_features(self, x, predict=False): + x_input = x + out = None + out_lis = [] + out_weight_list = [] if ( + self.model_type == 'AdaRNN') else None + for i in range(self.num_layers): + out, _ = self.features[i](x_input.float()) + x_input = out + out_lis.append(out) + if self.model_type == 'AdaRNN' and predict == False: + out_gate = self.process_gate_weight(x_input, i) + out_weight_list.append(out_gate) + return out, out_lis, out_weight_list + + def process_gate_weight(self, out, index): + x_s = out[0: int(out.shape[0]//2)] + x_t = out[out.shape[0]//2: out.shape[0]] + x_all = torch.cat((x_s, x_t), 2) + x_all = x_all.view(x_all.shape[0], -1) + weight = torch.sigmoid(self.bn_lst[index]( + self.gate[index](x_all.float()))) + weight = torch.mean(weight, dim=0) + res = self.softmax(weight).squeeze() + return res + + def get_features(self, output_list): + fea_list_src, fea_list_tar = [], [] + for fea in output_list: + fea_list_src.append(fea[0: fea.size(0) // 2]) + fea_list_tar.append(fea[fea.size(0) // 2:]) + return fea_list_src, fea_list_tar + + # For Boosting-based + def forward_Boosting(self, x, weight_mat=None): + out = self.gru_features(x) + fea = out[0] + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + out_list_all = out[1] + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)).cuda() + if weight_mat is None: + weight = (1.0 / self.len_seq * + torch.ones(self.num_layers, self.len_seq)).cuda() + else: + weight = weight_mat + dist_mat = torch.zeros(self.num_layers, self.len_seq).cuda() + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + for j in range(self.len_seq): + loss_trans = criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, j, :]) + loss_transfer = loss_transfer + weight[i, j] * loss_trans + dist_mat[i, j] = loss_trans + return fc_out, loss_transfer, dist_mat, weight + + # For Boosting-based + def update_weight_Boosting(self, weight_mat, dist_old, dist_new): + epsilon = 1e-12 + dist_old = dist_old.detach() + dist_new = dist_new.detach() + ind = dist_new > dist_old + epsilon + weight_mat[ind] = weight_mat[ind] * \ + (1 + torch.sigmoid(dist_new[ind] - dist_old[ind])) + weight_norm = torch.norm(weight_mat, dim=1, p=1) + weight_mat = weight_mat / weight_norm.t().unsqueeze(1).repeat(1, self.len_seq) + return weight_mat + + def predict(self, x): + out = self.gru_features(x, predict=True) + fea = out[0] + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + return fc_out + + + + + + +class AdaRNN_tensorflow(tf.keras.Model): + def __init__(self, use_bottleneck=False, bottleneck_width=256, n_input=128, n_hiddens=[64, 64], n_output=6, dropout=0.0, len_seq=9, model_type='AdaRNN', trans_loss='mmd'): + super(AdaRNN, self).__init__() + self.use_bottleneck = use_bottleneck + self.n_input = n_input + self.num_layers = len(n_hiddens) + self.hiddens = n_hiddens + self.n_output = n_output + self.model_type = model_type + self.trans_loss = trans_loss + self.len_seq = len_seq + + self.features = tf.keras.Sequential() + for hidden in n_hiddens: + rnn = tf.keras.layers.GRU( + units=hidden, + return_sequences=True, + dropout=dropout + ) + self.features.add(rnn) + + if use_bottleneck == True: + self.bottleneck = tf.keras.Sequential([ + tf.keras.layers.Dense(bottleneck_width), + tf.keras.layers.Dense(bottleneck_width), + tf.keras.layers.BatchNormalization(), + tf.keras.layers.ReLU(), + tf.keras.layers.Dropout(dropout) + ]) + self.fc = tf.keras.layers.Dense(n_output, activation=None) + + else: + self.fc_out = tf.keras.layers.Dense(n_output, activation=None) + + if self.model_type == 'AdaRNN': + self.gate = [] + for _ in range(len(n_hiddens)): + gate_weight = tf.keras.layers.Dense(len_seq, activation=None) + self.gate.append(gate_weight) + self.bn_lst = [tf.keras.layers.BatchNormalization() for _ in range(len(n_hiddens))] + self.softmax = tf.keras.layers.Softmax(axis=0) + # self.init_layers() # 省去了很多初始化相关的工作 + + # def init_layers(self): + # for gate_layer in self.gate: + # gate_layer.build((None, self.len_seq * self.hiddens[i] * 2)) + + def forward_pre_train(self, x, len_win=0): + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out, out_list_all, out_weight_list = self.gru_features(x) + fea =out + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + + out_list_s, out_list_t = self.get_features(out_list_all) + + loss_transfer = tf.zeros((1,)) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = j - len_win if j - len_win >= 0 else 0 + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] if self.model_type == 'AdaRNN' else 1 / ( + self.len_seq - h_start) * (2 * len_win + 1) + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def call(self, x, len_win=0, training=False): + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out, out_list_all, out_weight_list = self.gru_features(x, training=training) + fea = out + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck) + else: + fc_out = self.fc_out(fea[:, -1, :]) + + loss_transfer = tf.zeros((1,)) + for i in range(len(out_list_all)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_all[i].shape[2]) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = j - len_win if j - len_win >= 0 else 0 + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] if self.model_type == 'AdaRNN' else 1 / ( + self.len_seq - h_start) * (2 * len_win + 1) + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_all[i][:, j, :], out_list_all[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def gru_features(self, x, training=False): + x_input = x + out = None + out_lis = [] + out_weight_list = [] if ( + self.model_type == 'AdaRNN') else None + for i in range(self.num_layers): + out = self.features[i](x_input, training=training) + x_input = out + out_lis.append(out) + if self.model_type == 'AdaRNN': + out_gate = self.process_gate_weight(x_input, i, training=training) + out_weight_list.append(out_gate) + return out, out_lis, out_weight_list + + def process_gate_weight(self, out, index, training=False): + x_s = out[:, :out.shape[1] // 2]# 可以理解为LSTM的前半段 + x_t = out[:, out.shape[1] // 2:]# 可以理解为LSTM的后半段 + x_all = tf.concat((x_s, x_t), 2) + x_all = tf.reshape(x_all, (x_all.shape[0], -1)) + weight = tf.sigmoid(self.bn_lst[index](self.gate[index](x_all)), training=training) + weight = tf.reduce_mean(weight, axis=0) + res = self.softmax(weight) + return res + + def get_features(self, output_list): + fea_list_src, fea_list_tar = [], [] + for fea in output_list: + fea_list_src.append(fea[:, :fea.shape[1] // 2]) + fea_list_tar.append(fea[:, fea.shape[1] // 2:]) + return fea_list_src, fea_list_tar + + def forward_Boosting(self, x, weight_mat=None): + out, out_list_all, _ = self.gru_features(x, training=False) + fea = out + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck) + else: + fc_out = self.fc_out(fea[:, -1, :]) + + out_list_all = out_list_all + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = tf.zeros((1,)) + if weight_mat is None: + weight = (1.0 / self.len_seq * + tf.ones((self.num_layers, self.len_seq), dtype=tf.float32)) + else: + weight = weight_mat + dist_mat = tf.zeros((self.num_layers, self.len_seq), dtype=tf.float32) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + for j in range(self.len_seq): + loss_trans = criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, j, :]) + loss_transfer = loss_transfer + weight[i, j] * loss_trans + dist_mat[i, j] = loss_trans + return fc_out, loss_transfer, dist_mat, weight + + def update_weight_Boosting(self, weight_mat, dist_old, dist_new): + epsilon = 1e-12 + dist_old = tf.stop_gradient(dist_old) + dist_new = tf.stop_gradient(dist_new) + ind = dist_new diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_act.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_act.py new file mode 100644 index 0000000..234ed76 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_act.py @@ -0,0 +1,108 @@ +# encoding=utf-8 + +import numpy as np +from torch.utils.data import Dataset, DataLoader +from torchvision import transforms +import os +# from config import config_info +from sklearn.preprocessing import StandardScaler + + +# This is for parsing the X data, you can ignore it if you do not need preprocessing +def format_data_x(datafile): + x_data = None + for item in datafile: + item_data = np.loadtxt(item, dtype=np.float) + if x_data is None: + x_data = np.zeros((len(item_data), 1)) + x_data = np.hstack((x_data, item_data)) + x_data = x_data[:, 1:] + print(x_data.shape) + X = None + for i in range(len(x_data)): + row = np.asarray(x_data[i, :]) + row = row.reshape(9, 128).T + if X is None: + X = np.zeros((len(x_data), 128, 9)) + X[i] = row + print(X.shape) + return X + + +# This is for parsing the Y data, you can ignore it if you do not need preprocessing +def format_data_y(datafile): + data = np.loadtxt(datafile, dtype=np.int) - 1 + YY = np.eye(6)[data] + return YY + + +# Load data function, if there exists parsed data file, then use it +# If not, parse the original dataset from scratch +def load_data(data_folder, domain): + import os + domain = '1_20' if domain == 'A' else '21_30' + data_file = os.path.join(data_folder, 'data_har_' + domain + '.npz') + if os.path.exists(data_file): + data = np.load(data_file) + X_train = data['X_train'] + Y_train = data['Y_train'] + X_test = data['X_test'] + Y_test = data['Y_test'] + else: + # This for processing the dataset from scratch + # After downloading the dataset, put it to somewhere that str_folder can find + str_folder = config_info['data_folder_raw'] + 'UCI HAR Dataset/' + INPUT_SIGNAL_TYPES = [ + "body_acc_x_", + "body_acc_y_", + "body_acc_z_", + "body_gyro_x_", + "body_gyro_y_", + "body_gyro_z_", + "total_acc_x_", + "total_acc_y_", + "total_acc_z_" + ] + + str_train_files = [str_folder + 'train/' + 'Inertial Signals/' + item + 'train.txt' for item in + INPUT_SIGNAL_TYPES] + str_test_files = [str_folder + 'test/' + 'Inertial Signals/' + + item + 'test.txt' for item in INPUT_SIGNAL_TYPES] + str_train_y = str_folder + 'train/y_train.txt' + str_test_y = str_folder + 'test/y_test.txt' + + X_train = format_data_x(str_train_files) + X_test = format_data_x(str_test_files) + Y_train = format_data_y(str_train_y) + Y_test = format_data_y(str_test_y) + + return X_train, onehot_to_label(Y_train), X_test, onehot_to_label(Y_test) + + +def onehot_to_label(y_onehot): + a = np.argwhere(y_onehot == 1) + return a[:, -1] + + +class data_loader(Dataset): + def __init__(self, samples, labels, t): + self.samples = samples + self.labels = labels + self.T = t + + def __getitem__(self, index): + sample, target = self.samples[index], self.labels[index] + if self.T: + return self.T(sample), target + else: + return sample, target + + def __len__(self): + return len(self.samples) + + +def normalize(x): + x_min = x.min(axis=(0, 2, 3), keepdims=True) + x_max = x.max(axis=(0, 2, 3), keepdims=True) + x_norm = (x - x_min) / (x_max - x_min) + return x_norm \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_process.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_process.py new file mode 100644 index 0000000..117feac --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_process.py @@ -0,0 +1,139 @@ +# encoding=utf-8 +import os +import data_act as data_act +import pandas as pd +import data_weather as data_weather +import datetime +from ..loss_transfer import TransferLoss +import torch +import math +import data_process + + +def load_act_data(data_folder, batch_size=64, domain="1_20"): + x_train, y_train, x_test, y_test = data_act.load_data(data_folder, domain) + x_train, x_test = x_train.reshape( + (-1, x_train.shape[2], 1, x_train.shape[1])), x_test.reshape((-1, x_train.shape[2], 1, x_train.shape[1])) + transform = None + train_set = data_act.data_loader(x_train, y_train, transform) + test_set = data_act.data_loader(x_test, y_test, transform) + train_loader = data_act.DataLoader( + train_set, batch_size=batch_size, shuffle=True, drop_last=True) + test_loader = data_act.DataLoader( + test_set, batch_size=batch_size, shuffle=False) + return train_loader, train_loader, test_loader + + +def load_weather_data(file_path, batch_size=6, station='Changping'): + data_file = os.path.join(file_path, "PRSA_Data_1.pkl") + mean_train, std_train = data_weather.get_weather_data_statistic(data_file, station=station, + start_time='2013-3-1 0:0', + end_time='2016-10-30 23:0') + train_loader = data_weather.get_weather_data(data_file, station=station, start_time='2013-3-6 0:0', + end_time='2015-5-31 23:0', batch_size=batch_size, mean=mean_train, + std=std_train) + valid_train_loader = data_weather.get_weather_data(data_file, station=station, start_time='2015-6-2 0:0', + end_time='2016-6-30 23:0', batch_size=batch_size, + mean=mean_train, std=std_train) + valid_vld_loader = data_weather.get_weather_data(data_file, station=station, start_time='2016-7-2 0:0', + end_time='2016-10-30 23:0', batch_size=batch_size, mean=mean_train, + std=std_train) + test_loader = data_weather.get_weather_data(data_file, station=station, start_time='2016-11-2 0:0', + end_time='2017-2-28 23:0', batch_size=batch_size, mean=mean_train, + std=std_train) + return train_loader, valid_train_loader, valid_vld_loader, test_loader + + +def get_split_time(num_domain=2, mode='pre_process', data_file=None, station=None, dis_type='coral'): + spilt_time = { + '2': [('2013-3-6 0:0', '2015-5-31 23:0'), ('2015-6-2 0:0', '2016-6-30 23:0')] + } + if mode == 'pre_process': + return spilt_time[str(num_domain)] + if mode == 'tdc': + return TDC(num_domain, data_file, station, dis_type=dis_type) + else: + print("error in mode") + + +def TDC(num_domain, data_file, station, dis_type='coral'): + start_time = datetime.datetime.strptime( + '2013-03-01 00:00:00', '%Y-%m-%d %H:%M:%S') + end_time = datetime.datetime.strptime( + '2016-06-30 23:00:00', '%Y-%m-%d %H:%M:%S') + num_day = (end_time - start_time).days + split_N = 10 + data = pd.read_pickle(data_file)[station] + feat = data[0][0:num_day] + feat = torch.tensor(feat, dtype=torch.float32) + feat_shape_1 = feat.shape[1] + feat = feat.reshape(-1, feat.shape[2]) + feat = feat.cuda() + # num_day_new = feat.shape[0] + + selected = [0, 10] + candidate = [1, 2, 3, 4, 5, 6, 7, 8, 9] + start = 0 + + if num_domain in [2, 3, 5, 7, 10]: + while len(selected) - 2 < num_domain - 1: + distance_list = [] + for can in candidate: + selected.append(can) + selected.sort() + dis_temp = 0 + for i in range(1, len(selected) - 1): + for j in range(i, len(selected) - 1): + index_part1_start = start + math.floor(selected[i - 1] / split_N * num_day) * feat_shape_1 + index_part1_end = start + math.floor(selected[i] / split_N * num_day) * feat_shape_1 + feat_part1 = feat[index_part1_start: index_part1_end] + index_part2_start = start + math.floor(selected[j] / split_N * num_day) * feat_shape_1 + index_part2_end = start + math.floor(selected[j + 1] / split_N * num_day) * feat_shape_1 + feat_part2 = feat[index_part2_start:index_part2_end] + criterion_transder = TransferLoss(loss_type=dis_type, input_dim=feat_part1.shape[1]) + dis_temp += criterion_transder.compute(feat_part1, feat_part2) + distance_list.append(dis_temp) + selected.remove(can) + can_index = distance_list.index(max(distance_list)) + selected.append(candidate[can_index]) + candidate.remove(candidate[can_index]) + selected.sort() + res = [] + for i in range(1, len(selected)): + if i == 1: + sel_start_time = start_time + datetime.timedelta(days=int(num_day / split_N * selected[i - 1]), hours=0) + else: + sel_start_time = start_time + datetime.timedelta(days=int(num_day / split_N * selected[i - 1]) + 1, + hours=0) + sel_end_time = start_time + datetime.timedelta(days=int(num_day / split_N * selected[i]), hours=23) + sel_start_time = datetime.datetime.strftime(sel_start_time, '%Y-%m-%d %H:%M') + sel_end_time = datetime.datetime.strftime(sel_end_time, '%Y-%m-%d %H:%M') + res.append((sel_start_time, sel_end_time)) + return res + else: + print("error in number of domain") + + +def load_weather_data_multi_domain(file_path, batch_size=6, station='Changping', number_domain=2, mode='pre_process', + dis_type='coral'): + # mode: 'tdc', 'pre_process' + data_file = os.path.join(file_path, "PRSA_Data_1.pkl") + mean_train, std_train = data_weather.get_weather_data_statistic(data_file, station=station, + start_time='2013-3-1 0:0', + end_time='2016-10-30 23:0') + split_time_list = get_split_time(number_domain, mode=mode, data_file=data_file, station=station, dis_type=dis_type) + train_list = [] + for i in range(len(split_time_list)): + time_temp = split_time_list[i] + train_loader = data_weather.get_weather_data(data_file, station=station, start_time=time_temp[0], + end_time=time_temp[1], batch_size=batch_size, mean=mean_train, + std=std_train) + train_list.append(train_loader) + + valid_vld_loader = data_weather.get_weather_data(data_file, station=station, start_time='2016-7-2 0:0', + end_time='2016-10-30 23:0', batch_size=batch_size, mean=mean_train, + std=std_train) + test_loader = data_weather.get_weather_data(data_file, station=station, start_time='2016-11-2 0:0', + end_time='2017-2-28 23:0', batch_size=batch_size, mean=mean_train, + std=std_train, shuffle=False) + return train_list, valid_vld_loader, test_loader \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_weather.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_weather.py new file mode 100644 index 0000000..9b18d19 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/dataset/data_weather.py @@ -0,0 +1,132 @@ +import math +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import os +from pandas.core.frame import DataFrame +from torch.utils.data import Dataset, DataLoader +import torch +import pickle +import datetime + + +class data_loader(Dataset): + def __init__(self, df_feature, df_label, df_label_reg, t=None): + + assert len(df_feature) == len(df_label) + assert len(df_feature) == len(df_label_reg) + + # df_feature = df_feature.reshape(df_feature.shape[0], df_feature.shape[1] // 6, df_feature.shape[2] * 6) + self.df_feature = df_feature + self.df_label = df_label + self.df_label_reg = df_label_reg + + self.T = t + self.df_feature = torch.tensor( + self.df_feature, dtype=torch.float32) + self.df_label = torch.tensor( + self.df_label, dtype=torch.float32) + self.df_label_reg = torch.tensor( + self.df_label_reg, dtype=torch.float32) + + def __getitem__(self, index): + sample, target, label_reg = self.df_feature[index], self.df_label[index], self.df_label_reg[index] + if self.T: + return self.T(sample), target + else: + return sample, target, label_reg + + def __len__(self): + return len(self.df_feature) + + +def create_dataset(df, station, start_date, end_date, mean=None, std=None): + data = df[station] + feat, label, label_reg = data[0], data[1], data[2] + referece_start_time = datetime.datetime(2013, 3, 1, 0, 0) + referece_end_time = datetime.datetime(2017, 2, 28, 0, 0) + + assert (pd.to_datetime(start_date) - referece_start_time).days >= 0 + assert (pd.to_datetime(end_date) - referece_end_time).days <= 0 + assert (pd.to_datetime(end_date) - pd.to_datetime(start_date)).days >= 0 + index_start = (pd.to_datetime(start_date) - referece_start_time).days + index_end = (pd.to_datetime(end_date) - referece_start_time).days + feat = feat[index_start: index_end + 1] + label = label[index_start: index_end + 1] + label_reg = label_reg[index_start: index_end + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return data_loader(feat, label, label_reg) + + +def create_dataset_shallow(df, station, start_date, end_date, mean=None, std=None): + data = df[station] + feat, label, label_reg = data[0], data[1], data[2] + referece_start_time = datetime.datetime(2013, 3, 1, 0, 0) + referece_end_time = datetime.datetime(2017, 2, 28, 0, 0) + + assert (pd.to_datetime(start_date) - referece_start_time).days >= 0 + assert (pd.to_datetime(end_date) - referece_end_time).days <= 0 + assert (pd.to_datetime(end_date) - pd.to_datetime(start_date)).days >= 0 + index_start = (pd.to_datetime(start_date) - referece_start_time).days + index_end = (pd.to_datetime(end_date) - referece_start_time).days + feat = feat[index_start: index_end + 1] + label = label[index_start: index_end + 1] + label_reg = label_reg[index_start: index_end + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return feat, label_reg + + +def get_dataset_statistic(df, station, start_date, end_date): + data = df[station] + feat, label = data[0], data[1] + referece_start_time = datetime.datetime(2013, 3, 1, 0, 0) + referece_end_time = datetime.datetime(2017, 2, 28, 0, 0) + + assert (pd.to_datetime(start_date) - referece_start_time).days >= 0 + assert (pd.to_datetime(end_date) - referece_end_time).days <= 0 + assert (pd.to_datetime(end_date) - pd.to_datetime(start_date)).days >= 0 + index_start = (pd.to_datetime(start_date) - referece_start_time).days + index_end = (pd.to_datetime(end_date) - referece_start_time).days + feat = feat[index_start: index_end + 1] + label = label[index_start: index_end + 1] + feat = feat.reshape(-1, feat.shape[2]) + mu_train = np.mean(feat, axis=0) + sigma_train = np.std(feat, axis=0) + + return mu_train, sigma_train + + +def get_weather_data(data_file, station, start_time, end_time, batch_size, shuffle=True, mean=None, std=None): + df = pd.read_pickle(data_file) + + dataset = create_dataset(df, station, start_time, + end_time, mean=mean, std=std) + train_loader = DataLoader( + dataset, batch_size=batch_size, shuffle=shuffle) + return train_loader + + +def get_weather_data_shallow(data_file, station, start_time, end_time, batch_size, shuffle=True, mean=None, std=None): + df = pd.read_pickle(data_file) + + feat, label_reg = create_dataset_shallow(df, station, start_time, + end_time, mean=mean, std=std) + + return feat, label_reg + + +def get_weather_data_statistic(data_file, station, start_time, end_time): + df = pd.read_pickle(data_file) + mean_train, std_train = get_dataset_statistic( + df, station, start_time, end_time) + return mean_train, std_train diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/loss/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/loss/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/loss/mmd.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/loss/mmd.py new file mode 100644 index 0000000..d307275 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/loss/mmd.py @@ -0,0 +1,115 @@ +import torch +import torch.nn as nn + +class MMD_loss(nn.Module): + def __init__(self, kernel_type='linear', kernel_mul=2.0, kernel_num=5): + super(MMD_loss, self).__init__() + self.kernel_num = kernel_num + self.kernel_mul = kernel_mul + self.fix_sigma = None + self.kernel_type = kernel_type + + def guassian_kernel(self, source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None): + n_samples = int(source.size()[0]) + int(target.size()[0]) + total = torch.cat([source, target], dim=0) + total0 = total.unsqueeze(0).expand( + int(total.size(0)), int(total.size(0)), int(total.size(1))) + total1 = total.unsqueeze(1).expand( + int(total.size(0)), int(total.size(0)), int(total.size(1))) + L2_distance = ((total0-total1)**2).sum(2) + if fix_sigma: + bandwidth = fix_sigma + else: + bandwidth = torch.sum(L2_distance.data) / (n_samples**2-n_samples) + bandwidth /= kernel_mul ** (kernel_num // 2) + bandwidth_list = [bandwidth * (kernel_mul**i) + for i in range(kernel_num)] + kernel_val = [torch.exp(-L2_distance / bandwidth_temp) + for bandwidth_temp in bandwidth_list] + return sum(kernel_val) + + def linear_mmd(self, X, Y): + delta = X.mean(axis=0) - Y.mean(axis=0) + loss = delta.dot(delta.T) + return loss + + def forward(self, source, target): + if self.kernel_type == 'linear': + return self.linear_mmd(source, target) + elif self.kernel_type == 'rbf': + batch_size = int(source.size()[0]) + kernels = self.guassian_kernel( + source, target, kernel_mul=self.kernel_mul, kernel_num=self.kernel_num, fix_sigma=self.fix_sigma) + with torch.no_grad(): + XX = torch.mean(kernels[:batch_size, :batch_size]) + YY = torch.mean(kernels[batch_size:, batch_size:]) + XY = torch.mean(kernels[:batch_size, batch_size:]) + YX = torch.mean(kernels[batch_size:, :batch_size]) + loss = torch.mean(XX + YY - XY - YX) + return loss + + +import tensorflow as tf +import numpy as np + + +class MMDLoss(tf.keras.losses.Loss): + def __init__(self, kernel_type='linear', kernel_mul=2.0, kernel_num=5): + super(MMDLoss, self).__init__() + self.kernel_type = kernel_type + self.kernel_mul = kernel_mul + self.kernel_num = kernel_num + + def guassian_kernel(self, source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None): + n_samples = int(source.shape[0]) + int(target.shape[0]) + total = tf.concat([source, target], axis=0) + total0 = tf.expand_dims(total, 0) + total0 = tf.tile(total0, [total.shape[0], 1, 1]) + total1 = tf.expand_dims(total, 1) + total1 = tf.tile(total1, [1, total.shape[0], 1]) + L2_distance = tf.reduce_sum((total0 - total1) ** 2, axis=2) + + if fix_sigma: + bandwidth = fix_sigma + else: + bandwidth = tf.reduce_sum(L2_distance) / (n_samples ** 2 - n_samples) + bandwidth /= kernel_mul ** (kernel_num // 2) + bandwidth_list = [bandwidth * (kernel_mul ** i) + for i in range(kernel_num)] + kernel_val = [tf.exp(-L2_distance / bandwidth_temp) + for bandwidth_temp in bandwidth_list] + return sum(kernel_val) + + def linear_mmd(self, X, Y): + delta = tf.reduce_mean(X, axis=0) - tf.reduce_mean(Y, axis=0) + loss = tf.linalg.matmul(delta, delta, transpose_b=True) + return loss + + def call(self, source, target): + if self.kernel_type == 'linear': + return self.linear_mmd(source, target) + elif self.kernel_type == 'rbf': + batch_size = int(source.shape[0]) + kernels = self.guassian_kernel( + source, target, kernel_mul=self.kernel_mul, kernel_num=self.kernel_num, fix_sigma=None) + with tf.GradientTape(persistent=True) as tape: + tape.watch(kernels) + XX = tf.reduce_mean(kernels[:batch_size, :batch_size]) + YY = tf.reduce_mean(kernels[batch_size:, batch_size:]) + XY = tf.reduce_mean(kernels[:batch_size, batch_size:]) + YX = tf.reduce_mean(kernels[batch_size:, :batch_size]) + loss = XX + YY - XY - YX + return loss + + + +if __name__ == '__main__': + # 示例用法 + source = np.random.randn(100, 128) + target = np.random.randn(100, 128) + source_tf = tf.convert_to_tensor(source, dtype=tf.float32) + target_tf = tf.convert_to_tensor(target, dtype=tf.float32) + + mmd_loss = MMDLoss(kernel_type='rbf', kernel_mul=2.0, kernel_num=5) + loss = mmd_loss(source_tf, target_tf) + print("MMD Loss:", loss.numpy()) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/loss_transfer.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/loss_transfer.py new file mode 100644 index 0000000..e71278a --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/loss_transfer.py @@ -0,0 +1,54 @@ +from loss import adv_loss, CORAL, kl_js, mmd, mutual_info, cosine, pairwise_dist + + +class TransferLoss(object): + def __init__(self, loss_type='cosine', input_dim=512): + """ + Supported loss_type: mmd(mmd_lin), mmd_rbf, coral, cosine, kl, js, mine, adv + """ + self.loss_type = loss_type + self.input_dim = input_dim + + def compute(self, X, Y): + """Compute adaptation loss + + Arguments: + X {tensor} -- source matrix + Y {tensor} -- target matrix + + Returns: + [tensor] -- transfer loss + """ + if self.loss_type == 'mmd_lin' or self.loss_type =='mmd': + mmdloss = mmd.MMD_loss(kernel_type='linear') + loss = mmdloss(X, Y) + elif self.loss_type == 'coral': + loss = CORAL(X, Y) + elif self.loss_type == 'cosine' or self.loss_type == 'cos': + loss = 1 - cosine(X, Y) + elif self.loss_type == 'kl': + loss = kl_js.kl_div(X, Y) + elif self.loss_type == 'js': + loss = kl_js.js(X, Y) + elif self.loss_type == 'mine': + mine_model = mutual_info.Mine_estimator( + input_dim=self.input_dim, hidden_dim=60).cuda() + loss = mine_model(X, Y) + elif self.loss_type == 'adv': + loss = adv_loss.adv(X, Y, input_dim=self.input_dim, hidden_dim=32) + elif self.loss_type == 'mmd_rbf': + mmdloss = mmd.MMD_loss(kernel_type='rbf') + loss = mmdloss(X, Y) + elif self.loss_type == 'pairwise': + pair_mat = pairwise_dist(X, Y) + import torch + loss = torch.norm(pair_mat) + + return loss + +if __name__ == "__main__": + import torch + trans_loss = TransferLoss('adv') + a = (torch.randn(5,512) * 10).cuda() + b = (torch.randn(5,512) * 10).cuda() + print(trans_loss.compute(a, b)) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/train_weather.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/train_weather.py new file mode 100644 index 0000000..327c8bc --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/adaRNN/train_weather.py @@ -0,0 +1,463 @@ +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np + +from tqdm import tqdm +from utils import utils +from base.AdaRNN import AdaRNN + +import pretty_errors +import dataset.data_process as data_process +import matplotlib.pyplot as plt + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if args.log_file is None: + return + with open(args.log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + n_hiddens = [args.hidden_size for i in range(args.num_layers)] + return AdaRNN(use_bottleneck=True, bottleneck_width=64, n_input=args.d_feat, n_hiddens=n_hiddens, + n_output=args.class_num, dropout=args.dropout, model_type=name, len_seq=args.len_seq, + trans_loss=args.loss_type).cuda() + + +def train_AdaRNN(args, model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(args.num_layers, args.len_seq).cuda() + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].cuda().float( + ), data[1].cuda().long(), data[2].cuda().float() + list_feat.append(feature) + list_label.append(label_reg) + flag = False + index = get_index(len(data_all) - 1) + for temp_index in index: + s1 = temp_index[0] + s2 = temp_index[1] + if list_feat[s1].shape[0] != list_feat[s2].shape[0]: + flag = True + break + if flag: + continue + + total_loss = torch.zeros(1).cuda() + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < args.pre_epoch: + pred_all, loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=args.len_win) + else: + pred_all, loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + total_loss = total_loss + loss_s + loss_t + args.dw * loss_transfer + loss_all.append( + [total_loss.item(), (loss_s + loss_t).item(), loss_transfer.item()]) + loss_1_all.append(loss_l1.item()) + optimizer.zero_grad() + total_loss.backward() + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + if epoch >= args.pre_epoch: + if epoch > args.pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def train_epoch_transfer_Boosting(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(args.num_layers, args.len_seq).cuda() + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].cuda().float( + ), data[1].cuda().long(), data[2].cuda().float() + list_feat.append(feature) + list_label.append(label_reg) + flag = False + index = get_index(len(data_all) - 1) + for temp_index in index: + s1 = temp_index[0] + s2 = temp_index[1] + if list_feat[s1].shape[0] != list_feat[s2].shape[0]: + flag = True + break + if flag: + continue + + total_loss = torch.zeros(1).cuda() + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + feature_all = torch.cat((feature_s, feature_t), 0) + + pred_all, loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + total_loss = total_loss + loss_s + loss_t + args.dw * loss_transfer + + loss_all.append( + [total_loss.item(), (loss_s + loss_t).item(), loss_transfer.item()]) + loss_1_all.append(loss_l1.item()) + optimizer.zero_grad() + total_loss.backward() + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + if epoch > 0: # args.pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def train_epoch_transfer(args, model, optimizer, train_loader_list): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].cuda().float( + ), data[1].cuda().long(), data[2].cuda().float() + list_feat.append(feature) + list_label.append(label_reg) + flag = False + index = get_index(len(data_all) - 1) + for temp_index in index: + s1 = temp_index[0] + s2 = temp_index[1] + if list_feat[s1].shape[0] != list_feat[s2].shape[0]: + flag = True + break + if flag: + continue + + ############### + total_loss = torch.zeros(1).cuda() + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + feature_all = torch.cat((feature_s, feature_t), 0) + + pred_all, loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=args.len_win) + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + total_loss = total_loss + loss_s + loss_t + args.dw * loss_transfer + loss_all.append( + [total_loss.item(), (loss_s + loss_t).item(), loss_transfer.item()]) + loss_1_all.append(loss_l1.item()) + optimizer.zero_grad() + total_loss.backward() + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + return loss, loss_l1, out_weight_list + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def test_epoch(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.cuda().float(), label_reg.cuda().float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = loss_r / len(test_loader) + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.cuda().float(), label_reg.cuda().float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + list_name = ['train', 'valid', 'test'] + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(args.num_layers, args.len_seq).cuda() + for i in range(args.num_layers): + for j in range(args.len_seq): + weight[i, j] = init_weight[i][j].item() + return weight + + +def main_transfer(args): + print(args) + + output_path = args.outdir + '_' + args.station + '_' + args.model_name + '_weather_' + \ + args.loss_type + '_' + str(args.pre_epoch) + \ + '_' + str(args.dw) + '_' + str(args.lr) + save_model_name = args.model_name + '_' + args.loss_type + \ + '_' + str(args.dw) + '_' + str(args.lr) + '.pkl' + utils.dir_exist(output_path) + pprint('create loaders...') + + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + args.data_path, args.batch_size, args.station, args.num_domain, args.data_mode) + + args.log_file = os.path.join(output_path, 'run.log') + pprint('create model...') + model = get_model(args.model_name) + num_model = count_parameters(model) + print('#model params:', num_model) + + optimizer = optim.Adam(model.parameters(), lr=args.lr) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + + for epoch in range(args.n_epochs): + pprint('Epoch:', epoch) + pprint('training...') + if args.model_name in ['Boosting']: + loss, loss1, weight_mat, dist_mat = train_epoch_transfer_Boosting( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + elif args.model_name in ['AdaRNN']: + loss, loss1, weight_mat, dist_mat = train_AdaRNN( + args, model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + else: + print("error in model_name!") + pprint(loss, loss1) + + pprint('evaluating...') + train_loss, train_loss_l1, train_loss_r = test_epoch( + model, train_loader_list[0], prefix='Train') + val_loss, val_loss_l1, val_loss_r = test_epoch( + model, valid_loader, prefix='Valid') + test_loss, test_loss_l1, test_loss_r = test_epoch( + model, test_loader, prefix='Test') + + pprint('valid %.6f, test %.6f' % + (val_loss_l1, test_loss_l1)) + + if val_loss < best_score: + best_score = val_loss + stop_round = 0 + best_epoch = epoch + torch.save(model.state_dict(), os.path.join( + output_path, save_model_name)) + else: + stop_round += 1 + if stop_round >= args.early_stop: + pprint('early stop') + break + + pprint('best val score:', best_score, '@', best_epoch) + + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, save_model_name), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=6) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='adv') + parser.add_argument('--station', type=str, default='Dongsi') + parser.add_argument('--data_mode', type=str, + default='tdc') + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=24) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="/root/Messi_du/adarnn/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + args = get_args() + np.random.seed(args.seed) + torch.manual_seed(args.seed) + torch.cuda.manual_seed_all(args.seed) + torch.backends.cudnn.deterministic = True + torch.backends.cudnn.benchmark = False + os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu_id) + main_transfer(args) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/attn.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/attn.py new file mode 100644 index 0000000..f8283c0 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/attn.py @@ -0,0 +1,320 @@ +import torch +import torch.nn as nn +import torch.nn.functional as F +import numpy as np + +from math import sqrt +from utils.masking import TriangularCausalMask, ProbMask + +''' +参考: +[1]https://arxiv.org/pdf/2307.00493v1.pdf +[2]https://github.com/nhatthanhtran/FWin2023/blob/main/models/model.py +''' +class FullAttention(nn.Module): + def __init__(self, mask_flag=True, factor=5, scale=None, attention_dropout=0.1, output_attention=False): + super(FullAttention, self).__init__() + self.scale = scale + self.mask_flag = mask_flag + self.output_attention = output_attention + self.dropout = nn.Dropout(attention_dropout) + + def forward(self, queries, keys, values, attn_mask): + B, L, H, E = queries.shape + _, S, _, D = values.shape + scale = self.scale or 1./sqrt(E) + + scores = torch.einsum("blhe,bshe->bhls", queries, keys) + if self.mask_flag: + if attn_mask is None: + attn_mask = TriangularCausalMask(B, L, device=queries.device) + + scores.masked_fill_(attn_mask.mask, -np.inf) + + A = self.dropout(torch.softmax(scale * scores, dim=-1)) + V = torch.einsum("bhls,bshd->blhd", A, values) + + if self.output_attention: + return (V.contiguous(), A) + else: + return (V.contiguous(), None) + + +class ProbAttention(nn.Module): + def __init__(self, mask_flag=True, factor=5, scale=None, attention_dropout=0.1, output_attention=False): + super(ProbAttention, self).__init__() + self.factor = factor + self.scale = scale + self.mask_flag = mask_flag + self.output_attention = output_attention + self.dropout = nn.Dropout(attention_dropout) + + def _prob_QK(self, Q, K, sample_k, n_top): # n_top: c*ln(L_q) + # Q [B, H, L, D] + B, H, L_K, E = K.shape + _, _, L_Q, _ = Q.shape + + # calculate the sampled Q_K + K_expand = K.unsqueeze(-3).expand(B, H, L_Q, L_K, E) + + + + # real U = U_part(factor*ln(L_k))*L_q + index_sample = torch.randint(L_K, (L_Q, sample_k)) + # print(index_sample.shape) + K_sample = K_expand[:, :, torch.arange( + L_Q).unsqueeze(1), index_sample, :] + Q_K_sample = torch.matmul( + Q.unsqueeze(-2), K_sample.transpose(-2, -1)).squeeze(-2) + + # find the Top_k query with sparisty measurement + M = Q_K_sample.max(-1)[0] - torch.div(Q_K_sample.sum(-1), L_K) + M_top = M.topk(n_top, sorted=False)[1] + + # use the reduced Q to calculate Q_K + Q_reduce = Q[torch.arange(B)[:, None, None], + torch.arange(H)[None, :, None], + M_top, :] # factor*ln(L_q) + + Q_K = torch.matmul(Q_reduce, K.transpose(-2, -1)) # factor*ln(L_q)*L_k + + return Q_K, M_top + + def _get_initial_context(self, V, L_Q): + B, H, L_V, D = V.shape + if not self.mask_flag: + # V_sum = V.sum(dim=-2) + V_sum = V.mean(dim=-2) + contex = V_sum.unsqueeze(-2).expand(B, H, + L_Q, V_sum.shape[-1]).clone() + else: # use mask + # requires that L_Q == L_V, i.e. for self-attention only + assert(L_Q == L_V) + contex = V.cumsum(dim=-2) + return contex + + def _update_context(self, context_in, V, scores, index, L_Q, attn_mask): + B, H, L_V, D = V.shape + + if self.mask_flag: + attn_mask = ProbMask(B, H, L_Q, index, scores, device=V.device) + scores.masked_fill_(attn_mask.mask, -np.inf) + + attn = torch.softmax(scores, dim=-1) # nn.Softmax(dim=-1)(scores) + + context_in[torch.arange(B)[:, None, None], + torch.arange(H)[None, :, None], + index, :] = torch.matmul(attn, V).type_as(context_in) + if self.output_attention: + attns = (torch.ones([B, H, L_V, L_V]) / + L_V).type_as(attn).to(attn.device) + attns[torch.arange(B)[:, None, None], torch.arange(H)[ + None, :, None], index, :] = attn + return (context_in, attns) + else: + return (context_in, None) + + def forward(self, queries, keys, values, attn_mask): + B, L_Q, H, D = queries.shape + _, L_K, _, _ = keys.shape + + queries = queries.transpose(2, 1) + keys = keys.transpose(2, 1) + values = values.transpose(2, 1) + + U_part = self.factor * \ + np.ceil(np.log(L_K)).astype('int').item() # c*ln(L_k) + u = self.factor * \ + np.ceil(np.log(L_Q)).astype('int').item() # c*ln(L_q) + + U_part = U_part if U_part < L_K else L_K + u = u if u < L_Q else L_Q + + scores_top, index = self._prob_QK( + queries, keys, sample_k=U_part, n_top=u) + + # add scale factor + scale = self.scale or 1./sqrt(D) + if scale is not None: + scores_top = scores_top * scale + # get the context + context = self._get_initial_context(values, L_Q) + + # update the context with selected top_k queries + context, attn = self._update_context( + context, values, scores_top, index, L_Q, attn_mask) + + return context.transpose(2, 1).contiguous(), attn + + +class AttentionLayer(nn.Module): + def __init__(self, attention, d_model, n_heads, + d_keys=None, d_values=None, mix=False, layer_num=0): + super(AttentionLayer, self).__init__() + + d_keys = d_keys or (d_model//n_heads) + d_values = d_values or (d_model//n_heads) + + self.inner_attention = attention + self.query_projection = nn.Linear(d_model, d_keys * n_heads) + self.key_projection = nn.Linear(d_model, d_keys * n_heads) + self.value_projection = nn.Linear(d_model, d_values * n_heads) + self.out_projection = nn.Linear(d_values * n_heads, d_model) + self.n_heads = n_heads + self.mix = mix + self.layer_num = layer_num + def forward(self, queries, keys, values, attn_mask): + + B, L, _ = queries.shape + _, S, _ = keys.shape + H = self.n_heads + + queries = self.query_projection(queries).view(B, L, H, -1) + keys = self.key_projection(keys).view(B, S, H, -1) + values = self.value_projection(values).view(B, S, H, -1) + + + out, attn = self.inner_attention( + queries, + keys, + values, + attn_mask + ) + + if self.mix: + out = out.transpose(2, 1).contiguous() + out = out.view(B, L, -1) + + return self.out_projection(out), attn + +class AttentionLayerWin(nn.Module): + def __init__(self, attention, d_model, n_heads, + d_keys=None, d_values=None, mix=False, layer_num=0, + window_size=8, output_attention=False): + super(AttentionLayerWin, self).__init__() + d_keys = d_keys or (d_model//n_heads) + d_values = d_values or (d_model//n_heads) + + self.inner_attention = attention + self.query_projection = nn.Linear(d_model, d_keys * n_heads) + self.key_projection = nn.Linear(d_model, d_keys * n_heads) + self.value_projection = nn.Linear(d_model, d_values * n_heads) + self.out_projection = nn.Linear(d_values * n_heads, d_model) + + self.n_heads = n_heads + self.mix = mix + self.layer_num = layer_num + self.window_size = window_size + self.output_attn = output_attention + def forward(self, queries, keys, values, attn_mask): + + B, L, _ = queries.shape + _, S, _ = keys.shape + H = self.n_heads + + queries = self.query_projection(queries).view(B, L, H, -1) + keys = self.key_projection(keys).view(B, S, H, -1) + values = self.value_projection(values).view(B, S, H, -1) + + #Partition the vectors into windows + queries = queries.view(B*(L//self.window_size), self.window_size, H, -1) + keys = keys.view(B*(S//self.window_size), self.window_size, H, -1) + values = values.view(B*(S//self.window_size), self.window_size, H, -1) + + + out, attn = self.inner_attention( + queries, + keys, + values, + attn_mask + ) + + if self.output_attn: + attn = self._output_attn(L, attn) + + out = out.view(B, L, H, -1) + + if self.mix: + out = out.transpose(2, 1).contiguous() + out = out.view(B, L, -1) + + return self.out_projection(out), attn + + def _output_attn(self,L, attn): + num_window = L//self.window_size + + for k in range(num_window): + if k==0: + p2d = (0,((num_window-(k+1))*self.window_size)) + attn_tmp = F.pad(attn[:self.window_size,:,:,:],p2d) + else: + p2d = (k*self.window_size, (num_window-(k+1))*self.window_size) + attn_tmp = torch.cat((attn_tmp, F.pad(attn[k*self.window_size:(k+1)*self.window_size,:,:,:],p2d)),dim=2) + + return attn_tmp + + +class AttentionLayerCrossWin(nn.Module): + def __init__(self, attention, d_model, n_heads, + d_keys=None, d_values=None, mix=False, layer_num=0, + num_windows=4, output_attention=False): + super(AttentionLayerCrossWin, self).__init__() + d_keys = d_keys or (d_model//n_heads) + d_values = d_values or (d_model//n_heads) + + self.inner_attention = attention + self.query_projection = nn.Linear(d_model, d_keys * n_heads) + self.key_projection = nn.Linear(d_model, d_keys * n_heads) + self.value_projection = nn.Linear(d_model, d_values * n_heads) + self.out_projection = nn.Linear(d_values * n_heads, d_model) + + self.n_heads = n_heads + self.mix = mix + self.layer_num = layer_num + self.num_windows = num_windows + self.output_attn = output_attention + def forward(self, queries, keys, values, attn_mask): + + B, L, _ = queries.shape + _, S, _ = keys.shape + H = self.n_heads + + queries = self.query_projection(queries).view(B, L, H, -1) + keys = self.key_projection(keys).view(B, S, H, -1) + values = self.value_projection(values).view(B, S, H, -1) + + #Partition the vectors into windows + queries = queries.view(B*self.num_windows, L//self.num_windows, H, -1) + keys = keys.view(B*self.num_windows, S//self.num_windows, H, -1) + values = values.view(B*self.num_windows, S//self.num_windows, H, -1) + + out, attn = self.inner_attention( + queries, + keys, + values, + attn_mask + ) + + if self.output_attn: + attn = self._output_attn(L, attn) + + out = out.view(B, L, H, -1) + + if self.mix: + out = out.transpose(2, 1).contiguous() + out = out.view(B, L, -1) + + return self.out_projection(out), attn + + def _output_attn(self,L, attn): + window_size = L//self.num_windows + + for k in range(self.num_window): + if k==0: + p2d = (0,((self.num_windows-(k+1))*window_size)) + attn_tmp = F.pad(attn[:window_size,:,:,:],p2d) + else: + p2d = (k*window_size, (self.num_windows-(k+1))*window_size) + attn_tmp = torch.cat((attn_tmp, F.pad(attn[k*window_size:(k+1)*window_size,:,:,:],p2d)),dim=2) + + return attn_tmp \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/attn_tensorflow.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/attn_tensorflow.py new file mode 100644 index 0000000..519d07c --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/attn_tensorflow.py @@ -0,0 +1,130 @@ +import tensorflow as tf +from tensorflow.keras import layers + +class AttentionLayerWin(tf.keras.layers.Layer): + def __init__(self, attention, d_model, n_heads, + d_keys=None, d_values=None, mix=False, layer_num=0, + window_size=8, output_attention=False): + super(AttentionLayerWin, self).__init__() + d_keys = d_keys or (d_model // n_heads) + d_values = d_values or (d_model // n_heads) + + self.inner_attention = attention + self.query_projection = layers.Dense(d_keys * n_heads) + self.key_projection = layers.Dense(d_keys * n_heads) + self.value_projection = layers.Dense(d_values * n_heads) + self.out_projection = layers.Dense(d_model) + + self.n_heads = n_heads + self.mix = mix + self.layer_num = layer_num + self.window_size = window_size + self.output_attn = output_attention + + def call(self, queries, keys, values, attn_mask): + B, L, _ = queries.shape + _, S, _ = keys.shape + H = self.n_heads + + queries = tf.reshape(self.query_projection(queries), (B, L, H, -1)) + keys = tf.reshape(self.key_projection(keys), (B, S, H, -1)) + values = tf.reshape(self.value_projection(values), (B, S, H, -1)) + + queries = tf.reshape(queries, (B * (L // self.window_size), self.window_size, H, -1)) + keys = tf.reshape(keys, (B * (S // self.window_size), self.window_size, H, -1)) + values = tf.reshape(values, (B * (S // self.window_size), self.window_size, H, -1)) + + out, attn = self.inner_attention( + queries, + keys, + values, + attn_mask + ) + + if self.output_attn: + attn = self._output_attn(L, attn) + + out = tf.reshape(out, (B, L, H, -1)) + + if self.mix: + out = tf.transpose(out, (0, 2, 1, 3)) + out = tf.reshape(out, (B, L, -1)) + + return self.out_projection(out), attn + + def _output_attn(self, L, attn): + num_window = L // self.window_size + + for k in range(num_window): + if k == 0: + p2d = ((0, ((num_window - (k + 1)) * self.window_size)), (0, 0)) + attn_tmp = tf.pad(attn[:self.window_size, :, :, :], p2d) + else: + p2d = ((k * self.window_size, (num_window - (k + 1)) * self.window_size), (0, 0)) + attn_tmp = tf.concat((attn_tmp, tf.pad(attn[k * self.window_size:(k + 1) * self.window_size, :, :, :], p2d)), axis=2) + + return attn_tmp + +class AttentionLayerCrossWin(tf.keras.layers.Layer): + def __init__(self, attention, d_model, n_heads, + d_keys=None, d_values=None, mix=False, layer_num=0, + num_windows=4, output_attention=False): + super(AttentionLayerCrossWin, self).__init__() + d_keys = d_keys or (d_model // n_heads) + d_values = d_values or (d_model // n_heads) + + self.inner_attention = attention + self.query_projection = layers.Dense(d_keys * n_heads) + self.key_projection = layers.Dense(d_keys * n_heads) + self.value_projection = layers.Dense(d_values * n_heads) + self.out_projection = layers.Dense(d_model) + + self.n_heads = n_heads + self.mix = mix + self.layer_num = layer_num + self.num_windows = num_windows + self.output_attn = output_attention + + def call(self, queries, keys, values, attn_mask): + B, L, _ = queries.shape + _, S, _ = keys.shape + H = self.n_heads + + queries = tf.reshape(self.query_projection(queries), (B, L, H, -1)) + keys = tf.reshape(self.key_projection(keys), (B, S, H, -1)) + values = tf.reshape(self.value_projection(values), (B, S, H, -1)) + + queries = tf.reshape(queries, (B * self.num_windows, L // self.num_windows, H, -1)) + keys = tf.reshape(keys, (B * self.num_windows, S // self.num_windows, H, -1)) + values = tf.reshape(values, (B * self.num_windows, S // self.num_windows, H, -1)) + + out, attn = self.inner_attention( + queries, + keys, + values, + attn_mask + ) + + if self.output_attn: + attn = self._output_attn(L, attn) + + out = tf.reshape(out, (B, L, H, -1)) + + if self.mix: + out = tf.transpose(out, (0, 2, 1, 3)) + out = tf.reshape(out, (B, L, -1)) + + return self.out_projection(out), attn + + def _output_attn(self, L, attn): + window_size = L // self.num_windows + + for k in range(self.num_windows): + if k == 0: + p2d = ((0, ((self.num_windows - (k + 1)) * window_size)), (0, 0)) + attn_tmp = tf.pad(attn[:window_size, :, :, :], p2d) + else: + p2d = ((k * window_size, (self.num_windows - (k + 1)) * window_size), (0, 0)) + attn_tmp = tf.concat((attn_tmp, tf.pad(attn[k * window_size:(k + 1) * window_size, :, :, :], p2d)), axis=2) + + return attn_tmp diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/fourier.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/fourier.py new file mode 100644 index 0000000..110821b --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/fourier.py @@ -0,0 +1,71 @@ +import torch +import torch.nn as nn +import torch.nn.functional as F + +import numpy as np + +''' +参考: +[1]https://arxiv.org/pdf/2307.00493v1.pdf +[2]https://github.com/nhatthanhtran/FWin2023/blob/main/models/model.py +''' + +class FourierMix(nn.Module): + def __init__(self, d_model): + super().__init__() + self.fourier = FourierLayer(1, 2) + self.norm = nn.LayerNorm(d_model) + + def forward(self, x, attn_mask=None): + x = self.fourier(x) + x = self.norm(x) + return x, None + + +class FourierLayer(nn.Module): + def __init__(self, seq_dim=1, hidden_dim=2): + super().__init__() + self.seq_dim = seq_dim + self.hidden_dim = hidden_dim + + def forward(self, x): + B, L, D = x.shape + return torch.real(torch.fft.fft(torch.fft.fft(x, dim=self.hidden_dim), dim=self.seq_dim)) + + +class FeedFoward(nn.Module): + def __init__(self, d_model, dropout=0.1, activation="relu") -> None: + super().__init__() + self.fc1 = nn.Linear(d_model, d_model) + self.activation = F.relu if activation == "relu" else F.gelu + self.fc2 = nn.Linear(d_model, d_model) + self.dropout = nn.Dropout(dropout) + + def forward(self, x): + x = self.fc1(x) + x = self.dropout(x) + x = self.activation(x) + x = self.dropout(self.fc2(x)) + + return x + + +class FNetLayer(nn.Module): + def __init__(self, d_model, dropout=0.1, activation="relu"): + super().__init__() + self.fourier = FourierLayer(1, 2) + self.feedforward = FeedFoward(d_model, dropout, activation) + self.dropout = nn.Dropout(dropout) + self.norm1 = nn.LayerNorm(d_model) + self.norm2 = nn.LayerNorm(d_model) + + def forward(self, x, attn_mask=None): + new_x = self.fourier(x) + x = x + self.dropout(new_x) + + x = self.norm1(x) + x = x + self.feedforward(x) + return self.norm2(x), None + + + diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/fourier_tensorflow.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/fourier_tensorflow.py new file mode 100644 index 0000000..3fa5afe --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/fouier_mix/fourier_tensorflow.py @@ -0,0 +1,57 @@ +import tensorflow as tf +from tensorflow.keras import layers + +class FourierLayer(tf.keras.layers.Layer): + def __init__(self, seq_dim=1, hidden_dim=2): + super(FourierLayer, self).__init__() + self.seq_dim = seq_dim + self.hidden_dim = hidden_dim + + def call(self, x): + B, L, D = x.shape + return tf.math.real( + tf.signal.fft(tf.signal.fft(x, axis=self.hidden_dim), axis=self.seq_dim) + ) + +class FeedForward(tf.keras.layers.Layer): + def __init__(self, d_model, dropout=0.1, activation="relu"): + super(FeedForward, self).__init__() + self.fc1 = layers.Dense(d_model) + self.activation = layers.ReLU() if activation == "relu" else layers.GELU() + self.fc2 = layers.Dense(d_model) + self.dropout = layers.Dropout(dropout) + + def call(self, x): + x = self.fc1(x) + x = self.dropout(x) + x = self.activation(x) + x = self.dropout(self.fc2(x)) + return x + +class FNetLayer(tf.keras.layers.Layer): + def __init__(self, d_model, dropout=0.1, activation="relu"): + super(FNetLayer, self).__init__() + self.fourier = FourierLayer(seq_dim=1, hidden_dim=2) + self.feedforward = FeedForward(d_model, dropout, activation) + self.dropout = layers.Dropout(dropout) + self.norm1 = layers.LayerNormalization() + self.norm2 = layers.LayerNormalization() + + def call(self, x, attn_mask=None): + new_x = self.fourier(x) + x = x + self.dropout(new_x) + + x = self.norm1(x) + x = x + self.feedforward(x) + return self.norm2(x), None + +class FourierMix(tf.keras.layers.Layer): + def __init__(self, d_model): + super(FourierMix, self).__init__() + self.fourier = FourierLayer(seq_dim=1, hidden_dim=2) + self.norm = layers.LayerNormalization() + + def call(self, x, attn_mask=None): + x = self.fourier(x) + x = self.norm(x) + return x, None diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/lru/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/lru/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/lru/lru.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/lru/lru.py new file mode 100644 index 0000000..4a368f0 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/lru/lru.py @@ -0,0 +1,121 @@ +#! -*- coding: utf-8 -*- +# 线性循环单元(Linear Recurrent Unit) +# tensorflow 1.15 + bert4keras 0.11.4 测试通过 + + +from tensorflow.keras.layers import Layer,Dense +import numpy as np +import tensorflow as tf +import tensorflow.keras.backend as K + + +class LRU(Layer): + """线性循环单元 + 链接1:https://arxiv.org/abs/2303.06349 + 链接2:https://kexue.fm/archives/9554 + """ + def __init__( + self, + units, + activation='linear', + use_bias=True, + unroll=True, # unroll可以加速训练,但是会增加显存消耗 + kernel_initializer='glorot_uniform', + **kwargs + ): + super(LRU, self).__init__(**kwargs) + self.units = units + self.activation = activations.get(activation) + self.use_bias = use_bias + self.unroll = unroll + self.kernel_initializer = initializers.get(kernel_initializer) + + + def build(self, input_shape): + + hidden_size = input_shape[-1] + self.i_dense = Dense( + units=self.units * 2, + use_bias=self.use_bias, + kernel_initializer=self.kernel_initializer + ) + self.o_dense = Dense( + units=hidden_size, + use_bias=self.use_bias, + activation=self.activation, + kernel_initializer=self.kernel_initializer + ) + + def initializer(shape, dtype=None): + r_min, r_max = 0.9, 0.999 + u1 = np.random.random(size=shape[1]) + u2 = np.random.random(size=shape[1]) + nu_log = np.log( + -0.5 * np.log(u1 * (r_max**2 - r_min**2) + r_min**2) + ) + theta_log = np.log(u2 * np.pi * 2) + gamma_log = np.log(np.sqrt(1 - np.exp(-np.exp(nu_log))**2)) + return np.array([nu_log, theta_log, gamma_log]) + + self.params_log = self.add_weight( + name='params_log', shape=(3, self.units), initializer=initializer + ) + + + def call(self, inputs, mask=None): + u = self.i_dense(inputs) + params = K.exp(self.params_log) + nu, theta, gamma = params[0], params[1], params[2] + + if self.unroll: + L_in = K.int_shape(u)[1] + assert L_in is not None, 'input_length can not be None while unroll=True' + log2_L = int(np.ceil(np.log2(L_in))) + else: + L_in = K.shape(u)[1] + log2_L = K.log(K.cast(L_in, K.floatx())) / K.log(2.) + log2_L = K.cast(tf.ceil(log2_L), 'int32') + + u = tf.complex(u[..., ::2], u[..., 1::2]) + u = tf.pad(u, [[0, 0], [0, 2**log2_L - K.shape(u)[1]], [0, 0]]) + B, L, D = K.shape(u)[0], K.shape(u)[1], K.int_shape(u)[-1] + + def lru(i, x): + l = 2**i + x = K.reshape(x, [B * L // l, l, D]) + x1, x2 = x[:, :l // 2], x[:, l // 2:] + + pos = K.arange(1, l // 2 + 1, dtype=K.floatx()) + nus = tf.einsum('n,d->nd', pos, nu) + thetas = tf.einsum('n,d->nd', pos, theta) + lambs = K.exp(tf.complex(-nus, thetas)) + + x2 = x2 + lambs * x1[:, -1:] + x = K.concatenate([x1, x2], axis=1) + if (not self.unroll) and K.int_shape(u)[1] is not None: + x = K.reshape(x, [B, L, D]) + + return i + 1, x + + if self.unroll: + x = u + for i in range(log2_L): + _, x = lru(i + 1, x) + else: + _, x = tf.while_loop(lambda i, x: i <= log2_L, lru, [1, u]) + + x = x[:, :L_in] * tf.complex(gamma, 0.) + x = K.concatenate([tf.real(x), tf.imag(x)], axis=-1) + return self.o_dense(x) + + def get_config(self): + config = { + 'units': self.units, + 'activation': activations.serialize(self.activation), + 'use_bias': self.use_bias, + 'unroll': self.unroll, + 'kernel_initializer': + initializers.serialize(self.kernel_initializer), + } + base_config = super(LRU, self).get_config() + return dict(list(base_config.items()) + list(config.items())) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/lru/lru2.0.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/lru/lru2.0.py new file mode 100644 index 0000000..08086c2 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/lru/lru2.0.py @@ -0,0 +1,113 @@ +import numpy as np +import tensorflow as tf +from tensorflow.keras.layers import Layer, Dense, activations, initializers +from tensorflow.keras import backend as K + +class LRU(Layer): + """线性循环单元 + 链接1:https://arxiv.org/abs/2303.06349 + 链接2:https://kexue.fm/archives/9554 + """ + def __init__( + self, + units, + activation='linear', + use_bias=True, + unroll=True, # unroll可以加速训练,但是会增加显存消耗 + kernel_initializer='glorot_uniform', + **kwargs + ): + super(LRU, self).__init__(**kwargs) + self.units = units + self.activation = activations.get(activation) + self.use_bias = use_bias + self.unroll = unroll + self.kernel_initializer = initializers.get(kernel_initializer) + + def build(self, input_shape): + super(LRU, self).build(input_shape) + hidden_size = input_shape[-1] + self.i_dense = Dense( + units=self.units * 2, + use_bias=self.use_bias, + kernel_initializer=self.kernel_initializer + ) + self.o_dense = Dense( + units=hidden_size, + use_bias=self.use_bias, + activation=self.activation, + kernel_initializer=self.kernel_initializer + ) + + def initializer(shape, dtype=None): + r_min, r_max = 0.9, 0.999 + u1 = np.random.random(size=shape[1]) + u2 = np.random.random(size=shape[1]) + nu_log = np.log( + -0.5 * np.log(u1 * (r_max**2 - r_min**2) + r_min**2) + ) + theta_log = np.log(u2 * np.pi * 2) + gamma_log = np.log(np.sqrt(1 - np.exp(-np.exp(nu_log))**2)) + return np.array([nu_log, theta_log, gamma_log]) + + self.params_log = self.add_weight( + name='params_log', shape=(3, self.units), initializer=initializer + ) + + @tf.function + def call(self, inputs, mask=None): + u = self.i_dense(inputs) + params = tf.exp(self.params_log) + nu, theta, gamma = params[0], params[1], params[2] + + if self.unroll: + L_in = K.int_shape(u)[1] + assert L_in is not None, 'input_length can not be None while unroll=True' + log2_L = tf.cast(tf.math.ceil(tf.math.log(L_in) / tf.math.log(2.)), tf.int32) + else: + L_in = tf.shape(u)[1] + log2_L = tf.cast(tf.math.ceil(tf.math.log(tf.cast(L_in, dtype=tf.float32)) / tf.math.log(2.)), tf.int32) + + u = tf.complex(u[..., ::2], u[..., 1::2]) + u = tf.pad(u, [[0, 0], [0, 2**log2_L - tf.shape(u)[1]], [0, 0]]) + B, L, D = tf.shape(u)[0], tf.shape(u)[1], tf.shape(u)[-1] + + def lru(i, x): + l = 2**i + x = tf.reshape(x, [B * L // l, l, D]) + x1, x2 = x[:, :l // 2], x[:, l // 2:] + + pos = tf.range(1, l // 2 + 1, dtype=tf.float32) + nus = tf.einsum('n,d->nd', pos, nu) + thetas = tf.einsum('n,d->nd', pos, theta) + lambs = tf.exp(tf.complex(-nus, thetas)) + + x2 = x2 + lambs * x1[:, -1:] + x = tf.concat([x1, x2], axis=1) + if (not self.unroll) and tf.shape(u)[1] is not None: + x = tf.reshape(x, [B, L, D]) + + return i + 1, x + + if self.unroll: + x = u + for i in range(log2_L): + _, x = lru(i + 1, x) + else: + _, x = tf.while_loop(lambda i, x: i <= log2_L, lru, [1, u]) + + x = x[:, :L_in] * tf.complex(gamma, 0.) + x = tf.concat([tf.math.real(x), tf.math.imag(x)], axis=-1) + return self.o_dense(x) + + def get_config(self): + config = { + 'units': self.units, + 'activation': activations.serialize(self.activation), + 'use_bias': self.use_bias, + 'unroll': self.unroll, + 'kernel_initializer': + initializers.serialize(self.kernel_initializer), + } + base_config = super(LRU, self).get_config() + return dict(list(base_config.items()) + list(config.items())) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/paraRCNN/ParaRCNN.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/paraRCNN/ParaRCNN.py new file mode 100644 index 0000000..54a0e0e --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/paraRCNN/ParaRCNN.py @@ -0,0 +1,188 @@ +#!/usr/bin/env python3 +# -*- coding: UTF-8 -*- + + +import os +import sys +import pandas as pd +from math import sqrt +import matplotlib.pyplot as plt +import tensorflow as tf +from tensorflow import keras +from tensorflow.keras import Model, Input, layers +from tensorflow.keras.models import load_model +from tensorflow.keras.optimizers import Adam +from tensorflow.keras.callbacks import EarlyStopping, ModelCheckpoint +from tensorflow.keras.layers import LSTM, SimpleRNN, GRU +from tensorflow.keras.layers import Dense, Dropout, concatenate + +from sklearn.metrics import mean_squared_error as mse +from sklearn.metrics import mean_absolute_error as mae + + +# adding data_processing to the system path +sys.path.insert(0, '/aul/homes/jshi008/IvyProjects/SimDL/data_processing') +from preprocessing import ws_preprocessing, pm25_preprocessing, ele_preprocessing + + + +''' +参考: +[1] https://arxiv.org/pdf/2305.04876v3.pdf +[2] https://github.com/JimengShi/ParaRCNN-Time-Series-Forecasting/blob/main/models/ParaRCNN_shifting_sc.py +''' + + +# set gpu +os.environ["CUDA_VISIBLE_DEVICES"]="3" + + +# get the preprocessed train_X, train_y, test_X, test_y from the dataset +n_hours = 72 +K = 24 +S = 24 + + +### pick one of datasets +# train_X, train_y, test_X, test_y, scaler = ws_preprocessing(n_hours, K, S) +# train_X, train_y, test_X, test_y, scaler = pm25_preprocessing(n_hours, K) +train_X, train_y, test_X, test_y, scaler = ele_preprocessing(n_hours, K) + + +# build model +model_input = Input(shape=(train_X.shape[1], train_X.shape[2])) + +### 4 cnn skip connection +x1 = layers.Conv1D(filters=256, + kernel_size=2, + activation='relu', + padding='same', + kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(model_input) + + +x1_merge1 = concatenate([model_input, x1]) +x1 = layers.Conv1D(filters=128, + kernel_size=2, + activation='relu', + padding='same', + kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x1_merge1) + + +x1_merge2 = concatenate([model_input, x1]) +x1 = layers.Conv1D(filters=64, + kernel_size=2, + activation='relu', + padding='same', + kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x1_merge2) + + +x1_merge3 = concatenate([model_input, x1]) +x1 = layers.Conv1D(filters=32, + kernel_size=2, + activation='relu', + padding='same', + kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x1_merge3) + + + +### 4 rnn skip connection +x2 = layers.SimpleRNN(128, + activation='relu', + return_sequences=True, + recurrent_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5), + kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(model_input) + + +x2_merge1 = concatenate([model_input, x2]) +x2 = layers.SimpleRNN(64, + activation='relu', + return_sequences=True, + recurrent_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5), + kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x2_merge1) + + +x2_merge2 = concatenate([model_input, x2]) +x2 = layers.SimpleRNN(32, + activation='relu', + return_sequences=True, + recurrent_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5), + kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x2_merge2) + + +x2_merge3 = concatenate([model_input, x2]) +x2 = layers.SimpleRNN(16, + activation='relu', + return_sequences=True, + recurrent_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5), + kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x2_merge3) + + +merge = concatenate([model_input, x1, x2]) +x = layers.Flatten()(merge) + +### uncomment the 3 rows below for pm25 and energy electricity dataset, comment them for water stage dataset +x = Dense(256, activation='relu', kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x) +x = Dense(128, activation='relu', kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x) +x = Dense(128, activation='relu', kernel_regularizer=keras.regularizers.L1L2(l1=1e-5, l2=1e-5))(x) + + +x = Dense(train_y.shape[1])(x) + +model = Model(model_input, x) +model.summary() + + +# training +lr = 0.00001 +EPOCHS = 8000 + +lr_schedule = keras.optimizers.schedules.ExponentialDecay(initial_learning_rate=5e-4, + decay_steps=10000, + decay_rate=0.99) + +model.compile( +# optimizer=Adam(learning_rate=lr, decay=lr/EPOCHS), + optimizer=Adam(learning_rate=lr_schedule), + loss='mse', + metrics=['mae']) + + +es = EarlyStopping(monitor='val_loss', mode='min', verbose=2, patience=1500) +mc = ModelCheckpoint('saved_model/ParaRCNN_shifting_s{}_k{}_sc.h5'.format(S, K), monitor='val_mae', mode='min', verbose=2, save_best_only=True) + +history = model.fit(train_X, train_y, + batch_size=512, + epochs=EPOCHS, + validation_data=(test_X, test_y), + verbose=2, + shuffle=True, + callbacks=[es, mc]) + +plt.rcParams["figure.figsize"] = (8, 6) +plt.plot(history.history['loss'], label='train') +plt.plot(history.history['val_loss'], label='test') +plt.xticks(fontsize=14) +plt.yticks(fontsize=14) +plt.xlabel('Epoch', fontsize=16) +plt.ylabel('Loss', fontsize=16) +plt.legend(fontsize=14) +plt.title("Training loss vs Testing loss", fontsize=18) +# plt.savefig('graph/rnn_loss.png', dpi=300) +plt.show() + + + +# Performance on test data +saved_model = load_model('saved_model/ParaRCNN_shifting_s{}_k{}_sc.h5'.format(S, K)) +yhat = saved_model.predict(test_X) + + +inv_yhat = scaler.inverse_transform(yhat) +inv_y = scaler.inverse_transform(test_y) + +inv_yhat = pd.DataFrame(inv_yhat) +inv_y = pd.DataFrame(inv_y) + + +print('MAE = {}'.format(float("{:.4f}".format(mae(inv_yhat.iloc[:, :], inv_y.iloc[:, :]))))) +print('RMSE = {}'.format(float("{:.4f}".format(sqrt(mse(inv_yhat.iloc[:, :], inv_y.iloc[:, :])))))) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/paraRCNN/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/otherIdea/paraRCNN/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/AdamRNNTest.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/AdamRNNTest.py new file mode 100644 index 0000000..1bb2d13 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/AdamRNNTest.py @@ -0,0 +1,239 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 14:56 +@Usage : +@Desc : 测试所实现的LSTM +''' + +import tensorflow as tf +import numpy as np +from model.AdamRNN.AdamRNN import AdaRNN +# from model.LSTM.LSTM import LSTMLayer as LSTMLayer +import matplotlib.pyplot as plt +from keras.callbacks import EarlyStopping + +from model.LossFunction.FTMSE import FTMSE +import math +from sklearn.metrics import mean_absolute_error, mean_squared_error +from pylab import * + +''' +超参数设置: +''' +hidden_num = 40 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 32 +EPOCH = 1000 +unit = 512 # LSTM的维度 +predict_num = 50 # 预测个数 +model_name = "adaRNN" +save_name = r"self_{0}_hidden{1}_unit{2}_feature{3}_predict{4}.h5".format(model_name, hidden_num, unit, feature, + predict_num) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("../../2012轴承数据集预测挑战/HI_create/HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + train_data = tf.transpose(train_data, [1, 2, 0]) + + # todo 解决模型保存时,query无法序列化的问题 + total_data = tf.cast(HI_merge_data, dtype=tf.float32) + train_data = tf.cast(train_data, dtype=tf.float32) + train_label = tf.cast(train_label, dtype=tf.float32) + train_label_single = tf.cast(train_label_single, dtype=tf.float32) + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +''' +train_data.shape: (total_dims - filter_num - 1, filter_num,dims) :(570,600,30) +predict_data.shape: (total_dims - filter_num, filter_num) :(571,600,30) +train_label.shape: (total_dims - filter_num - 1, filter_num) :(570,600) +''' + + +def remove(train_data, train_label, batch_size): + epoch, _, _ = train_data.shape + size = int(epoch / batch_size) + return train_data[:size * batch_size], train_label[:size * batch_size] + + +''' +train_data.shape: (1230, 10, 10) +train_label.shape: (1230, 10) +train_label_single.shape: (1230,) +''' + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def predict_model(filter_num, dims): + input = tf.keras.Input(shape=[filter_num, dims]) + input = tf.cast(input, tf.float32) + + + + x = tf.keras.layers.Dense(128, activation="relu")(LSTM) + x = tf.keras.layers.Dense(64, activation="relu")(x) + x = tf.keras.layers.Dropout(0.2)(x) + x = tf.keras.layers.BatchNormalization()(x) + x = tf.keras.layers.Dense(32, activation="relu")(x) + x = tf.keras.layers.Dropout(0.2)(x) + x = tf.keras.layers.BatchNormalization()(x) + x = tf.keras.layers.Dense(16, activation="relu")(x) + output = tf.keras.layers.Dense(1, activation="relu", name='output')(x) + + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +def split_data(train_data, train_label): + return train_data[:1150, :, :], train_label[:1150, :], train_data[-70:, :, :], train_label[-70:, :] + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(newModel, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = np.expand_dims(train_data[-1, :, :], axis=0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = newModel.predict(each_predict_data) # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + # (1,1) => (10,1) + temp1 = np.transpose(np.concatenate([each_predict_data[:, 1:, -1], predicted_data], axis=1), [1, 0]) + + each_predict_data = np.expand_dims( + np.concatenate([np.squeeze(each_predict_data[:, :, 1:], axis=0), temp1], axis=1), axis=0) + + return predicted_list + + +# 不使用预测的数据,直接使用已知的数据持续预测 +def predictByEveryData(trained_model: tf.keras.Model, predict_data): + predicted_data = trained_model.predict(predict_data) + predicted_data = np.concatenate([np.expand_dims(total_data[:hidden_num + feature, ], axis=1), predicted_data], + axis=0) + data = predictOneByOne(trained_model, predict_data) + predicted_data = np.concatenate([predicted_data, data], axis=0) + return predicted_data + pass + + +if __name__ == '__main__': + # 数据读取 + # 数据读入 --> 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + # # # #### TODO 训练 + model = predict_model(hidden_num, feature) + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=10, min_lr=0.0001) + + model.compile(optimizer=tf.optimizers.SGD(), loss=tf.losses.mse) + + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=20, mode='min', verbose=1) + + history = model.fit(train_data, train_label_single, epochs=EPOCH, validation_data=(val_data, val_label_single), + shuffle=True, verbose=1, + callbacks=[checkpoint, lr_scheduler, early_stop]) + + #### TODO 测试 + + trained_model = tf.keras.models.load_model(save_name, custom_objects={'AttentionEmbedLSTMLayer': LSTMLayer}) + + # 使用已知的点进行预测 + print("开始预测") + predicted_data = predictByEveryData(trained_model, train_data) + # 使用预测的点持续预测 + # predicted_data = predictOneByOne(trained_model, total_data, train_data) + + print("predicted_data:", predicted_data) + print("predicted_data.shape:", predicted_data.shape) + + plt.figure(1) + plt.subplot(2, 1, 1) + plt.plot(total_data) + # plt.subplot(2, 1, 2) + plt.plot(predicted_data) + + # plt.scatter() + + plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/DCTNet.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/DCTNet.py new file mode 100644 index 0000000..1dd1a71 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/DCTNet.py @@ -0,0 +1,138 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/18 11:10 +@Usage : +@Desc : +''' + +from distutils.command.config import config +import torch.nn as nn +import math +import numpy as np +import torch + +try: + from torch import irfft + from torch import rfft +except ImportError: + def rfft(x, d): + t = torch.fft.fft(x, dim=(-d)) + r = torch.stack((t.real, t.imag), -1) + return r + + + def irfft(x, d): + t = torch.fft.ifft(torch.complex(x[:, :, 0], x[:, :, 1]), dim=(-d)) + return t.real + + +def dct(x, norm=None): + """ + Discrete Cosine Transform, Type II (a.k.a. the DCT) + + For the meaning of the parameter `norm`, see: + https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.fftpack.dct.html + + :param x: the input signal + :param norm: the normalization, None or 'ortho' + :return: the DCT-II of the signal over the last dimension + """ + x_shape = x.shape + N = x_shape[-1] + x = x.contiguous().view(-1, N) + + v = torch.cat([x[:, ::2], x[:, 1::2].flip([1])], dim=1) + + # Vc = torch.fft.rfft(v, 1, onesided=False) + Vc = rfft(v, 1) + + k = - torch.arange(N, dtype=x.dtype, device=x.device)[None, :] * np.pi / (2 * N) + W_r = torch.cos(k) + W_i = torch.sin(k) + + V = Vc[:, :, 0] * W_r - Vc[:, :, 1] * W_i + + if norm == 'ortho': + V[:, 0] /= np.sqrt(N) * 2 + V[:, 1:] /= np.sqrt(N / 2) * 2 + + V = 2 * V.view(*x_shape) + + return V + + +# class senet_block(nn.Module): +# def __init__(self, channel=512, ratio=1): +# super(dct_channel_block, self).__init__() +# self.avg_pool = nn.AdaptiveAvgPool1d(1) #innovation +# self.fc = nn.Sequential( +# nn.Linear(channel, channel // 4, bias=False), +# nn.ReLU(inplace=True), +# nn.Linear(channel //4, channel, bias=False), +# nn.Sigmoid() +# ) + +# def forward(self, x): +# # b, c, l = x.size() # (B,C,L) +# # y = self.avg_pool(x) # (B,C,L) -> (B,C,1) +# # print("y",y.shape) +# x = x.permute(0,2,1) +# b, c, l = x.size() +# y = self.avg_pool(x).view(b, c) # (B,C,L) ->(B,C,1) +# # print("y",y.shape) +# # y = self.fc(y).view(b, c, 96) + +# y = self.fc(y).view(b,c,1) +# # print("y",y.shape) +# # return x * y +# return (x*y).permute(0,2,1) +class dct_channel_block(nn.Module): + def __init__(self, channel): + super(dct_channel_block, self).__init__() + # self.avg_pool = nn.AdaptiveAvgPool1d(1) #innovation + self.fc = nn.Sequential( + nn.Linear(channel, channel * 2, bias=False), + nn.Dropout(p=0.1), + nn.ReLU(inplace=True), + nn.Linear(channel * 2, channel, bias=False), + nn.Sigmoid() + ) + # self.dct_norm = nn.LayerNorm([512], eps=1e-6) + + self.dct_norm = nn.LayerNorm([96], eps=1e-6) # for lstm on length-wise + # self.dct_norm = nn.LayerNorm([36], eps=1e-6)#for lstm on length-wise on ill with input =36 + + def forward(self, x): + b, c, l = x.size() # (B,C,L) (32,96,512) + # y = self.avg_pool(x) # (B,C,L) -> (B,C,1) + + # y = self.avg_pool(x).view(b, c) # (B,C,L) -> (B,C,1) + # print("y",y.shape + # y = self.fc(y).view(b, c, 96) + list = [] + for i in range(c): + freq = dct(x[:, i, :]) + # print("freq-shape:",freq.shape) + list.append(freq) + + stack_dct = torch.stack(list, dim=1) + stack_dct = torch.tensor(stack_dct) + ''' + for traffic mission:f_weight = self.dct_norm(f_weight.permute(0,2,1))#matters for traffic datasets + ''' + + lr_weight = self.dct_norm(stack_dct) + lr_weight = self.fc(stack_dct) + lr_weight = self.dct_norm(lr_weight) + + # print("lr_weight",lr_weight.shape) + return x * lr_weight # result + + +if __name__ == '__main__': + tensor = torch.rand(8, 7, 96) + dct_model = dct_channel_block() + result = dct_model.forward(tensor) + print("result.shape:", result.shape) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/DCTTest.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/DCTTest.py new file mode 100644 index 0000000..5083e0d --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/DCTTest.py @@ -0,0 +1,97 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/18 11:03 +@Usage : +@Desc : 离散余弦变换DCT测试 +''' + +''' +参考: +[1] https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.fftpack.dct.html +''' + +import numpy as np +import cv2 +from scipy.fftpack import dct, idct +import matplotlib.pyplot as plt +import tensorflow as tf + +array = np.array([-0.029078494757, + -0.33095228672, + -0.12124221772, + 0.553512275219, + -0.158036053181, + 0.268739402294, + -0.638222515583, + 0.233140587807, + -0.173265621066, + 0.467218101025, + -0.372010827065, + -0.136630430818, + 0.343256533146, + 0.008932195604]) + +dct_array = dct(array, norm='ortho') +dct_array_t = idct(dct_array, norm='ortho') +amp = np.abs(np.fft.fft(array) / len(array)) + +print(amp) +print(dct_array) + +plt.subplot(4, 1, 1) +plt.plot(array) +plt.subplot(4, 1, 2) +plt.plot(dct_array) +plt.subplot(4, 1, 3) +plt.plot(dct_array_t) +plt.subplot(4, 1, 4) +plt.plot(amp) +plt.show() + + +def test1(x): + C_temp = np.zeros(x.shape) + dst = np.zeros(x.shape) + + n = len(x) + N = n + C_temp[:] = 1 * np.sqrt(1 / N) + + + for j in range(n): + C_temp[j] = np.cos(np.pi * (2 * j + 1) / (2 * N) + ) * np.sqrt(2 / N) + # + dst = np.dot(C_temp, x) + dst = np.dot(dst, np.transpose(C_temp)) + + # dst1 = np.log(abs(dst)) # 进行log处理 + return dst + + + +def test(x): + from numpy.fft import rfft as fft + N = len(x) + y = np.empty(shape=[2 * N]) + y[:N] = x + y[N:] = x[::-1] + + Y = fft(y)[:N] + + z = [] + for (k, y) in zip(range(len(Y)), Y): + z.append(y * np.exp(-1j * np.pi * k / (2 * N))) + z= np.array(z) + return z.real + + +if __name__ == '__main__': + a = tf.random.normal(shape=(3, 522,1), mean=2, stddev=1, dtype=tf.float32) # 创建一个标准正态分布 + np.save("a.npy",a) + b = tf.signal.dct(a) + np.save("b.npy",b) + print(b) + diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/FFTTest.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/FFTTest.py new file mode 100644 index 0000000..2b288ab --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/FFTTest.py @@ -0,0 +1,59 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/13 19:42 +@Usage : +@Desc :测试一下FFT和IFFT公式计算 +''' + +import numpy as np +import matplotlib.pyplot as plt + +array = np.array([-0.029078494757, + -0.33095228672, + -0.12124221772, + 0.553512275219, + -0.158036053181, + 0.268739402294, + -0.638222515583, + 0.233140587807, + -0.173265621066, + 0.467218101025, + -0.372010827065, + -0.136630430818, + 0.343256533146, + 0.008932195604]) + +array_fft = np.fft.rfft(array) + +# 幅值 +amp = np.abs(np.fft.fft(array) / len(array)) +# 相角 +angle = np.angle(np.fft.fft(array)) +# 时部 +real = np.real(np.fft.fft(array) * 2 / len(array)) +# 虚部 +imag = np.imag(np.fft.fft(array) * 2 / len(array)) +# +angle1 = np.arctan2(imag, real) + +print(angle) +print(angle1) +result = [] +(num,) = amp.shape +(total,) = array.shape +for j in range(total): + wk = 2 * np.pi * np.arange(num) / num + cur = np.sum(amp * np.cos(wk * j + angle)) + result.append(cur) + +print(result) +print(array) +# # print(array_fft) +# +# plt.subplot(2, 1, 1) +# plt.plot(result) +# plt.subplot(2, 1, 2) +# plt.plot(array) +# plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/LSTMContinueTest.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/LSTMContinueTest.py new file mode 100644 index 0000000..6eff73c --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/LSTMContinueTest.py @@ -0,0 +1,239 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 14:56 +@Usage : +@Desc : 测试所实现的LSTM +''' + +import tensorflow as tf +import numpy as np +import matplotlib.pyplot as plt +from keras.callbacks import EarlyStopping + +from model.LSTM.DCTAttention_embed_LSTM import AttentionEmbedLSTMLayer as LSTMLayer +# from model.LSTM.LSTM import LSTMLayer as LSTMLayer +from model.ChannelAttention.DCT_channelAttention import DCTChannelAttention + +import math +from sklearn.metrics import mean_absolute_error, mean_squared_error +from pylab import * + +''' +超参数设置: +''' +hidden_num = 10 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 8 +EPOCH = 1000 +unit = 512 # LSTM的维度 +predict_num = 50 # 预测个数 +model_name = "dctLSTM" +save_name = r"selfMulti_{0}_hidden{1}_unit{2}_feature{3}_predict{4}.h5".format(model_name, hidden_num, unit, + feature, + predict_num) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("../../2012轴承数据集预测挑战/HI_create/HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + train_data = tf.transpose(train_data, [1, 2, 0]) + + # todo 解决模型保存时,query无法序列化的问题 + total_data = tf.cast(HI_merge_data, dtype=tf.float32) + train_data = tf.cast(train_data, dtype=tf.float32) + train_label = tf.cast(train_label, dtype=tf.float32) + train_label_single = tf.cast(train_label_single, dtype=tf.float32) + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +''' +train_data.shape: (1230, 10, 10) +train_label.shape: (1230, 10) +train_label_single.shape: (1230,) +''' + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def predict_model_multi(filter_num, dims): + tf.config.experimental_run_functions_eagerly(True) + + input = tf.keras.Input(shape=[filter_num, dims]) + # input = tf.cast(input, tf.float32) + + #### 官方 + # LSTM = tf.keras.layers.LSTM(units=512, return_sequences=True)(input) + # LSTM = tf.keras.layers.LSTM(units=256, return_sequences=False)(LSTM) + + #### 自己 + LSTM = LSTMLayer(units=512, return_sequences=True)(input) + # LSTM = LightChannelAttention()(LSTM) + LSTM = LSTMLayer(units=256, return_sequences=True)(LSTM) + + x = tf.keras.layers.Dense(128, activation="relu")(LSTM) + x = tf.keras.layers.Dense(64, activation="relu")(x) + x = tf.keras.layers.Dropout(0.2)(x) + x = tf.keras.layers.BatchNormalization()(x) + x = tf.keras.layers.Dense(32, activation="relu")(x) + x = tf.keras.layers.Dropout(0.2)(x) + x = tf.keras.layers.BatchNormalization()(x) + x = tf.keras.layers.Dense(16, activation="relu")(x) + output = tf.keras.layers.Dense(1, activation="relu", name='output')(x) + + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +# 仅使用预测出来的最新的一个点预测以后 +def predictContinueByOne(newModel, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = np.expand_dims(train_data[-1, :, :], axis=0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + + for each_predict in range(predict_num): + # predicted_data.shape : (1,10) 取最后一条 + predicted_data = newModel.predict(each_predict_data) # (batch_size,filer_num,1) + predicted_data = predicted_data[:, -1] + predicted_list[each_predict] = predicted_data + # (1,1) => (10,1)l + temp1 = np.transpose(np.concatenate([each_predict_data[:, 1:, -1], predicted_data], axis=1), [1, 0]) + + each_predict_data = np.concatenate([each_predict_data[:, :, 1:], np.expand_dims(temp1,axis=0)], axis=-1) + + return predicted_list + + +# 不使用预测的数据,直接使用已知的数据持续预测 +def predictByEveryData(trained_model: tf.keras.Model, predict_data): + # shape:(1180,10) 取每一次的最后一个点就是从头到尾预测的 + predicted_data = trained_model.predict(predict_data) + predicted_data = predicted_data[:, -1] # 1180,1,1 + + predicted_data = np.concatenate([np.expand_dims(total_data[:hidden_num + feature, ], axis=1), predicted_data], + axis=0) + data = predictContinueByOne(trained_model, predict_data, predict_num=predict_num) + predicted_data = np.concatenate([predicted_data, data], axis=0) + return predicted_data + pass + + +if __name__ == '__main__': + # 数据读取 + # 数据读入 --> 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + # # #### TODO 训练 + model = predict_model_multi(hidden_num, feature) + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=10, min_lr=0.001) + + model.compile(optimizer=tf.optimizers.SGD(), loss=tf.losses.mse) + # model.compile(optimizer=tf.optimizers.SGD(learning_rate=0.001), loss=FTMSE()) + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=20, mode='min', verbose=1) + + history = model.fit(train_data, train_label, epochs=EPOCH, validation_data=(val_data, val_label), + shuffle=True, verbose=1, + callbacks=[checkpoint, lr_scheduler, early_stop]) + + #### TODO 测试 + + # trained_model = tf.keras.models.load_model(save_name, custom_objects={'LSTMLayer': LSTMLayer, 'FTMSE': FTMSE}) + + # todo 解决自定义loss无法导入的问题 + trained_model = tf.keras.models.load_model(save_name, compile=False, custom_objects={'AttentionEmbedLSTMLayer': LSTMLayer}) + # trained_model.compile(optimizer=tf.optimizers.SGD(), loss=FTMSE()) + + # 使用已知的点进行预测 + predicted_data = predictByEveryData(trained_model, train_data) + # 使用预测的点持续预测 + # predicted_data = predictOneByOne(trained_model, total_data, train_data) + + print("predicted_data:", predicted_data) + print("predicted_data.shape:", predicted_data.shape) + + plt.figure(1) + plt.subplot(2, 1, 1) + plt.plot(total_data) + # plt.subplot(2, 1, 2) + plt.plot(predicted_data) + + # plt.scatter() + + plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/LSTMTest.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/LSTMTest.py new file mode 100644 index 0000000..08bea4f --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/LSTMTest.py @@ -0,0 +1,246 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 14:56 +@Usage : +@Desc : 测试所实现的LSTM +''' + +import tensorflow as tf +import numpy as np +from model.LSTM.DCTAttention_embed_LSTM import AttentionEmbedLSTMLayer as LSTMLayer +# from model.LSTM.LSTM import LSTMLayer as LSTMLayer +import matplotlib.pyplot as plt +from keras.callbacks import EarlyStopping + +from model.LossFunction.FTMSE import FTMSE +import math +from sklearn.metrics import mean_absolute_error, mean_squared_error +from pylab import * + +''' +超参数设置: +''' +hidden_num = 10 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 32 +EPOCH = 1000 +unit = 512 # LSTM的维度 +predict_num = 50 # 预测个数 +model_name = "dctLSTM" +save_name = r"self_{0}_hidden{1}_unit{2}_feature{3}_predict{4}_0.0657_0.207.h5".format(model_name, hidden_num, unit, feature, + predict_num) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("../../2012轴承数据集预测挑战/HI_create/HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + train_data = tf.transpose(train_data, [1, 2, 0]) + + # todo 解决模型保存时,query无法序列化的问题 + total_data = tf.cast(HI_merge_data, dtype=tf.float32) + train_data = tf.cast(train_data, dtype=tf.float32) + train_label = tf.cast(train_label, dtype=tf.float32) + train_label_single = tf.cast(train_label_single, dtype=tf.float32) + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +''' +train_data.shape: (total_dims - filter_num - 1, filter_num,dims) :(570,600,30) +predict_data.shape: (total_dims - filter_num, filter_num) :(571,600,30) +train_label.shape: (total_dims - filter_num - 1, filter_num) :(570,600) +''' + + +def remove(train_data, train_label, batch_size): + epoch, _, _ = train_data.shape + size = int(epoch / batch_size) + return train_data[:size * batch_size], train_label[:size * batch_size] + + +''' +train_data.shape: (1230, 10, 10) +train_label.shape: (1230, 10) +train_label_single.shape: (1230,) +''' + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def predict_model(filter_num, dims): + input = tf.keras.Input(shape=[filter_num, dims]) + input = tf.cast(input, tf.float32) + + #### 官方 + # LSTM = tf.keras.layers.LSTM(units=512, return_sequences=True)(input) + # LSTM = tf.keras.layers.LSTM(units=256, return_sequences=False)(LSTM) + + #### 自己 + # LSTM = tf.keras.layers.Conv1D(512, kernel_size=8, padding='same')(input) + LSTM = LSTMLayer(units=512, return_sequences=True)(input) + LSTM = LSTMLayer(units=256, return_sequences=False)(LSTM) + + x = tf.keras.layers.Dense(128, activation="relu")(LSTM) + x = tf.keras.layers.Dense(64, activation="relu")(x) + x = tf.keras.layers.Dropout(0.2)(x) + x = tf.keras.layers.BatchNormalization()(x) + x = tf.keras.layers.Dense(32, activation="relu")(x) + x = tf.keras.layers.Dropout(0.2)(x) + x = tf.keras.layers.BatchNormalization()(x) + x = tf.keras.layers.Dense(16, activation="relu")(x) + output = tf.keras.layers.Dense(1, activation="relu", name='output')(x) + + model = tf.keras.Model(inputs=input, outputs=output) + return model + + +def split_data(train_data, train_label): + return train_data[:1150, :, :], train_label[:1150, :], train_data[-70:, :, :], train_label[-70:, :] + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(newModel, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = np.expand_dims(train_data[-1, :, :], axis=0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = newModel.predict(each_predict_data) # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + # (1,1) => (10,1) + temp1 = np.transpose(np.concatenate([each_predict_data[:, 1:, -1], predicted_data], axis=1), [1, 0]) + + each_predict_data = np.expand_dims( + np.concatenate([np.squeeze(each_predict_data[:, :, 1:], axis=0), temp1], axis=1), axis=0) + + return predicted_list + + +# 不使用预测的数据,直接使用已知的数据持续预测 +def predictByEveryData(trained_model: tf.keras.Model, predict_data): + predicted_data = trained_model.predict(predict_data) + predicted_data = np.concatenate([np.expand_dims(total_data[:hidden_num + feature, ], axis=1), predicted_data], + axis=0) + data = predictOneByOne(trained_model, predict_data) + predicted_data = np.concatenate([predicted_data, data], axis=0) + return predicted_data + pass + + +if __name__ == '__main__': + # 数据读取 + # 数据读入 --> 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + # # # #### TODO 训练 + model = predict_model(hidden_num, feature) + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=10, min_lr=0.0001) + + model.compile(optimizer=tf.optimizers.SGD(), loss=tf.losses.mse) + + model.summary() + # early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=20, mode='min', verbose=1) + # + # history = model.fit(train_data, train_label_single, epochs=EPOCH, validation_data=(val_data, val_label_single), + # shuffle=True, verbose=1, + # callbacks=[checkpoint, lr_scheduler, early_stop]) + + #### TODO 测试 + + trained_model = tf.keras.models.load_model(save_name, custom_objects={'AttentionEmbedLSTMLayer': LSTMLayer}) + model.summary() + # 使用已知的点进行预测 + print("开始预测") + predicted_data = predictByEveryData(trained_model, train_data) + # 使用预测的点持续预测 + # predicted_data = predictOneByOne(trained_model, total_data, train_data) + + print("predicted_data:", predicted_data) + print("predicted_data.shape:", predicted_data.shape) + + plt.figure(1) + plt.subplot(2, 1, 1) + plt.plot(total_data) + # plt.subplot(2, 1, 2) + plt.plot(predicted_data) + + # plt.scatter() + + plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/__init__.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/__init__.py new file mode 100644 index 0000000..f0e85e4 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/13 19:42 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/test.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/test.py new file mode 100644 index 0000000..0d34243 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/test.py @@ -0,0 +1,18 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 10:26 +@Usage : +@Desc : +''' +import tensorflow as tf + +# 假设有两个形状为 (3,) 的张量 +tensor1 = tf.constant([1, 2, 3]) +tensor2 = tf.constant([4, 5, 6]) + +# 在新的轴上堆叠这两个张量 +stacked_tensor = tf.stack([tensor1, tensor2],axis=-1) + +print(stacked_tensor) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/RUL/test/test1.py b/TensorFlow_eaxmple/Model_train_test/RUL/test/test1.py new file mode 100644 index 0000000..d6b9353 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/RUL/test/test1.py @@ -0,0 +1,33 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2024/1/11 14:20 +@Usage : +@Desc : +''' + +import requests + +import numpy as np +import matplotlib.pyplot as plt + +def getData(): + url = 'http://172.28.9.61:8100/api/data/signalData?dataset_name=Shaft2_radial&thing_id=windturbine-rmq-01&time=20240110200508000' + + response = requests.get(url) + + y = response.json()['data']['timeSequence_y'] + + y = np.array(y) + amp = np.abs(np.fft.fft(y) / len(y)) + + plt.plot(amp[:len(amp)//2]) + plt.show() + + print(1) + + + +if __name__ == '__main__': + getData() \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/NewtonInsert.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/NewtonInsert.py new file mode 100644 index 0000000..b58e3b7 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/NewtonInsert.py @@ -0,0 +1,195 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/11 12:55 +@Usage : +@Desc : +''' + +import numpy as np +import pandas as pd +import time +# 只计算了该程序运行CPU的时间 +import timeit + +# cat_sale = pd.read_excel('data/catering_sale.xls') +path = "G:\data\SCADA数据\jb4q_8.csv" +cat_sale = pd.read_csv(path) +print(cat_sale) +cat_sale = cat_sale.iloc[:20000, :] +print(cat_sale) +# cat_sale.drop('日期', axis=1, inplace=True) + +# 过滤异常值,并置为空值 +# cat_sale['销量'][(cat_sale['销量'] < 400) | (cat_sale['销量'] > 5000)] = np.NAN +# 将0值变成NAN 通过双中括号进行索引任意位置 +# print(df['realtime'][1]) +cat_sale[:][cat_sale[:] == 0] = np.nan # 在索引比较的时候,要转换成同一类型,使用astype + +# 分别定义求插商与求w的函数 +''' +:param x:差值前后的索引值 +:param y:差值前后的数值 +''' + + +def cal_f(x, y): + """ + 计算插商 + """ + f0 = np.zeros((len(x), len(y))) # 定义一个存储插商的数组 + for k in range(len(y) + 1): # 遍历列 + for i in range(k, len(x)): # 遍历行 + if k == 0: + f0[i, k] = y[i] + else: + f0[i, k] = (f0[i, k - 1] - f0[i - 1, k - 1]) / (x[i] - x[i - 1]) + # print('差商表', '\n', f0) + return f0 + + +''' +:param x:差值前后的索引值 +:param y:差值前后的数值 +:param x_j:需要差值的索引 +''' + + +def newton(x, y, x_j): + """ + 牛顿差值多项式 + """ + f0 = cal_f(x, y) # 计算插商 + f0 = f0.diagonal() # 插商对角线 + # 与w相乘 + f1 = 0 + for i in range(len(f0)): + s = 1 + k = 0 + while k < i: + s = s * (x_j - x[k]) + k += 1 + f1 = f1 + f0[i] * s + return f1 + + +# 自定义列向量插值函数,获取需差值的前后几个数 +''' +:param s:整个差值的序列 +:param n:需要差值的索引 +:param x_j:需要差值的索引 +:param is_fast:是否需要快速差值(无论前后是否是零值均采用);反之则一直找到不为0值的进行计算 +:param k:取前后多少个数 +''' + + +def ployinterp_columns(s, n, x_j, is_fast: bool = False, k=3): + X = [] + Y = [] + if is_fast: + # 如果最前面的值不够k个 + if n < k: + a = list(range(0, n)) + list(range(n + 1, n + k + 1)) + y = s[list(range(0, n)) + list(range(n + 1, n + k + 1))] + # 如果最后面的值不够k个 + elif n > len(s) - k - 1: + y = s[list(range(n - k, n)) + list(range(n + 1, len(s)))] + # 前后均有k个 + else: + y = s[list(range(n - k, n)) + list(range(n + 1, n + k + 1))] # 取空值处的前后5个数 + y = y[y.notnull()] # 剔除空值 + X = y.index + Y = list(y) + else: + # 先取序列前后各k个不为空的值 + index = n - 1 + while len(X) < k and index >= 0: + if not np.isnan(s[index]): + Y.append(s[index]) + X.append(index) + index -= 1 + index = n + 1 + X.reverse() + Y.reverse() + + while len(X) < 2 * k and index <= len(s): + if not np.isnan(s[index]): + Y.append(s[index]) + X.append(index) + index += 1 + # print(X) + # print(Y) + + return newton(X, Y, x_j) # 插值并返回插值结果 + + +def execute(): + cat_sale[:][cat_sale[:] == 0] = np.nan # 在索引比较的时候,要转换成同一类型,使用astype + for i in cat_sale.columns: + temp = cat_sale[i].isnull() + if temp[:][temp[:] == True].__len__() > 0: + print("{0}列处理前空行数:{1}".format(i, cat_sale[i].isnull().sum())) + for j in range(len(cat_sale)): + if (cat_sale[i].isnull())[j]: + x_j = cat_sale.index[j] + cat_sale.loc[j, i] = ployinterp_columns(cat_sale[i], j, x_j) + print('第{0}行牛顿插值为{1}'.format(j, cat_sale.loc[j, i])) + print("{0}列处理后空行数:{1}".format(i, cat_sale[i].isnull().sum())) + print("========================================") + print(cat_sale) + cat_sale.to_csv("G:\data\SCADA数据\jb4q_8_dealed.csv") + # cat_sale.to_excel('saless.xls') + + +def test(): + before_data = pd.DataFrame() + cat_sale[:][cat_sale[:] == 0] = np.nan # 在索引比较的时候,要转换成同一类型,使用astype + for j in range(len(cat_sale['num_gearbox_pumpoutletpress'])): + if (cat_sale['num_gearbox_pumpoutletpress'].isnull())[j]: + x_j = cat_sale.index[j] + # cat_sale.loc[j,'num_gearbox_pumpoutletpress'] = ployinterp_columns(cat_sale['num_gearbox_pumpoutletpress'], j, x_j,is_fast=True) + a = ployinterp_columns(cat_sale['num_gearbox_pumpoutletpress'], j, x_j, is_fast=True) + if a > 10 or a <= 3: + a = 5 + before_data.loc[j, 'num_gearbox_pumpoutletpress'] = a + # print('第{0}行牛顿插值为{1}'.format(j, cat_sale.loc[j,'num_gearbox_sumptemp'])) + else: + a = cat_sale.loc[j, 'num_gearbox_pumpoutletpress'] + if a > 10 or a <= 3: + a = 5 + before_data.loc[j, 'num_gearbox_pumpoutletpress'] = a + # cat_sale[:][cat_sale[:] == np.nan] = 0 + return before_data['num_gearbox_pumpoutletpress'], cat_sale['num_gearbox_pumpoutletpress'] + + +def plot(x_axis, original_data, restored_data): + import matplotlib.pyplot as plt + # 绘制原始数据和修复后的数据对比图 + plt.figure(figsize=(3.2, 2.0)) + plt.subplots_adjust(left=0.18, right=0.94, bottom=0.25, top=0.85, wspace=None, hspace=None) + plt.tight_layout() + plt.plot(x_axis, original_data, label='Original Data', color='blue') + plt.plot(x_axis, restored_data, label='Restored Data', color='red') + font = {'family': 'Times New Roman', 'weight': 'normal', 'size': 10} + plt.xlabel('Points', font) + plt.ylabel("Value", font) + plt.title('Original Data vs Restored Data', font) + plt.legend(loc=2, prop=font, handlelength=0.45, frameon=True, facecolor='w') + plt.savefig('NewtonInsert.png',dpi=600) + plt.show() + + +if __name__ == '__main__': + start = timeit.default_timer() + # execute() + restored_data, original_data = test() + for i in range(len(original_data)): + a = original_data[i] + if np.isnan(a): + original_data[i] = 0 + plot([i for i in range(len(original_data))], original_data, restored_data) + end = timeit.default_timer() + print('Running time: %s Seconds' % (end - start)) + # 返回值是浮点数 diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/__init__.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/lagrangeInsert.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/lagrangeInsert.py new file mode 100644 index 0000000..a18d09d --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/lagrangeInsert.py @@ -0,0 +1,170 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/11 11:43 +@Usage : +@Desc : +''' + + +import numpy as np +import pandas as pd +path = "G:\data\SCADA数据\jb4q_8.csv" +cat_sale = pd.read_csv(path) +print(cat_sale) +cat_sale = cat_sale.iloc[:20000, :] +print(cat_sale) +# cat_sale.drop('日期', axis=1, inplace=True) + +# 过滤异常值,并置为空值 +# cat_sale['销量'][(cat_sale['销量'] < 400) | (cat_sale['销量'] > 5000)] = np.NAN +# 将0值变成NAN 通过双中括号进行索引任意位置 +# print(df['realtime'][1]) +cat_sale[:][cat_sale[:] == 0] = np.nan # 在索引比较的时候,要转换成同一类型,使用astype + +# 拉格朗日插值算法 +def LagrangeInterpolation(X,Y, x): + # slices(series) :the defining points + # k :the number of defining points of Lagrange poly 前后各k个值 + # slices index :the corresponding value on each defining point + # x :the point whose value we are interested + # print(slices[x]) + # print(np.isnan(slices[x])) + result = 0 + for j in range(len(X)): + # result_l 基函数 + result_l = 1 + for i in range(len(X)): + if i != j: + result_l = result_l * (x - X[i]) / (X[j] - X[i]) + # 取值 slices[j] + result = result + Y[j] * result_l + + return result + + +def ployinterp_columns(s, n, x_j, is_fast: bool = False, k=3): + X = [] + Y = [] + if is_fast: + # 如果最前面的值不够k个 + if n < k or n > len(s) - k - 1: + y = s[[i for i in range(max(n - k, 0), n)] + [i for i in range(n + 1, min(n + k + 1, len(s)))]] + # 前后均有k个 + else: + y = s[[i for i in range(n - k, n)] + [i for i in range(n + 1, n + k + 1)]] # 取空值处的前后5个数 + y = y[y.notnull()] # 剔除空值 + X = y.index + Y = list(y) + else: + # 先取序列前后各k个不为空的值 + index = n - 1 + while len(X) < k and index >= 0: + if not np.isnan(s[index]): + Y.append(s[index]) + X.append(index) + index -= 1 + index = n + 1 + X.reverse() + Y.reverse() + + while len(X) < 2 * k and index <= len(s): + if not np.isnan(s[index]): + Y.append(s[index]) + X.append(index) + index += 1 + # print(X) + # print(Y) + + return LagrangeInterpolation(X,Y, x_j) # 插值并返回插值结果 + + +def test(): + before_data = pd.DataFrame() + cat_sale[:][cat_sale[:] == 0] = np.nan # 在索引比较的时候,要转换成同一类型,使用astype + for j in range(len(cat_sale['num_gearbox_pumpoutletpress'])): + if (cat_sale['num_gearbox_pumpoutletpress'].isnull())[j]: + x_j = cat_sale.index[j] + # cat_sale.loc[j,'num_gearbox_pumpoutletpress'] = ployinterp_columns(cat_sale['num_gearbox_pumpoutletpress'], j, x_j,is_fast=True) + a = ployinterp_columns(cat_sale['num_gearbox_pumpoutletpress'], j, x_j, is_fast=True) + if a > 10 or a <= 3: + a = 5 + before_data.loc[j, 'num_gearbox_pumpoutletpress'] = a + # print('第{0}行牛顿插值为{1}'.format(j, cat_sale.loc[j,'num_gearbox_sumptemp'])) + else: + a = cat_sale.loc[j, 'num_gearbox_pumpoutletpress'] + if a > 10 or a <= 3: + a = 5 + before_data.loc[j, 'num_gearbox_pumpoutletpress'] = a + # cat_sale[:][cat_sale[:] == np.nan] = 0 + return before_data['num_gearbox_pumpoutletpress'], cat_sale['num_gearbox_pumpoutletpress'] + + +def plot(x_axis, original_data, restored_data): + import matplotlib.pyplot as plt + # 绘制原始数据和修复后的数据对比图 + plt.figure(figsize=(3.2, 2.0)) + plt.subplots_adjust(left=0.18, right=0.94, bottom=0.25, top=0.85, wspace=None, hspace=None) + plt.tight_layout() + plt.plot(x_axis, original_data, label='Original Data', color='blue') + plt.plot(x_axis, restored_data, label='Restored Data', color='red') + font = {'family': 'Times New Roman', 'weight': 'normal', 'size': 10} + plt.xlabel('Points', font) + plt.ylabel("Value", font) + plt.title('Original Data vs Restored Data', font) + plt.legend(loc=2, prop=font, handlelength=0.45, frameon=True, facecolor='w') + plt.savefig('LagrangeInsert.png',dpi=600) + plt.show() + + +if __name__ == '__main__': + restored_data, original_data = test() + for i in range(len(original_data)): + a = original_data[i] + if np.isnan(a): + original_data[i] = 0 + plot([i for i in range(len(original_data))], original_data, restored_data) + + + + + + + + + path = "G:\data\SCADA数据\jb4q_8.csv" + + df = pd.read_csv(path) + columns = df.columns + print(df.columns) + + # 将0值变成NAN 通过双中括号进行索引任意位置 + # print(df['realtime'][1]) + df[:][df[:] == 0] = np.nan # 在索引比较的时候,要转换成同一类型,使用astype + + # TODO 测试单点插值 + print(df['num_gearbox_sumptemp'].isnull()) + # print("插值为:", LagrangeInterpolation(df['num_gearbox_sumptemp'], 47, 2)) + + # TODO 单列测试插值 + print("之前的空值数量:", df['num_gearbox_sumptemp'].isnull().sum()) + for j in range(len(df)): + if (df['num_gearbox_sumptemp'].isnull())[j]: + s = df['num_gearbox_sumptemp'] + df.loc[j, 'num_gearbox_sumptemp'] = LagrangeInterpolation(s, j, 5) + print("插值之后的空值数量:", df['num_gearbox_sumptemp'].isnull().sum()) + + # # TODO 整体处理 + print("之前的空值数量:", df.isnull().sum()) + for i in columns: + temp = df[i].isnull() + if temp[:][temp[:] == True].__len__() > 0: + for j in range(len(df)): + if (df[i].isnull())[j]: + s = df[columns[i]] + df.loc[j, i] = LagrangeInterpolation(s, j, 3) + + print("插值之后的空值数量:",df.isnull().sum()) + df.to_csv("G:\实验室/2022项目中期\数据治理算法\jb4q_8_lagrange.csv") diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/scada_data_process_for_JBYQ_YSD.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/scada_data_process_for_JBYQ_YSD.py new file mode 100644 index 0000000..68755dc --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/dataETL/scada_data_process_for_JBYQ_YSD.py @@ -0,0 +1,149 @@ +# -*- coding: utf-8 -*- +""" +Created on Sun Jun 7 09:23:31 2020 + +@author: AlbertHu +""" + +# -*- coding: utf-8 -*- +""" +Created on Fri Jun 5 21:33:46 2020 + +@author: AlbertHu +""" + +# -*- coding: utf-8 -*- +""" +Created on Fri Jun 5 10:40:27 2020 + +@author: AlbertHu +""" + +import os +import time +import numpy as np +import pandas as pd +import datetime + +def findallfiles(cmsfilesfatherpath): #返回父目录包括子目录下所有文件的地址 + cmsfilepaths = [] + files = os.listdir(cmsfilesfatherpath) + for fi in files: + fi_d = os.path.join(cmsfilesfatherpath, fi) + if os.path.isdir(fi_d): + # files.extend(findcmsfiles(fi_d)) + pass + else: + cmsfilepaths.append(fi_d) + return cmsfilepaths +def findIndexOfExceptPoint(data): + indexList2D = [] + indexList1 = [] + indexList2 = [] + indexList3 = [] + indexList4 = [] + indexList5 = [] + print("开始清洗") + for i in data.index: + if i % 10000 == 0: + print("已处理了{}组数据".format(i)) + #条件1 + if data[' 瞬时风速'][i] < 3.5 and data[' 1#叶片变桨角度'][i] > 89: + indexList1.append(i) + elif data[' 瞬时风速'][i] >= 3.5 and data[' 瞬时风速'][i] <= 10 and data[' 1#叶片变桨角度'][i] > 0.5: + indexList1.append(i) + elif data[' 瞬时风速'][i] >= 11 and data[' 瞬时风速'][i] <= 25 and (data[' 有功功率'][i] < 1800 and data[' 1#叶片变桨角度'][i] > 1.5): + indexList1.append(i) + elif data[' 瞬时风速'][i] > 25 and data[' 有功功率'][i] >0: + indexList1.append(i) + else: + pass + #条件2 + if abs(data[' 齿轮箱高速轴前端温度'][i])>200 or abs(data[' 齿轮箱高速轴后端温度'][i])>200 or abs(data[' 齿轮箱冷却水温'][i])>200 or abs(data[' 齿轮箱进口油温'][i])>200 or abs(data[' 齿轮箱油池温度'][i])>200 or abs(data[' 环境温度'][i]>200): + indexList2.append(i) + else: + pass + #条件3 #条件6 + if data[' 齿轮箱高速轴前端温度'][i] > 80 or data[' 齿轮箱高速轴后端温度'][i] > 80 or abs(data[' 齿轮箱高速轴前端温度'][i] - data[' 齿轮箱高速轴后端温度'][i]) > 20: + indexList3.append(i) + else: + pass + #条件4 + if data[' 有功功率'][i] > 100 and data[' 齿轮箱进口压力'][i] <= 0: + indexList4.append(i) + else: + pass + #条件5 + if abs(data[' 齿轮箱进口压力'][i] - data[' 齿轮箱泵出口压力'][i]) > 5: + indexList5.append(i) + else: + pass + indexList2D = [indexList1,indexList2,indexList3,indexList4,indexList5] + return indexList2D +# #条件6 +# if data[' 齿轮箱高速轴前端温度'][i] > 80 or data[' 齿轮箱高速轴后端温度'][i]) > 80: + + + + +fathpath = r'D:\1.SCADA_风电数据\靖边二期2019_已处理' +allfilepaths = findallfiles(fathpath) +testpath = allfilepaths[0] +#allfilepaths = [r'F:\scada_ewma本地数据2(重要)\data\DataResult(靖边二期2019)\风机7.csv'] + +#testpath=r'F:\scada_ewma本地数据2(重要)\data\DataResult(粤水电达坂城2020.1月-5月)\风机1.csv' +for testpath in allfilepaths: + data = pd.read_csv(testpath,encoding='gbk',parse_dates = ['时间']) + data.columns + + indexList2D = findIndexOfExceptPoint(data) + + savePath = r'./cleanScada/JB2Q615/风机{}'.format(data['风机号'][1]) + if not os.path.exists(savePath): + os.makedirs(savePath) + file = open(savePath + '/IndexOfExceptPoint.txt','w') + a = 1 + for List in indexList2D: + for i in List: + file.write(str(i)+',') + try: + data.drop([i],inplace=True) + except: + continue + file.write('第{}组\n'.format(a)) + a += 1 + file.close() + + data.to_csv(savePath+'.csv',encoding='gbk') + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/baseETL.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/baseETL.py new file mode 100644 index 0000000..402886e --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/baseETL.py @@ -0,0 +1,67 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/7 10:29 +@Usage : 对SCADA数据进行基础的清洗工作 +@Desc : +''' + +import tensorflow as tf +import pandas as pd +import numpy as np +import os +import time +from condition_monitoring.lib.IOBase import ioLib + +''' +超参数设置 +''' +# 需处理文件的父目录 +fatherPath = "G:\data\SCADA数据\华能三塘湖" +# 处理好文件的父目录 +fatherDealedPath = "G:\data\SCADA数据\华能三塘湖\dealed" + +baseUseCols = ["时间", "风机号", "发电机转矩", "发电机无功功率", "发电机转速", "发电机有功功率", "发电机绕组最高温度", "齿轮箱油池温度", "齿轮箱进口油温", "齿轮箱进口压力", + "齿轮箱油泵出口压力", "齿轮箱冷却水温度", "有功功率", "60s平均有功功率", "10min平均有功功率", "10s平均有功功率", "10s平均无功功率", "无功功率", "瞬时风速", + "机舱温度"] + +baseWinds = [] + +# 列出父目录下所有文件 +def listFile(fatherPath = fatherPath): + filepaths = [] + files = os.listdir(fatherPath) + for file in files: + fi_d = os.path.join(fatherPath, file) + if os.path.isdir(fi_d): + pass + # files.extend(findcmsfiles(fi_d)) + else: + filepaths.append(fi_d) + + return filepaths + + +def dropNa(filePath): + data = pd.read_csv(filePath, low_memory=False, encoding='gbk', usecols=baseUseCols, parse_dates=['时间']) + print(data) + data.dropna(axis=0, how='any', inplace=True) + print(data) + data.append() + ioLib.saveCSV(data=data, savePath=fatherDealedPath) + + + +def separateByWindNum(data): + indexLists = [] + windList1 = [] + windList2 = [] + + + +if __name__ == '__main__': + filePath = "G:\data\SCADA数据\华能三塘湖/1华能三塘湖20180730-20180803.csv" + + diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/loadData.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/loadData.py new file mode 100644 index 0000000..f110cb1 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/loadData.py @@ -0,0 +1,228 @@ +import pandas as pd +import numpy as np +import tensorflow as tf +import csv +import os +import matplotlib.pyplot as plt +import seaborn as sns + +'''设置数据源文件路径''' +# source_path = r'G:\data\SCADA数据\jb4q_8.csv' +source_path = "G:\data\SCADA数据\jb4q_8_delete_total_zero.csv" + +'''修改后的数据源存储路径''' +save_path = r'G:\data\SCADA数据\jb4q_8_delete_total_zero.csv' + +'''需要的列''' + + +# baseUseCols = ["num_gearbox_sumptemp","num_gearbox_inletoiltemp","num_gearbox_inletpress","num_gearbox_coolingwatertemp"] + +# target_path = r'G:\data\SCADA数据\华能三塘湖/dealed/后十万2018.01.16.csv' +# target_folder = r'G:\data\SCADA数据\华能三塘湖/dealed' + + +# 生成文件夹 +def folderGenerate(folder_name): + if not os.path.exists(folder_name): + os.makedirs(folder_name) + + +# 皮尔逊相关系数 +def cal_correlation_coefficient(data, label): + print("计算皮尔逊相关系数") + print(data) + print(data.shape) + pd_data = pd.DataFrame(data) + person = pd_data.corr() + print(person) + # 画热点图heatmap + # cmap = sns.heatmap(person, annot=True, xticklabels=label, yticklabels=label) + # plt.figure(1, figsize=(6.0, 2.68)) + # plt.subplots_adjust(left=0.1, right=0.94, bottom=0.2, top=0.9, wspace=None, + # hspace=None) + # plt.tight_layout() + # font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 10} # 设置坐标标签的字体大小,字体 + # font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + # plt.xlabel("X", size=10,fontdict=font1) + # plt.ylabel("Y", size=10,fontdict=font1) + # plt.title("Heatmap of correlation coefficient matrix", size=20,fontdict=font1) + # + # # 调整色带的标签: + # cbar = cmap.collections[0].colorbar + # cbar.ax.tick_params(labelsize=15, labelcolor="black") + # cbar.ax.set_ylabel(ylabel="color scale", color="red", loc="center",fontdict=font2) + # + # plt.show() + return person + + +def get_most_N_correlation_coefficient(person, N=10): + print("获得相关度最高的{}个值".format(N)) + # total_correlation = person[1:, 1:] + abs_correlation = np.abs(person) + one = np.ones(shape=abs_correlation.shape) + two = np.subtract(one, abs_correlation) + rows, cols = two.shape + total_sum = [] + for i in range(cols): + # print(two[i]) + total = np.sum(two[i]) + total_sum.append(total) + + print("total_sum:", total_sum) + # 取最小的N个数,因为是与1减了以后的,越小相关系数越大 + print("arg:",np.argpartition(total_sum, N)) + min = np.argpartition(total_sum, N)[:N] + max = np.argpartition(total_sum, N)[total_sum.__len__() - N:] + print("min:",min) + return min + + +# 过滤或者线性填充 +def findIndexOfExceptPoint(data: pd.DataFrame): + # indexList2D = [] + # indexList = [] + # indexList2 = [] + # indexList3 = [] + # indexList4 = [] + indexList = [] + print("开始清洗") + for i in data.index: + if i % 10000 == 0: + print("已处理了{}条数据".format(i)) + ## 删除绝大多数0 + # if data['num_gearbox_sumptemp'][i] != 0 and (i < 416166 or i > 432766) and ( + # data['num_gearbox_pumpoutletpress'][i] == 0 or data['num_activepower'][i] == 0 or + # data['num_gen_torque'][i] == 0): + # indexList.append(i) + # 删除全部有0 + # if (i < 416166 or i > 432766) and ( + # data['num_gearbox_pumpoutletpress'][i] == 0 or data['num_activepower'][i] == 0 or + # data['num_gen_torque'][i] == 0): + # indexList.append(i) + # 只删除全部0 + if (i < 416166 or i > 432766) and ( + data['num_gearbox_sumptemp'][i] == 0 and data['num_gearbox_inletoiltemp'][i] == 0 and + data['num_gearbox_inletpress'][i] == 0): + indexList.append(i) + else: + pass + + # indexList2D = [indexList1, indexList2, indexList3, indexList4, indexList5] + indexList2D = set(indexList) + print("要移除的index:", indexList2D) + return indexList2D + + +# 根据index移除异常数据 +def removeDataByIndex(indexList, data): + print("开始移除异常index的数据") + a = 1 + data.drop(indexList, inplace=True) + # for i in indexList: + # try: + # data.drop([i], inplace=True) + # except: + # continue + # # print('第{}组\n'.format(a)) + # # a += 1 + return data + + +# 处理数据(移除,重新赋值,或者是其他操作) +def dealData(scada_data: pd.DataFrame): + # 是否保存处理好的数据 + Is_save = True + indexList = findIndexOfExceptPoint(scada_data) + removeDataByIndex(indexList=indexList, data=scada_data) + print("处理后的数据为:") + print(scada_data) + if Is_save: + print("============保存处理好的数据,路径为{}============".format(save_path)) + scada_data.to_csv(save_path, index=False, encoding='gbk') + + return scada_data + + +# 读取数据,转为numpy数组或者tf数组 +def read_data(file_name, isNew: bool = False): + ''' 导入数据 ''' + with open(file_name, 'r') as f: + if isNew: + # scada_data = pd.read_csv(f,low_memory=False, encoding='gbk', usecols=baseUseCols, parse_dates=['时间']) + scada_data = pd.read_csv(f, low_memory=False, encoding='gbk', parse_dates=['realtime']) + print(scada_data) + scada_data = dealData(scada_data=scada_data) + print(scada_data.head) + scada_data = np.array(scada_data) + else: + scada_data = np.loadtxt(f, str, delimiter=",") + label = scada_data[0, 3:] + label=list(['Gs','Gio','Gip','Gp','Gwt','En','Gft','Grt','Gwt','Et','Rs','Ap','Ws','Dw','Ges','Gt','Vx','Vy']) + print("导入数据成功,将数据转为numpy或tf数组...") + needed_data = scada_data[1:, 3:].astype(dtype=np.float) + ## needed_data = tf.cast(needed_data, tf.float32) tensor无法转为pd.DataFrame + print(needed_data) + print("转换成功,并返回...") + return needed_data, label + + +def plot_original_data(data): + rows, cols = data.shape + print("开始画图...") + + for i in range(cols): + plt.figure(i) + plt.plot(data[:, i]) + plt.show() + + +def execute(file_name=source_path,N=10): + needed_data, label = read_data(file_name=file_name, isNew=False) + print(needed_data) + print(needed_data.shape) + # plot_original_data(needed_data) + person = cal_correlation_coefficient(needed_data, label) + person = np.array(person) + min = get_most_N_correlation_coefficient(person, N=N) + + for index in min: + if index == min[0]: + total_data = np.expand_dims(needed_data[:, index], axis=-1) + else: + total_data = np.concatenate([total_data, np.expand_dims(needed_data[:, index], axis=-1)], axis=-1) + + return total_data + + +def deal_data(file_name=source_path): + ''' 导入数据 ''' + with open(file_name, 'r') as f: + + # scada_data = pd.read_csv(f,low_memory=False, encoding='gbk', usecols=baseUseCols, parse_dates=['时间']) + scada_data = pd.read_csv(f, low_memory=False, encoding='gbk', parse_dates=['realtime']) + print(scada_data) + scada_data = dealData(scada_data=scada_data) + print(scada_data.head) + scada_data = np.array(scada_data) + + scada_data = np.loadtxt(f, str, delimiter=",") + label = scada_data[0, 3:] + label = list( + ['Gs', 'Gio', 'Gip', 'Gp', 'Gwt', 'En', 'Gft', 'Grt', 'Gwt', 'Et', 'Rs', 'Ap', 'Ws', 'Dw', 'Ges', 'Gt', + 'Vx', 'Vy']) + print("导入数据成功,将数据转为numpy或tf数组...") + needed_data = scada_data[1:, 3:].astype(dtype=np.float) + ## needed_data = tf.cast(needed_data, tf.float32) tensor无法转为pd.DataFrame + print(needed_data) + print("转换成功,并返回...") + return needed_data, label + pass + + +if __name__ == '__main__': + total_data = execute(N=10, file_name=source_path) + # print(total_data) + # print(total_data.shape) + # plot_original_data() diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/loadData_daban.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/loadData_daban.py new file mode 100644 index 0000000..4a0f33b --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/loadData_daban.py @@ -0,0 +1,207 @@ +import pandas as pd +import numpy as np +import tensorflow as tf +import csv +import os +import matplotlib.pyplot as plt +import seaborn as sns + +'''设置数据源文件路径''' +# source_path = r'G:\data\SCADA数据\jb4q_8.csv' +source_path = "G:\data\SCADA数据\jb4q_8_delete_total_zero.csv" + +'''修改后的数据源存储路径''' +save_path = r'G:\data\SCADA数据\jb4q_8_delete_total_zero.csv' + +'''需要的列''' + + +# baseUseCols = ["num_gearbox_sumptemp","num_gearbox_inletoiltemp","num_gearbox_inletpress","num_gearbox_coolingwatertemp"] + +# target_path = r'G:\data\SCADA数据\华能三塘湖/dealed/后十万2018.01.16.csv' +# target_folder = r'G:\data\SCADA数据\华能三塘湖/dealed' + +#96748 107116 + + +# 生成文件夹 +def folderGenerate(folder_name): + if not os.path.exists(folder_name): + os.makedirs(folder_name) + + +# 皮尔逊相关系数 +def cal_correlation_coefficient(data, label): + print("计算皮尔逊相关系数") + pd_data = pd.DataFrame(data) + person = pd_data.corr() + print(person) + # 画热点图heatmap + # cmap = sns.heatmap(person, annot=True, xticklabels=label, yticklabels=label) + # plt.figure(1, figsize=(6.0, 2.68)) + # plt.subplots_adjust(left=0.1, right=0.94, bottom=0.2, top=0.9, wspace=None, + # hspace=None) + # plt.tight_layout() + # font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 10} # 设置坐标标签的字体大小,字体 + # font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + # plt.xlabel("X", size=10,fontdict=font1) + # plt.ylabel("Y", size=10,fontdict=font1) + # plt.title("Heatmap of correlation coefficient matrix", size=20,fontdict=font1) + # + # # 调整色带的标签: + # cbar = cmap.collections[0].colorbar + # cbar.ax.tick_params(labelsize=15, labelcolor="black") + # cbar.ax.set_ylabel(ylabel="color scale", color="red", loc="center",fontdict=font2) + # + # plt.show() + return person + + +def get_most_N_correlation_coefficient(person, N=10): + print("获得相关度最高的{}个值".format(N)) + # total_correlation = person[1:, 1:] + abs_correlation = np.abs(person) + one = np.ones(shape=abs_correlation.shape) + two = np.subtract(one, abs_correlation) + rows, cols = two.shape + total_sum = [] + for i in range(cols): + # print(two[i]) + total = np.sum(two[i]) + total_sum.append(total) + + print("total_sum:", total_sum) + # 取最小的N个数,因为是与1减了以后的,越小相关系数越大 + print("arg:",np.argpartition(total_sum, N)) + min = np.argpartition(total_sum, N)[:N] + max = np.argpartition(total_sum, N)[total_sum.__len__() - N:] + print("min:",min) + return min + + +# 过滤或者线性填充 +def findIndexOfExceptPoint(data: pd.DataFrame): + # indexList2D = [] + # indexList = [] + # indexList2 = [] + # indexList3 = [] + # indexList4 = [] + indexList = [] + print("开始清洗") + for i in data.index: + if i % 10000 == 0: + print("已处理了{}条数据".format(i)) + ## 删除绝大多数0 + # if data['num_gearbox_sumptemp'][i] != 0 and (i < 416166 or i > 432766) and ( + # data['num_gearbox_pumpoutletpress'][i] == 0 or data['num_activepower'][i] == 0 or + # data['num_gen_torque'][i] == 0): + # indexList.append(i) + # 删除全部有0 + # if (i < 416166 or i > 432766) and ( + # data['num_gearbox_pumpoutletpress'][i] == 0 or data['num_activepower'][i] == 0 or + # data['num_gen_torque'][i] == 0): + # indexList.append(i) + # 只删除全部0 + if (i < 416166 or i > 432766) and ( + data['num_gearbox_sumptemp'][i] == 0 and data['num_gearbox_inletoiltemp'][i] == 0 and + data['num_gearbox_inletpress'][i] == 0): + indexList.append(i) + else: + pass + + # indexList2D = [indexList1, indexList2, indexList3, indexList4, indexList5] + indexList2D = set(indexList) + print("要移除的index:", indexList2D) + return indexList2D + + +# 根据index移除异常数据 +def removeDataByIndex(indexList, data): + print("开始移除异常index的数据") + a = 1 + data.drop(indexList, inplace=True) + # for i in indexList: + # try: + # data.drop([i], inplace=True) + # except: + # continue + # # print('第{}组\n'.format(a)) + # # a += 1 + return data + + +# 处理数据(移除,重新赋值,或者是其他操作) +def dealData(scada_data: pd.DataFrame): + # 是否保存处理好的数据 + Is_save = True + indexList = findIndexOfExceptPoint(scada_data) + removeDataByIndex(indexList=indexList, data=scada_data) + print("处理后的数据为:") + print(scada_data) + if Is_save: + print("============保存处理好的数据,路径为{}============".format(save_path)) + scada_data.to_csv(save_path, index=False, encoding='gbk') + + return scada_data + + +# 读取数据,转为numpy数组或者tf数组 +def read_data(file_name, isNew: bool = False): + ''' 导入数据 ''' + with open(file_name, 'r') as f: + if isNew: + # scada_data = pd.read_csv(f,low_memory=False, encoding='gbk', usecols=baseUseCols, parse_dates=['时间']) + scada_data = pd.read_csv(f, low_memory=False, encoding='gbk', parse_dates=['realtime']) + print(scada_data) + scada_data = dealData(scada_data=scada_data) + print(scada_data.head) + scada_data = np.array(scada_data) + else: + scada_data = np.loadtxt(f, str, delimiter=",") + label = scada_data[0, 4:] + label=list(['Gs','Gio','Gip','Gp','Gwt','En','Gft','Grt','Gwt','Et','Rs','Ap','Ws','Dw','Ges','Gt','Vx','Vy']) + print("导入数据成功,将数据转为numpy或tf数组...") + needed_data = scada_data[1:, 4:].astype(dtype=np.float) + ## needed_data = tf.cast(needed_data, tf.float32) tensor无法转为pd.DataFrame + print(needed_data) + print("转换成功,并返回...") + return needed_data, label + + +def plot_original_data(data): + rows, cols = data.shape + print("开始画图...") + + for i in range(cols): + plt.figure(i) + plt.plot(data[:, i]) + plt.show() + + +def execute(file_name=source_path,N=10): + needed_data, label = read_data(file_name=file_name, isNew=False) + print(needed_data) + print(needed_data.shape) + # plot_original_data(needed_data) + person = cal_correlation_coefficient(needed_data, label) + person = np.array(person) + min = get_most_N_correlation_coefficient(person, N=N) + + for index in min: + if index == min[0]: + total_data = np.expand_dims(needed_data[:, index], axis=-1) + else: + total_data = np.concatenate([total_data, np.expand_dims(needed_data[:, index], axis=-1)], axis=-1) + + return total_data + + +if __name__ == '__main__': + # total_data = execute(N=10, file_name=source_path) + # print(total_data) + # print(total_data.shape)7 10 13 + # 15中间有一段差别很大 + file_name='H:\data\SCADA数据\SCADA_已处理_粤水电达坂城2020.1月-5月/风机15.csv' + needed_data, label = read_data(file_name=file_name, isNew=False) + print(needed_data.shape) + plot_original_data(needed_data) diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/plot_raw_data.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/plot_raw_data.py new file mode 100644 index 0000000..b0258fa --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/data_deal/plot_raw_data.py @@ -0,0 +1,60 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + +''' +@Author : dingjiawen +@Date : 2022/11/2 12:59 +@Usage : 画原始数据 +@Desc : +''' +import pandas as pd +import numpy as np + + + + +source_path = "G:\data\SCADA数据\jb4q_8_delete_total_zero.csv" + +def deal_data(file_name=source_path): + ''' 导入数据 ''' + with open(file_name, 'r') as f: + scada_data = np.loadtxt(f, str, delimiter=",") + label = scada_data[0, 3:] + label = list( + ['Gs', 'Gio', 'Gip', 'Gp', 'Gwt', 'En', 'Gft', 'Grt', 'Gwt', 'Et', 'Rs', 'Ap', 'Ws', 'Dw', 'Ges', 'Gt', + 'Vx', 'Vy']) + print("导入数据成功,将数据转为numpy或tf数组...") + needed_data = scada_data[1:37000, 3:].astype(dtype=np.float) + ## needed_data = tf.cast(needed_data, tf.float32) tensor无法转为pd.DataFrame + print(needed_data) + print("转换成功,并返回...") + return needed_data, label + pass + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +if __name__ == '__main__': + needed_data, label=deal_data() + data=normalization(data=needed_data) + np.savetxt('G:\data\SCADA数据/normalization.csv',data,delimiter=',') + print(data.shape) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/healthyScore.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/healthyScore.py new file mode 100644 index 0000000..d16a0e5 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/healthyScore.py @@ -0,0 +1,85 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/22 19:42 +@Usage : +@Desc : 测试计算健康度 +''' + +import matplotlib.pyplot as plt +import math +import numpy as np + +ucl = 4 + + +def func(x, ucl): + y = [] + z = [] + s = [] + g = [] + f = [] + for i in x: + each_g = -math.exp(math.log(2) / ucl * i) + 2 + each_f = 2 / (1 + math.exp((i - ucl) * 1.5)) - 1 + if i < ucl: + each_z = (2 / (1 + math.exp(-(ucl / i - 1))) - 1) + else: + each_z = (2 / (1 + math.exp(((i - ucl) / (2 * ucl - i)))) - 1) + each_s = math.cos(math.pi * i / (2 * ucl)) + each_y = 50 + 50 * each_z + y.append(each_y) + z.append(each_z) + s.append(each_s) + g.append(each_g) + f.append(each_f) + return y, z, s, g, f + pass + + +def healthy_score(x): + weight = 2 / (1 + math.exp((x - ucl) * 1.5)) - 1 + healthy_score = 60 + 40 * weight + return healthy_score + + +x = np.linspace(0.1, 2 * ucl - 0.1, 40) +y, z, s, g, f = func(x, 4) +print(x) + +print(z) +print(f) +print(s) +print(healthy_score(ucl)) +# plt.subplot(4, 1, 1) +# plt.plot(x, y) +# plt.subplot(4, 1, 2) +# plt.plot(x, z) +# plt.subplot(4, 1, 3) +# plt.plot(x, f) +# plt.subplot(4, 1, 4) +# plt.plot(x, s) +# # plt.subplot(4, 1, 4) +# # plt.plot(x, g) +# plt.show() +plt.figure(2) +plt.rc('font', family='Times New Roman') # 全局字体样式 + +plt.plot(x, f, label='a') +plt.plot(x, z, label='b') +plt.plot(x, s, label='c') +font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 16} # 设置坐标标签的字体大小,字体 +font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 13} # 设置坐标标签的字体大小,字体 +indices = [i for i in range(8)] +y_indices = [-1, -0.5, 0, 0.5, 1] +x_classes = ['UCL/4', 'UCL/2', '3UCL/4', 'UCL', '5UCL/4', '3UCL/2', '7UCL/4', '2UCL'] +y_classes = ['0', '25', '50', '75', '100'] +plt.xticks([index + 0.5 for index in indices], x_classes, fontproperties=font1) # 设置横坐标方向,rotation=45为45度倾斜 +plt.yticks([index for index in y_indices], y_classes, fontproperties=font1) # 设置横坐标方向,rotation=45为45度倾斜 +# pad调整label与坐标轴之间的距离 +plt.tick_params(bottom=True, top=False, left=True, right=False, direction='inout', length=5, width=1, pad=1) +plt.ylabel('Healthy Mapping', fontdict=font2) +plt.xlabel('R$_t$', fontdict=font2) +plt.legend(fontsize=16) +plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/others_idea/CNN_GRU.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/others_idea/CNN_GRU.py new file mode 100644 index 0000000..2ac7b5b --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/others_idea/CNN_GRU.py @@ -0,0 +1,263 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from condition_monitoring.data_deal import loadData +from keras.callbacks import EarlyStopping +import os +import shutil + +# 孔师兄idea:CNN+GRU + + +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 8 +learning_rate = 0.01 +EPOCH = 101 +model_name = "CNN_GRU" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' +save_name = "../model/{0}_timestamp{1}_featureNum{2}_batch_size{3}_Epoch{4}.h5".format(model_name, + time_stamp, feature_num, + batch_size, EPOCH) +'''文件名''' +file_name = "G:\data\SCADA数据\jb4q_8_delete_all_zero.csv" + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp=time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + # print("removed_data.shape:", data.shape) + # print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + # print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + # print("train_data.shape:", train_data.shape) + # print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data,time_stamp=time_stamp): + + rows,cols = data.shape + train_data = np.empty(shape=[rows-time_stamp-1,time_stamp,cols]) + train_label = np.empty(shape=[rows-time_stamp-1,cols]) + for i in range(rows): + if i +time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i+time_stamp] + train_label[i] = data[i+time_stamp] + + print("重叠采样以后:") + print("data:",train_data) + print("label:",train_label) + + return train_data,train_label + + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + +def get_MSE(data, label, new_model): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1/temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + + dims, = mse.shape + + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + + # plt.plot(max) + # plt.plot(mse) + # plt.plot(mean) + # # plt.plot(min) + # plt.show() + # + # + return mse,mean,max + # pass + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num,file_name=file_name) + total_data = normalization(data=total_data) + train_data, train_label = get_training_data_overlapping(total_data[:300455, :]) + + ## TODO training + # model = condition_monitoring_model() + # checkpoint = tf.keras.callbacks.ModelCheckpoint( + # filepath=save_name, + # monitor='val_loss', + # verbose=1, + # save_best_only=True, + # mode='min', + # period=1) + # lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=5, min_lr=0.0001) + # early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=30, mode='min', verbose=1) + # model.compile(optimizer=tf.optimizers.Adam(learning_rate=learning_rate), loss=tf.losses.mse) + # model.summary() + # model.fit(train_data, train_label, batch_size=batch_size, epochs=EPOCH, validation_split=0.1, + # callbacks=[checkpoint, lr_scheduler, early_stop]) + + ## TODO testing + print("===============================") + print(total_data.shape) + print("===============================") + test_data, test_label = get_training_data(total_data[:300455, :]) + newModel = tf.keras.models.load_model(save_name) + mse,mean,max = get_MSE(test_data, test_label, new_model=newModel) + print("===============================") + print("mse:",mse) + print(mse.shape) + print("===============================") + + + # test_data, test_label = get_training_data(total_data[20000:, :]) + # predicted_data = newModel.predict(test_data) + # rows, cols = predicted_data.shape + # print("=====================================") + # print(predicted_data) + # print(predicted_data.shape) + # print("=====================================") + + # temp = np.abs(predicted_data - test_label) + # temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + # temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + # temp3 = temp1 / temp2 + # mse = np.sum((temp1 / temp2) ** 2, axis=1) + # print("====================") + # print("new_mse:",mse) + # print(mse.shape) + # np.savetxt("mse", mse, delimiter=',') + # print("===================") + + # plt.plot(mse[2000:]) + plt.plot(mse) + # plt.plot(mean) + # plt.plot(max) + plt.show() + + + + + + + # data = pd.DataFrame(mse).ewm(span=3).mean() + # print(data) + # data =np.array(data) + # + # index,_ = data.shape + # + # + # + # for i in range(2396): + # if data[i,0] >5: + # data[i,0] = data[i-1,:] + # print(data) + # mean = data[2000:2396,:].mean() + # std = data[2000:2396,:].std() + # mean=np.broadcast_to(mean,shape=[500,]) + # std=np.broadcast_to(std,shape=[500,]) + # plt.plot(data[2000:2396,:]) + # plt.plot(mean) + # plt.plot(mean+3*std) + # plt.plot(mean-3*std) + # plt.show() diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/others_idea/__init__.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/others_idea/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/plot/plot_loss.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/plot/plot_loss.py new file mode 100644 index 0000000..44a5601 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/plot/plot_loss.py @@ -0,0 +1,132 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/6 13:12 +@Usage : +@Desc : 画loss +''' + +import pandas as pd +import numpy as np +import matplotlib.pyplot as plt +from matplotlib.pyplot import rcParams + +import lttb + +file_name = "E:\论文写作\ISA论文返修\loss.txt" + + +def aux_loss(file_name="E:\论文写作\ISA论文返修\loss.txt"): + mse1_list = [] + mse2_list = [] + mse3_list = [] + total_list = [] + + with open(file_name, 'r', encoding='utf-8') as f: + i = 0 + for ann in f.readlines(): + ann = ann.strip('\n') # 去除文本中的换行符 + if i % 4 == 0: + # print(ann) + mse1 = float(ann.split(" ")[1]) + mse1_list.append(mse1) + elif i % 4 == 1: + mse2 = float(ann.split(" ")[1]) + mse2_list.append(mse2) + elif i % 4 == 2: + mse3 = float(ann.split(" ")[1]) + mse3_list.append(mse3) + elif i % 4 == 3: + total = float(ann.split(" ")[5]) + total_list.append(total) + i += 1 + + mse1_list = lttb.downsample(np.array([range(len(mse1_list)), mse1_list]).T, n_out=50) + mse2_list = lttb.downsample(np.array([range(len(mse2_list)), mse2_list]).T, n_out=50) + mse3_list = lttb.downsample(np.array([range(len(mse3_list)), mse3_list]).T, n_out=50) + total_list = lttb.downsample(np.array([range(len(total_list)), total_list]).T, n_out=50) + + plot_aux_loss(mse1_list, mse2_list, mse3_list) + + +def plot_aux_loss(mse1_list, mse2_list, mse3_list): + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + pic1 = plt.figure(figsize=(8, 3), dpi=200) + # plt.ylim(0, 0.6) # 设置y轴范围 + plt.plot(mse1_list[:, 1], label='Predict Head 1 Loss') + plt.plot(mse2_list[:, 1], label='Predict Head 2 Loss') + plt.plot(mse3_list[:, 1], label='Predict Head 3 Loss') + plt.title('Training loss') + plt.xlabel('epoch') + plt.ylabel('loss') + plt.legend(loc='upper right') + plt.grid(alpha=0.8) + + plt.show() + + +def main_loss(file_name="E:\论文写作\ISA论文返修\main_loss.txt"): + mse1_list = [] + cross_Entropy_list = [] + total_list = [] + + with open(file_name, 'r', encoding='utf-8') as f: + i = 0 + for ann in f.readlines(): + ann = ann.strip('\n') # 去除文本中的换行符 + if i % 3 == 0: + # print(ann) + mse1 = float(ann.split(" ")[1]) + mse1_list.append(mse1) + elif i % 3 == 1: + cross_Entropy = float(ann.split(" ")[1])*0.02 + cross_Entropy_list.append(cross_Entropy) + elif i % 3 == 2: + total = float(ann.split(" ")[5]) + total_list.append(total) + i += 1 + + mse1_list = lttb.downsample(np.array([range(len(mse1_list)), mse1_list]).T, n_out=40) + cross_Entropy_list = lttb.downsample(np.array([range(len(cross_Entropy_list)), cross_Entropy_list]).T, n_out=40) + total_list = lttb.downsample(np.array([range(len(total_list)), total_list]).T, n_out=40) + + plot_main_loss(mse1_list, cross_Entropy_list,total_list) + +# 0.014995 0.016387 +# 0.014384 0.015866 +# 0.014985 0.014261 +# 0.013008 0.01349 +# 0.013285 0.013139 +# 0.012999 0.012714 +# 0.011451 0.012477 +# 0.010055 0.012471 +# 0.010303 0.014595 +def plot_main_loss(mse1_list, mse2_list,total_loss): + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + pic1 = plt.figure(figsize=(8, 3), dpi=200) + # plt.ylim(0, 0.6) # 设置y轴范围 + plt.plot(mse1_list[:, 1], label='${L_{diff}}$') + plt.plot(mse2_list[:, 1], label='${L_{correct}}$') + plt.plot(total_loss[:, 1], label='${L_{main}}$') + plt.title('Training loss') + plt.xlabel('epoch') + plt.ylabel('loss') + plt.legend(loc='upper right') + plt.grid(alpha=0.8) + + plt.show() + + +if __name__ == '__main__': + main_loss() \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/plot/test_plot.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/plot/test_plot.py index 5530cd3..84082b4 100644 --- a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/plot/test_plot.py +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/plot/test_plot.py @@ -56,12 +56,12 @@ def plot_result_banda(result_data): fig, ax = plt.subplots(1, 1) plt.rc('font', family='Times New Roman') # 全局字体样式 font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 5} # 设置坐标标签的字体大小,字体 - font2 = {'family': 'Times New Roman', 'weight': 'normal','size':7} # 设置坐标标签的字体大小,字体 + font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 7} # 设置坐标标签的字体大小,字体 plt.scatter(list(range(result_data.shape[0])), result_data, c='black', s=0.01, label="predict") # 画出 y=1 这条水平线 plt.axhline(0.5, c='red', label='Failure threshold', lw=1) # 箭头指向上面的水平线 - plt.axvline(result_data.shape[0] * 2 / 3-50, c='blue', ls='-.', lw=0.5, label='real fault') + plt.axvline(result_data.shape[0] * 2 / 3 - 50, c='blue', ls='-.', lw=0.5, label='real fault') # plt.axvline(415548, c='blue', ls='-.', lw=0.5, label='real fault') # plt.xticks(range(6), ('06/09/17', '12/09/17', '18/09/17', '24/09/17', '29/09/17')) # 设置x轴的标尺 plt.text(result_data.shape[0] * 5 / 6, 0.4, "Fault", fontsize=5, color='black', verticalalignment='top', @@ -85,8 +85,8 @@ def plot_result_banda(result_data): # pad调整label与坐标轴之间的距离 plt.tick_params(bottom=True, top=False, left=True, right=False, direction='inout', length=2, width=0.5, pad=1) # plt.yticks([index for index in indices1], classes1) - plt.ylabel('Confidence',fontdict=font2) - plt.xlabel('Time',fontdict=font2) + plt.ylabel('Confidence', fontdict=font2) + plt.xlabel('Time', fontdict=font2) plt.tight_layout() # plt.legend(loc='best', edgecolor='black', fontsize=4) plt.legend(loc='upper right', frameon=False, fontsize=4.5) @@ -98,11 +98,11 @@ def plot_result_banda(result_data): bbox_to_anchor=(0.1, 0.1, 1, 1), bbox_transform=ax.transAxes) axins.scatter(list(range(result_data.shape[0])), result_data, c='black', s=0.005, label="predict") - axins.axvline(result_data.shape[0] * 2 / 3-50, c='blue', ls='-.', lw=0.5, label='real fault') + axins.axvline(result_data.shape[0] * 2 / 3 - 50, c='blue', ls='-.', lw=0.5, label='real fault') plt.axhline(0.5, c='red', label='Failure threshold', lw=0.5) # 设置放大区间 # 设置放大区间 - zone_left = int(result_data.shape[0] * 2 / 3 -160) + zone_left = int(result_data.shape[0] * 2 / 3 - 160) zone_right = int(result_data.shape[0] * 2 / 3) + 40 # zone_left = int(result_data.shape[0] * 2 / 3 +250) # zone_right = int(result_data.shape[0] * 2 / 3) + 450 @@ -132,6 +132,7 @@ def plot_result_banda(result_data): plt.show() pass + def plot_result(result_data): parameters = { 'figure.dpi': 600, @@ -153,8 +154,7 @@ def plot_result(result_data): # 画出 y=1 这条水平线 plt.axhline(0.5, c='red', label='Failure threshold', lw=1) - - plt.axvline(result_data.shape[0] * 2 / 3-15, c='blue', ls='-.', lw=0.5, label='real fault') + plt.axvline(result_data.shape[0] * 2 / 3 - 15, c='blue', ls='-.', lw=0.5, label='real fault') plt.text(result_data.shape[0] * 5 / 6, 0.4, "Fault", fontsize=5, color='black', verticalalignment='top', horizontalalignment='center', bbox={'facecolor': 'grey', @@ -188,11 +188,11 @@ def plot_result(result_data): bbox_to_anchor=(0.1, 0.1, 1, 1), bbox_transform=ax.transAxes) axins.scatter(list(range(result_data.shape[0])), result_data, c='black', s=0.005, label="predict") - axins.axvline(result_data.shape[0] * 2 / 3-15, c='blue', ls='-.', lw=0.5, label='real fault') + axins.axvline(result_data.shape[0] * 2 / 3 - 15, c='blue', ls='-.', lw=0.5, label='real fault') plt.axhline(0.5, c='red', label='Failure threshold', lw=0.5) # 设置放大区间 # 设置放大区间 - zone_left = int(result_data.shape[0] * 2 / 3 -100) + zone_left = int(result_data.shape[0] * 2 / 3 - 100) zone_right = int(result_data.shape[0] * 2 / 3) + 100 x = list(range(result_data.shape[0])) @@ -221,6 +221,25 @@ def plot_result(result_data): pass +K = 18 +namuda = 0.01 + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + length, = data.shape + t = 0 + data = pd.DataFrame(data).ewm(alpha=namuda).mean() + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return data, np.broadcast_to(mid, shape=[length, ]), np.broadcast_to(UCL, shape=[length, ]), np.broadcast_to(LCL, + shape=[ + length, ]) + pass + + def plot_MSE(total_MSE, total_max): parameters = { 'figure.dpi': 600, @@ -251,12 +270,13 @@ def plot_MSE(total_MSE, total_max): classes = ['01/09/17', '08/09/17', '15/09/17', '22/09/17', '29/09/17'] plt.xticks([index + 0.5 for index in indices], classes, rotation=25) # 设置横坐标方向,rotation=45为45度倾斜 - plt.ylabel('Mse', fontsize=5) + plt.ylabel('MSE', fontsize=5) plt.xlabel('Time', fontsize=5) plt.tight_layout() - plt.plot(total_max, "--", label="max", linewidth=0.5) - plt.plot(total_MSE, label="mse", linewidth=0.5, color='purple') + plt.plot(total_max, "--", label="Threshold", linewidth=0.5, color='red') + plt.plot(total_max, "--", label="Threshold", linewidth=0.5, color='red') + plt.plot(total_MSE, label="MSE", linewidth=0.5, color='purple') plt.legend(loc='best', frameon=False, fontsize=5) # plt.plot(total_mean) @@ -265,6 +285,54 @@ def plot_MSE(total_MSE, total_max): pass +def plot_EWMA(model_name, total_MSE, total_mid, total_max, total_min): + parameters = { + 'figure.dpi': 600, + 'figure.figsize': (2.7, 2), + 'savefig.dpi': 600, + 'xtick.direction': 'in', + 'ytick.direction': 'in', + 'xtick.labelsize': 5, + 'ytick.labelsize': 5, + 'legend.fontsize': 5, + } + plt.rcParams.update(parameters) + plt.figure() + plt.rc('font', family='Times New Roman') # 全局字体样式#画混淆矩阵 + font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 5} # 设置坐标标签的字体大小,字体 + + result_data = total_MSE + # 画出 y=1 这条水平线 + # plt.axhline(0.5, c='red', label='Failure threshold',lw=1) + # 箭头指向上面的水平线 + # plt.arrow(result_data.shape[0]*2/3, 0.55, 2000, 0.085, width=0.00001, ec='red',length_includes_head=True) + # plt.text(result_data.shape[0] * 2 / 3 + 1000, 0.7, "real fault", fontsize=5, color='red', + # verticalalignment='top') + + plt.axvline(result_data.shape[0] * 2 / 3, c='blue', ls='-.', lw=0.5, label="real fault") + + indices = [result_data.shape[0] * i / 4 for i in range(5)] + classes = ['09/01', '09/08', '09/15', '09/22', '09/29/'] + + plt.xticks([index + 0.5 for index in indices], classes, rotation=25) # 设置横坐标方向,rotation=45为45度倾斜 + plt.ylabel('MSE', fontsize=5) + plt.xlabel('Time', fontsize=5) + plt.tight_layout() + + plt.plot(total_min, "--", label="LCL", linewidth=0.5, color='red') + plt.plot(total_mid, "--", label="mean(X)", linewidth=0.5) + plt.plot(total_max, "--", label="UCL", linewidth=0.5, color='red') + plt.plot(total_MSE, label="MSE", linewidth=0.5, color='purple') + plt.legend(loc='best', frameon=False, fontsize=5) + + # plt.plot(total_mean) + # plt.plot(min) + + plt.savefig('E:\论文写作\ISA论文返修\图片\比较方法的EWMD/{0}.png'.format(model_name)) + plt.show() + pass + + def plot_Corr(data, size: int = 1): parameters = { 'figure.dpi': 600, @@ -333,31 +401,36 @@ def plot_bar(y_data): plt.bar(x_width[1], y_data[1], lw=1, color=['#F5E3C4'], width=0.5, label="GRU", edgecolor='black') plt.bar(x_width[2], y_data[2], lw=1, color=['#EBC99D'], width=0.5, label="CNN-GRU", edgecolor='black') - plt.bar(x_width[3], y_data[3], lw=1, color=['#FFC79C'], width=0.5, label="DCConv", edgecolor='black') - plt.bar(x_width[4], y_data[4], lw=1, color=['#BEE9C7'], width=0.5, label="RepDCConv", edgecolor='black') - plt.bar(x_width[5], y_data[5], lw=1, color=['#B8E9D0'], width=0.5, label="RNet-MSE", edgecolor='black') - plt.bar(x_width[6], y_data[6], lw=1, color=['#B9E9E2'], width=0.5, label="RNet", edgecolor='black') - plt.bar(x_width[7], y_data[7], lw=1, color=['#D6E6F2'], width=0.5, label="RNet-SE", edgecolor='black') - plt.bar(x_width[8], y_data[8], lw=1, color=['#B4D1E9'], width=0.5, label="RNet-L", edgecolor='black') - plt.bar(x_width[9], y_data[9], lw=1, color=['#AEB5EE'], width=0.5, label="RNet-D", edgecolor='black') - plt.bar(x_width[10], y_data[10], lw=1, color=['#D2D3FC'], width=0.5, label="ResNet-18", edgecolor='black') - plt.bar(x_width[11], y_data[11], lw=1, color=['#D5A9FF'], width=0.5, label="ResNet-C", edgecolor='black') - plt.bar(x_width[12], y_data[12], lw=1, color=['#E000F5'], width=0.5, label="JMNet", edgecolor='black') + + plt.bar(x_width[3], y_data[13], lw=1, color=['#FCD58B'], width=0.5, label="CG-QA", edgecolor='black') + plt.bar(x_width[4], y_data[14], lw=1, color=['#FFBA75'], width=0.5, label="CG-3{0}".format(chr(963)), edgecolor='black') + + plt.bar(x_width[5], y_data[3], lw=1, color=['#FFC79C'], width=0.5, label="DCConv", edgecolor='black') + plt.bar(x_width[6], y_data[4], lw=1, color=['#BEE9C7'], width=0.5, label="RepDCConv", edgecolor='black') + plt.bar(x_width[7], y_data[5], lw=1, color=['#B8E9D0'], width=0.5, label="RNet-MSE", edgecolor='black') + plt.bar(x_width[8], y_data[6], lw=1, color=['#B9E9E2'], width=0.5, label="RNet", edgecolor='black') + plt.bar(x_width[9], y_data[7], lw=1, color=['#D6E6F2'], width=0.5, label="RNet-SE", edgecolor='black') + plt.bar(x_width[10], y_data[8], lw=1, color=['#B4D1E9'], width=0.5, label="RNet-L", edgecolor='black') + plt.bar(x_width[11], y_data[9], lw=1, color=['#AEB5EE'], width=0.5, label="RNet-D", edgecolor='black') + plt.bar(x_width[12], y_data[10], lw=1, color=['#D2D3FC'], width=0.5, label="ResNet-18", edgecolor='black') + plt.bar(x_width[13], y_data[11], lw=1, color=['#D5A9FF'], width=0.5, label="ResNet-C", edgecolor='black') + plt.bar(x_width[14], y_data[12], lw=1, color=['#E000F5'], width=0.5, label="JRFPN", edgecolor='black') + # plt.tick_params(bottom=False, top=False, left=True, right=False, direction='in', pad=1) plt.xticks([]) - plt.ylabel('False Positive Rate(%)', fontsize=22) + plt.ylabel('False Negative Rate(%)', fontsize=22) plt.xlabel('Methods', fontsize=22) # plt.tight_layout() - num1, num2, num3, num4 = 0, 1, 3, 0 + num1, num2, num3, num4 = 0.015, 1, 3, 0 plt.legend(bbox_to_anchor=(num1, num2), loc=num3, borderaxespad=num4, ncol=5, frameon=False, handlelength=1, handletextpad=0.45, columnspacing=1) plt.ylim([-0.01, 5]) plt.show() -def acc(y_data=list): +def acc(y_data: list): parameters = { 'figure.dpi': 600, 'figure.figsize': (10, 6), @@ -373,22 +446,31 @@ def acc(y_data=list): plt.rc('font', family='Times New Roman') # 全局字体样式#画混淆矩阵 font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 5} # 设置坐标标签的字体大小,字体 - x_width = [i / 2 for i in range(0, len(y_data))] + x_width = [i for i in range(0, len(y_data))] # x2_width = [i + 0.3 for i in x_width] - plt.bar(x_width[0], y_data[0], lw=1, color=['#FAF4E1'], width=0.25, label="CNN", edgecolor='black') - plt.bar(x_width[1], y_data[1], lw=1, color=['#F5E3C4'], width=0.25, label="GRU", edgecolor='black') - plt.bar(x_width[2], y_data[2], lw=1, color=['#EBC99D'], width=0.25, label="CNN-GRU", edgecolor='black') - plt.bar(x_width[3], y_data[3], lw=1, color=['#FFC79C'], width=0.25, label="DCConv", edgecolor='black') - plt.bar(x_width[4], y_data[4], lw=1, color=['#BEE9C7'], width=0.25, label="RepDCConv", edgecolor='black') - plt.bar(x_width[5], y_data[5], lw=1, color=['#B8E9D0'], width=0.25, label="RNet-MSE", edgecolor='black') - plt.bar(x_width[6], y_data[6], lw=1, color=['#B9E9E2'], width=0.25, label="RNet", edgecolor='black') - plt.bar(x_width[7], y_data[7], lw=1, color=['#D6E6F2'], width=0.25, label="RNet-SE", edgecolor='black') - plt.bar(x_width[8], y_data[8], lw=1, color=['#B4D1E9'], width=0.25, label="RNet-L", edgecolor='black') - plt.bar(x_width[9], y_data[9], lw=1, color=['#AEB5EE'], width=0.25, label="RNet-D", edgecolor='black') - plt.bar(x_width[10], y_data[10], lw=1, color=['#D2D3FC'], width=0.25, label="ResNet-18", edgecolor='black') - plt.bar(x_width[11], y_data[11], lw=1, color=['#D5A9FF'], width=0.25, label="ResNet-C", edgecolor='black') - plt.bar(x_width[12], y_data[12], lw=1, color=['#E000F5'], width=0.25, label="JMNet", edgecolor='black') + _width = [i for i in range(0, len(y_data))] + # x2_width = [i + 0.3 for i in x_width] + + plt.bar(x_width[0], y_data[0], lw=1, color=['#FAF4E1'], width=0.5, label="CNN", edgecolor='black') + + plt.bar(x_width[1], y_data[1], lw=1, color=['#F5E3C4'], width=0.5, label="GRU", edgecolor='black') + plt.bar(x_width[2], y_data[2], lw=1, color=['#EBC99D'], width=0.5, label="CNN-GRU", edgecolor='black') + + plt.bar(x_width[3], y_data[13], lw=1, color=['#FCD58B'], width=0.5, label="CG-QA", edgecolor='black') + plt.bar(x_width[4], y_data[14], lw=1, color=['#FFBA75'], width=0.5, label="CG-3{0}".format(chr(963)), + edgecolor='black') + + plt.bar(x_width[5], y_data[3], lw=1, color=['#FFC79C'], width=0.5, label="DCConv", edgecolor='black') + plt.bar(x_width[6], y_data[4], lw=1, color=['#BEE9C7'], width=0.5, label="RepDCConv", edgecolor='black') + plt.bar(x_width[7], y_data[5], lw=1, color=['#B8E9D0'], width=0.5, label="RNet-MSE", edgecolor='black') + plt.bar(x_width[8], y_data[6], lw=1, color=['#B9E9E2'], width=0.5, label="RNet", edgecolor='black') + plt.bar(x_width[9], y_data[7], lw=1, color=['#D6E6F2'], width=0.5, label="RNet-SE", edgecolor='black') + plt.bar(x_width[10], y_data[8], lw=1, color=['#B4D1E9'], width=0.5, label="RNet-L", edgecolor='black') + plt.bar(x_width[11], y_data[9], lw=1, color=['#AEB5EE'], width=0.5, label="RNet-D", edgecolor='black') + plt.bar(x_width[12], y_data[10], lw=1, color=['#D2D3FC'], width=0.5, label="ResNet-18", edgecolor='black') + plt.bar(x_width[13], y_data[11], lw=1, color=['#D5A9FF'], width=0.5, label="ResNet-C", edgecolor='black') + plt.bar(x_width[14], y_data[12], lw=1, color=['#E000F5'], width=0.5, label="JRFPN", edgecolor='black') # plt.tick_params(bottom=False, top=False, left=True, right=False, direction='in', pad=1) plt.xticks([]) @@ -397,7 +479,8 @@ def acc(y_data=list): # plt.tight_layout() num1, num2, num3, num4 = 0, 1, 3, 0 - plt.legend(bbox_to_anchor=(num1, num2), loc=num3, borderaxespad=num4, ncol=5, frameon=False,handlelength=1,handletextpad=0.45,columnspacing=1) + plt.legend(bbox_to_anchor=(num1, num2), loc=num3, borderaxespad=num4, ncol=5, frameon=False, handlelength=1, + handletextpad=0.45, columnspacing=1) plt.ylim([60, 105]) plt.show() @@ -424,23 +507,28 @@ def plot_FNR1(y_data): plt.bar(x_width[0], y_data[0], lw=1, color=['#FAF4E1'], width=0.5 * 5 / 6, label="CNN", edgecolor='black') plt.bar(x_width[1], y_data[1], lw=1, color=['#F5E3C4'], width=0.5 * 5 / 6, label="GRU", edgecolor='black') plt.bar(x_width[2], y_data[2], lw=1, color=['#EBC99D'], width=0.5 * 5 / 6, label="CNN-GRU", edgecolor='black') - plt.bar(x_width[3], y_data[3], lw=1, color=['#FFC79C'], width=0.5 * 5 / 6, label="DCConv", edgecolor='black') - plt.bar(x_width[4], y_data[4], lw=1, color=['#BEE9C7'], width=0.5 * 5 / 6, label="RepDCConv", edgecolor='black') - plt.bar(x_width[5], y_data[5], lw=1, color=['#B8E9D0'], width=0.5 * 5 / 6, label="RNet-MSE", edgecolor='black') - plt.bar(x_width[6], y_data[6], lw=1, color=['#B9E9E2'], width=0.5 * 5 / 6, label="RNet", edgecolor='black') - plt.bar(x_width[7], y_data[7], lw=1, color=['#D6E6F2'], width=0.5 * 5 / 6, label="RNet-SE", edgecolor='black') - plt.bar(x_width[8], y_data[8], lw=1, color=['#B4D1E9'], width=0.5 * 5 / 6, label="RNet-L", edgecolor='black') - plt.bar(x_width[9], y_data[9], lw=1, color=['#AEB5EE'], width=0.5 * 5 / 6, label="RNet-D", edgecolor='black') + + plt.bar(x_width[3], y_data[10], lw=1, color=['#FCD58B'], width=0.5 * 5 / 6, label="CG-QA", edgecolor='black') + plt.bar(x_width[4], y_data[11], lw=1, color=['#EBC99D'], width=0.5 * 5 / 6, label="CG-3{0}".format(chr(963)), edgecolor='black') + + plt.bar(x_width[5], y_data[3], lw=1, color=['#FFC79C'], width=0.5 * 5 / 6, label="DCConv", edgecolor='black') + plt.bar(x_width[6], y_data[4], lw=1, color=['#BEE9C7'], width=0.5 * 5 / 6, label="RepDCConv", edgecolor='black') + plt.bar(x_width[7], y_data[5], lw=1, color=['#B8E9D0'], width=0.5 * 5 / 6, label="RNet-MSE", edgecolor='black') + plt.bar(x_width[8], y_data[6], lw=1, color=['#B9E9E2'], width=0.5 * 5 / 6, label="RNet", edgecolor='black') + plt.bar(x_width[9], y_data[7], lw=1, color=['#D6E6F2'], width=0.5 * 5 / 6, label="RNet-SE", edgecolor='black') + plt.bar(x_width[10], y_data[8], lw=1, color=['#B4D1E9'], width=0.5 * 5 / 6, label="RNet-L", edgecolor='black') + plt.bar(x_width[11], y_data[9], lw=1, color=['#AEB5EE'], width=0.5 * 5 / 6, label="RNet-D", edgecolor='black') + # plt.tick_params(bottom=False, top=False, left=True, right=False, direction='in', pad=1) plt.xticks([]) - plt.ylabel('False Negative Rate(%)', fontsize=22) + plt.ylabel('False Positive Rate(%)', fontsize=22) # plt.tick_params(bottom=False, top=False, left=True, right=False, direction='in', pad=1) plt.xlabel('Methods', fontsize=22) # plt.tight_layout() - num1, num2, num3, num4 = 0.05, 1, 3, 0 + num1, num2, num3, num4 = 0.025, 1, 3, 0 plt.legend(bbox_to_anchor=(num1, num2), loc=num3, borderaxespad=num4, ncol=5, frameon=False, handlelength=1, handletextpad=0.45, columnspacing=1) @@ -479,19 +567,29 @@ def plot_FNR2(y_data): # plt.bar(x_width[8], y_data[8], lw=1, color=['#E000F5'], width=0.5 * 2 / 3, label="JMNet", edgecolor='black') plt.bar(x_width[0], y_data[0], lw=1, color=['#AEB5EE'], width=0.5 * 2 / 3, label="ResNet-18", edgecolor='black') - plt.bar(x_width[1], y_data[1], color=['#FFFFFF'], label=" ") - plt.bar(x_width[2], y_data[2], color=['#FFFFFF'], label=" ") - plt.bar(x_width[3], y_data[3], color=['#FFFFFF'], label=" ") - plt.bar(x_width[4], y_data[4],lw=1, color=['#D5A9FF'], width=0.5 * 2 / 3, label="RNet-C", edgecolor='black') - plt.bar(x_width[5], y_data[5], color=['#FFFFFF'], label=" ") - plt.bar(x_width[6], y_data[6], color=['#FFFFFF'], label=" ") + plt.bar(x_width[1], y_data[1], color=['#FFFFFF'], label=" ") + plt.bar(x_width[2], y_data[2], color=['#FFFFFF'], label=" ") + plt.bar(x_width[3], y_data[3], color=['#FFFFFF'], label=" ") + plt.bar(x_width[4], y_data[4], color=['#FFFFFF'], label=" ") + plt.bar(x_width[5], y_data[5], color=['#FFFFFF'], label=" ") + + + plt.bar(x_width[6], y_data[6], lw=1, color=['#D5A9FF'], width=0.5 * 2 / 3, label="RNet-C", edgecolor='black') + plt.bar(x_width[7], y_data[7], color=['#FFFFFF'], label=" ") + plt.bar(x_width[8], y_data[8], color=['#FFFFFF'], label=" ") + plt.bar(x_width[9], y_data[9], color=['#FFFFFF'], label=" ") + plt.bar(x_width[10], y_data[10], color=['#FFFFFF'], label=" ") + plt.bar(x_width[11], y_data[11], color=['#FFFFFF'], label=" ") + # plt.bar(x_width[7] + 2.0, y_data[10], lw=0.5, color=['#8085e9'], width=1, label="ResNet-18", edgecolor='black') - plt.bar(x_width[7], y_data[7], color=['#FFFFFF'], label=" ") - plt.bar(x_width[8], y_data[8],lw=1, color=['#E000F5'], width=0.5 * 2 / 3, label="JMNet", edgecolor='black') + + + plt.bar(x_width[12], y_data[12], lw=1, color=['#E000F5'], width=0.5 * 2 / 3, label="JRFPN", edgecolor='black') + plt.bar(x_width[13], y_data[13], color=['#FFFFFF'], label=" ") # plt.tick_params(bottom=False, top=False, left=True, right=False, direction='in', pad=1) plt.xticks([]) - plt.ylabel('False Negative Rate(%)', fontsize=22) + plt.ylabel('False Positive Rate(%)', fontsize=22) # plt.xlabel('Time', fontsize=5) # plt.tight_layout() @@ -554,14 +652,14 @@ def plot_hot_one(data): pass -def plot_mse(file_name_mse="../others_idea/mse",data:str=''): +def plot_mse(file_name_mse="../others_idea/mse", data: str = ''): mse = np.loadtxt(file_name_mse, delimiter=",") - raw_data=np.loadtxt(data,delimiter=",") - raw_data=raw_data[:,:mse.shape[1]] - print("mse:",mse.shape) - print("raw_data:",raw_data.shape) - res=raw_data-mse - mse.shape[0]*2/3 + raw_data = np.loadtxt(data, delimiter=",") + raw_data = raw_data[:, :mse.shape[1]] + print("mse:", mse.shape) + print("raw_data:", raw_data.shape) + res = raw_data - mse + mse.shape[0] * 2 / 3 # mse = mse[2000:2300] # mse = mse[1800:2150] @@ -589,20 +687,19 @@ def plot_mse(file_name_mse="../others_idea/mse",data:str=''): plt.axvline(res.shape[1] * 2 / 3, c='purple', ls='-.', lw=0.5, label="real fault") plt.plot(res[i, :], lw=0.5) - - plt.show() + def plot_mse_single(file_name_mse="../self_try/compare/mse/JM_banda/banda_joint_result_predict1.csv"): mse = np.loadtxt(file_name_mse, delimiter=",") - print("mse:",mse.shape) + print("mse:", mse.shape) - need_shape=int(mse.shape[0]*2/3) + need_shape = int(mse.shape[0] * 2 / 3) # mse = mse[2000:2300] # mse = mse[1800:2150] # mse = mse[ need_shape+100:need_shape+377] - mse = mse[ need_shape-300:need_shape-10] + mse = mse[need_shape - 300:need_shape - 10] parameters = { 'figure.dpi': 600, @@ -613,7 +710,7 @@ def plot_mse_single(file_name_mse="../self_try/compare/mse/JM_banda/banda_joint_ 'xtick.labelsize': 6, 'ytick.labelsize': 6, 'legend.fontsize': 5, - 'font.family':'Times New Roman' + 'font.family': 'Times New Roman' } plt.rcParams.update(parameters) font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 7} # 设置坐标标签的字体大小,字体 @@ -622,9 +719,9 @@ def plot_mse_single(file_name_mse="../self_try/compare/mse/JM_banda/banda_joint_ plt.rc('font', family='Times New Roman') # 全局字体样式#画混淆矩阵 indices = [mse.shape[0] * i / 4 for i in range(5)] # classes = ['07:21','08:21', '09:21', '10:21', '11:21'] - classes = ['01:58','02:58', '03:58', '04:58', '05:58'] + classes = ['01:58', '02:58', '03:58', '04:58', '05:58'] - plt.xticks([index for index in indices], classes, rotation=25) # 设置横坐标方向,rotation=45为45度倾斜 + plt.xticks([index for index in indices], classes, rotation=25) # 设置横坐标方向,rotation=45为45度倾斜 # pad调整label与坐标轴之间的距离 plt.tick_params(bottom=True, top=False, left=True, right=False, direction='inout', length=2, width=0.5, pad=1) plt.ylabel('Residual', fontdict=font2) @@ -632,8 +729,6 @@ def plot_mse_single(file_name_mse="../self_try/compare/mse/JM_banda/banda_joint_ plt.tight_layout() plt.plot(mse[:], lw=0.5) - - plt.show() @@ -641,37 +736,36 @@ def plot_3d(): # 线 fig = plt.figure() ax = fig.add_subplot(projection='3d') - data,label = read_data(file_name='G:\data\SCADA数据\jb4q_8_delete_total_zero.csv',isNew=False) + data, label = read_data(file_name='G:\data\SCADA数据\jb4q_8_delete_total_zero.csv', isNew=False) print(data) print(data.shape) - x=range(data.shape[1]) - y=range(data.shape[0]) - color=[[0.16,0.14,0.13], - [0.89,0.09,0.05], - [0.12,0.56,1.00], - [0.01,0.66,0.62], - [0.63,0.04,0.83], - [0.63,0.32,0.18], - [0.20,0.63,0.79], - [0.50,0.16,0.16], - [0.61,0.4,0.12], - [1.00,0.38,0.00], - [0.53,0.81,0.92], - [0.13,0.55,0.13], - [1.00,0.89,0.52], - [0.44,0.50,0.41], - [0.20,0.63,0.79], - [0.00,0.78,0.55], - [1.00,0.39,0.28], - [0.25,0.41,0.88]] + x = range(data.shape[1]) + y = range(data.shape[0]) + color = [[0.16, 0.14, 0.13], + [0.89, 0.09, 0.05], + [0.12, 0.56, 1.00], + [0.01, 0.66, 0.62], + [0.63, 0.04, 0.83], + [0.63, 0.32, 0.18], + [0.20, 0.63, 0.79], + [0.50, 0.16, 0.16], + [0.61, 0.4, 0.12], + [1.00, 0.38, 0.00], + [0.53, 0.81, 0.92], + [0.13, 0.55, 0.13], + [1.00, 0.89, 0.52], + [0.44, 0.50, 0.41], + [0.20, 0.63, 0.79], + [0.00, 0.78, 0.55], + [1.00, 0.39, 0.28], + [0.25, 0.41, 0.88]] # c颜色,marker:样式*雪花 - ax.plot( xs=y,ys=x, zs=data, c=color, marker="*") + ax.plot(xs=y, ys=x, zs=data, c=color, marker="*") plt.show() - def test_result(file_name: str = result_file_name): # result_data = np.recfromcsv(file_name) result_data = np.loadtxt(file_name, delimiter=",") @@ -680,7 +774,7 @@ def test_result(file_name: str = result_file_name): theshold = len(result_data) print(theshold) print(theshold * 2 / 3) - theshold = theshold * 2 / 3-50 + theshold = theshold * 2 / 3 - 50 # 计算误报率和漏报率 positive_rate = result_data[:int(theshold)][result_data[:int(theshold)] < 0.66].__len__() / ( theshold * 2 / 3) @@ -783,22 +877,167 @@ def test_model_visualization(model_name=file_name): plot_hot(needed_data) +def plot_loss(): + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + pic1 = plt.figure(figsize=(8, 6), dpi=200) + plt.subplot(211) + plt.plot(np.arange(1, epochs + 1), src_acc_list, 'b', label='TrainAcc') + plt.plot(np.arange(1, epochs + 1), val_acc_list, 'r', label='ValAcc') + plt.ylim(0.3, 1.0) # 设置y轴范围 + plt.title('Training & Validation accuracy') + plt.xlabel('epoch') + plt.ylabel('accuracy') + plt.legend(loc='lower right') + plt.grid(alpha=0.4) + + plt.subplot(212) + plt.plot(np.arange(1, epochs + 1), train_loss_list, 'b', label='TrainLoss') + plt.plot(np.arange(1, epochs + 1), val_loss_list, 'r', label='ValLoss') + plt.ylim(0, 0.08) # 设置y轴范围 + plt.title('Training & Validation loss') + plt.xlabel('epoch') + plt.ylabel('loss') + plt.legend(loc='upper right') + plt.grid(alpha=0.4) + + # 获取当前时间戳 + timestamp = int(time.time()) + + # 将时间戳转换为字符串 + timestamp_str = str(timestamp) + plt.savefig(timestamp_str, dpi=200) + if __name__ == '__main__': + # plot_mse_single() + # model_list = ["DCConv", "GRU"] + # + # for model_name in model_list: + # # model_name = "CNN_GRU" + # mse = np.loadtxt( + # 'E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\{0}/banda\mse.csv'.format( + # model_name), + # delimiter=',') + # max = np.loadtxt( + # 'E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\{0}/banda\max.csv'.format( + # model_name), + # delimiter=',') + # data, mid, UCL, LCL = EWMA(mse) + # + # plot_EWMA( + # model_name=model_name+"_banda", + # total_MSE=data, + # total_mid=mid, + # total_max=UCL, + # total_min=LCL + # ) + # + # model_list = ["RNet_D", "RNet_L","RNet_S","RNet_MSE"] + # predict_list = ["predict1","predict2","predict3"] + # + # for model_name in model_list: + # for predict_head in predict_list: + # # model_name = "RNet_L" + # # predict_head = "predict3" + # mse = np.loadtxt( + # 'E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\{0}/banda\{0}_banda_mse_{1}.csv'.format( + # model_name, predict_head), + # delimiter=',') + # max = np.loadtxt( + # 'E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\{0}/banda\{0}_banda_max_{1}.csv'.format( + # model_name, predict_head), + # delimiter=',') + # data, mid, UCL, LCL = EWMA(mse) + # + # plot_EWMA( + # model_name=model_name + predict_head+"_banda", + # total_MSE=data, + # total_mid=mid, + # total_max=UCL, + # total_min=LCL + # ) + + # model_name = "RNet_D" + # predict_head = "predict1" + # mse = np.loadtxt( + # 'E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\{0}\{0}_timestamp120_feature10_mse_{1}.csv'.format( + # model_name, predict_head), + # delimiter=',') + # max = np.loadtxt( + # 'E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\{0}\{0}_timestamp120_feature10_max_{1}.csv'.format( + # model_name, predict_head), + # delimiter=',') + # data, mid, UCL, LCL = EWMA(mse) + # + # plot_EWMA( + # model_name=model_name + predict_head , + # total_MSE=data, + # total_mid=mid, + # total_max=UCL, + # total_min=LCL + # ) + + # test_result("E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\RNet_345\RNet_345_timestamp120_feature10_result.csv") # test_mse(fi) # test_result( # file_name='E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\ResNet\ResNet_timestamp120_feature10_result.csv') # test_corr() # acc() - # list = [3.77, 2.64, 2.35, 2.05, 1.76, 1.09, 0.757, 0.82, 1.1, 0.58, 0, 0.03, 0.02] - # test_bar(list) - - # list=[98.56,98.95,99.95,96.1,95,99.65,76.25,72.64,75.87,68.74] + # list = [ + # 3.77, + # 2.64, + # 2.35, + # + # 2.05, + # 1.76, + # 1.09, + # 0.76, + # 0.82, + # 1.10, + # 0.58, + # 0, + # 0.03, + # 0.02, + # 0.21, + # 2.18, + # ] + # + # # test_bar(list) + # list = [ + # 64.63, + # 65.26, + # 65.11, + # + # 66.6, + # 67.15, + # 73.86, + # 66.28, + # 75.24, + # 73.98, + # 76.7, + # 98.86, + # 99.38, + # 99.79, + # 70.41, + # 66.71 + # ] + # # acc(list) + # + # list=[98.56,98.95,99.95,96.1,95,99.65,76.25,72.64,75.87,68.74,88.36,95.52] # plot_FNR1(list) - # # - list=[3.43,1.99,1.92,2.17,1.63,1.81,1.78,1.8,0.6] - list=[3.43,1.99,1.92,2.17,1.8,1.81,1.78,1.8,0.6] - plot_FNR2(list) + # # # # + # # list=[3.43,1.99,1.92,2.17,1.63,1.81,1.78,1.8,0.6] + # list=[3.43,0,0,0,0,0,1.8,0,0,0,0,0,0.6,0] + # # list = [98.56, 98.95, 99.95, 96.1, 95, 99.65, 76.25, 72.64, 75.87, 68.74, 88.36, 95.52] + # plot_FNR2(list) # 查看网络某一层的权重 # test_model_visualization(model_name = "E:\跑模型\论文写作/SE.txt") @@ -810,11 +1049,11 @@ if __name__ == '__main__': # 单独预测图 # plot_mse('E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\JM_banda/banda_joint_result_predict3.csv',data='E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\JM_banda/raw_data.csv') # plot_mse_single('E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\RNet_D/banda\RNet_D_banda_mse_predict1.csv') - #画3d图 + plot_mse_single('E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\RNet_3\RNet_3_timestamp120_feature10_result.csv') + # 画3d图 # plot_3d() - - #原始数据图 + # 原始数据图 # file_names='E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse\JM_banda/raw_data.csv' # data= np.loadtxt(file_names,delimiter=',') diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring.py new file mode 100644 index 0000000..939628a --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring.py @@ -0,0 +1,526 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D +from model.Dynamic_channelAttention.Dynamic_channelAttention import DynamicChannelAttention +from condition_monitoring.data_deal import loadData +from model.Joint_Monitoring.Joint_Monitoring2 import Joint_Monitoring + +from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model + +''' +@Author : dingjiawen +@Date : 2022/7/8 10:29 +@Usage : 尝试将预测和分类两种方式相结合,联合监测 +@Desc :REPVGG+unsampling+GRU进行重构,后面接GDP=全局动态池化+分类器 +随epoch衰减的MSELoss+随epoch增强的crossEntropy +''' + +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 16 +learning_rate = 0.001 +EPOCH = 101 +model_name = "joint" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "../model/weight/{0}_timestamp{1}_feature{2}_Epoch{4}_weight/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_step_two_name = "../model/two_weight/{0}_timestamp{1}_feature{2}_weight/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +# save_name = "../model/joint/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +# save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +'''文件名''' +file_name = "G:\data\SCADA数据\jb4q_8_delete_all_zero.csv" + +''' +文件说明:jb4q_8_delete_all_zero.csv是删除了除异常以外的所有0值的文件 +文件从0:300454行均是正常值(2019/7.30 00:00:00 - 2019/9/18 11:21:00) +从300455:317052行均是异常值(2019/9/18 11:21:01 - 2019/9/29 23:59:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 300454 +# 最后异常的时间点 +unhealthy_date = 317052 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# RepConv重参数化卷积 +def RepConv(input_tensor, k=3): + _, _, output_dim = input_tensor.shape + conv1 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=k, strides=1, padding='SAME')(input_tensor) + b1 = tf.keras.layers.BatchNormalization()(conv1) + + conv2 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=1, strides=1, padding='SAME')(input_tensor) + b2 = tf.keras.layers.BatchNormalization()(conv2) + + b3 = tf.keras.layers.BatchNormalization()(input_tensor) + + out = tf.keras.layers.Add()([b1, b2, b3]) + out = tf.nn.relu(out) + return out + + +# RepBlock模块 +def RepBlock(input_tensor, num: int = 3): + for i in range(num): + input_tensor = RepConv(input_tensor) + return input_tensor + + +# GAP 全局平均池化 +def Global_avg_channelAttention(input_tensor): + _, length, channel = input_tensor.shape + DWC1 = DepthwiseConv1D(kernel_size=1, padding='SAME')(input_tensor) + GAP = tf.keras.layers.GlobalAvgPool1D()(DWC1) + c1 = tf.keras.layers.Conv1D(filters=channel, kernel_size=1, padding='SAME')(GAP) + s1 = tf.nn.sigmoid(c1) + output = tf.multiply(input_tensor, s1) + return output + + +# GDP 全局动态池化 +def Global_Dynamic_channelAttention(input_tensor): + _, length, channel = input_tensor.shape + DWC1 = DepthwiseConv1D(kernel_size=1, padding='SAME')(input_tensor) + + # GAP + GAP = tf.keras.layers.GlobalAvgPool1D()(DWC1) + c1 = tf.keras.layers.Conv1D(filters=channel, kernel_size=1, padding='SAME')(GAP) + s1 = tf.nn.sigmoid(c1) + + # GMP + GMP = tf.keras.layers.GlobalMaxPool1D()(DWC1) + c2 = tf.keras.layers.Conv1D(filters=channel, kernel_size=1, padding='SAME')(GMP) + s3 = tf.nn.sigmoid(c2) + + output = tf.multiply(input_tensor, s1) + return output + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + +def get_MSE(data, label, new_model): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + + dims, = mse.shape + + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + + # plt.plot(max) + # plt.plot(mse) + # plt.plot(mean) + # # plt.plot(min) + # plt.show() + # + # + return mse, mean, max + # pass + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def shuffle(train_data, train_label1, train_label2, is_split: bool = False, split_size: float = 0.2): + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(train_data, + train_label1, + train_label2, + test_size=split_size, + shuffle=True, + random_state=100) + if is_split: + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + train_data = np.concatenate([train_data, test_data], axis=0) + train_label1 = np.concatenate([train_label1, test_label1], axis=0) + train_label2 = np.concatenate([train_label2, test_label2], axis=0) + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2 + pass + + +def split_test_data(healthy_data, healthy_label1, healthy_label2, unhealthy_data, unhealthy_label1, unhealthy_label2, + split_size: float = 0.2): + data = np.concatenate([healthy_data, unhealthy_data], axis=0) + label1 = np.concatenate([healthy_label1, unhealthy_label1], axis=0) + label2 = np.concatenate([healthy_label2, unhealthy_label2], axis=0) + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(data, + label1, + label2, + test_size=split_size, + shuffle=True, + random_state=100) + + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + + pass + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def train_step_one(train_data, train_label1, train_label2): + model = Joint_Monitoring() + # # # # TODO 需要运行编译一次,才能打印model.summary() + # model.build(input_shape=(batch_size, filter_num, dims)) + # model.summary() + history_loss = [] + history_val_loss = [] + learning_rate = 1e-3 + for epoch in range(EPOCH): + + print() + print("EPOCH:", epoch, "/", EPOCH, ":") + train_data, train_label1, train_label2 = shuffle(train_data, train_label1, train_label2) + if epoch == 0: + train_data, train_label1, train_label2, val_data, val_label1, val_label2 = shuffle(train_data, train_label1, + train_label2, + is_split=True) + # print() + # print("EPOCH:", epoch, "/", EPOCH, ":") + # 用于让train知道,这是这个epoch中的第几次训练 + z = 0 + # 用于batch_size次再训练 + k = 1 + for data_1, label_1, label_2 in zip(train_data, train_label1, train_label2): + size, _, _ = train_data.shape + data_1 = tf.expand_dims(data_1, axis=0) + label_1 = tf.expand_dims(label_1, axis=0) + label_2 = tf.expand_dims(label_2, axis=0) + if batch_size != 1: + if k % batch_size == 1: + data = data_1 + label1 = label_1 + label2 = label_2 + else: + data = tf.concat([data, data_1], axis=0) + label1 = tf.concat([label1, label_1], axis=0) + label2 = tf.concat([label2, label_2], axis=0) + else: + data = data_1 + label1 = label_1 + label2 = label_2 + + if k % batch_size == 0: + # label = tf.expand_dims(label, axis=-1) + loss_value = model.train(input_tensor=data, label1=label1, label2=label2, learning_rate=learning_rate, + is_first_time=True) + print(z * batch_size, "/", size, ":===============>", "loss:", loss_value.numpy()) + k = 0 + z = z + 1 + k = k + 1 + val_loss = model.get_val_loss(val_data=val_data, val_label1=val_label1, val_label2=val_label2, + is_first_time=True) + SaveBestModel(model=model, save_name=save_name, history_loss=history_val_loss, loss_value=val_loss.numpy()) + # SaveBestH5Model(model=model, save_name=save_name, history_loss=history_val_loss, loss_value=val_loss.numpy()) + history_val_loss.append(val_loss) + history_loss.append(loss_value.numpy()) + print('Training loss is :', loss_value.numpy()) + print('Validating loss is :', val_loss.numpy()) + if IsStopTraining(history_loss=history_val_loss, patience=7): + break + if Is_Reduce_learning_rate(history_loss=history_val_loss, patience=3): + if learning_rate >= 1e-4: + learning_rate = learning_rate * 0.1 + pass + + +def train_step_two(step_one_model, step_two_model, train_data, train_label1, train_label2): + # step_two_model = Joint_Monitoring() + # step_two_model.build(input_shape=(batch_size, time_stamp, feature_num)) + # step_two_model.summary() + history_loss = [] + history_val_loss = [] + history_accuracy = [] + learning_rate = 1e-3 + for epoch in range(EPOCH): + print() + print("EPOCH:", epoch, "/", EPOCH, ":") + train_data, train_label1, train_label2 = shuffle(train_data, train_label1, train_label2) + if epoch == 0: + train_data, train_label1, train_label2, val_data, val_label1, val_label2 = shuffle(train_data, train_label1, + train_label2, + is_split=True) + # print() + # print("EPOCH:", epoch, "/", EPOCH, ":") + # 用于让train知道,这是这个epoch中的第几次训练 + z = 0 + # 用于batch_size次再训练 + k = 1 + accuracy_num = 0 + for data_1, label_1, label_2 in zip(train_data, train_label1, train_label2): + size, _, _ = train_data.shape + data_1 = tf.expand_dims(data_1, axis=0) + label_1 = tf.expand_dims(label_1, axis=0) + label_2 = tf.expand_dims(label_2, axis=0) + if batch_size != 1: + if k % batch_size == 1: + data = data_1 + label1 = label_1 + label2 = label_2 + else: + data = tf.concat([data, data_1], axis=0) + label1 = tf.concat([label1, label_1], axis=0) + label2 = tf.concat([label2, label_2], axis=0) + else: + data = data_1 + label1 = label_1 + label2 = label_2 + + if k % batch_size == 0: + # label = tf.expand_dims(label, axis=-1) + output1, output2, output3, _ = step_one_model.call(inputs=data, is_first_time=True) + loss_value, accuracy_value = step_two_model.train(input_tensor=data, label1=label1, label2=label2, + learning_rate=learning_rate, + is_first_time=False, pred_3=output1, pred_4=output2, + pred_5=output3) + accuracy_num += accuracy_value + print(z * batch_size, "/", size, ":===============>", "loss:", loss_value.numpy(), "| accuracy:", + accuracy_num / ((z + 1) * batch_size)) + k = 0 + z = z + 1 + k = k + 1 + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=val_data, val_label1=val_label1, + val_label2=val_label2, + is_first_time=False, step_one_model=step_one_model) + SaveBestModelByAccuracy(model=step_two_model, save_name=save_step_two_name, history_accuracy=history_accuracy, + accuracy_value=val_accuracy) + history_val_loss.append(val_loss) + history_loss.append(loss_value.numpy()) + print('Training loss is : {0} | Training accuracy is : {1}'.format(loss_value.numpy(), + accuracy_num / ((z + 1) * batch_size))) + print('Validating loss is : {0} | Validating accuracy is : {1}'.format(val_loss.numpy(), val_accuracy)) + if IsStopTraining(history_loss=history_val_loss, patience=7): + break + if Is_Reduce_learning_rate(history_loss=history_val_loss, patience=3): + if learning_rate >= 1e-4: + learning_rate = learning_rate * 0.1 + pass + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + # TODO 第一步训练 + # 单次测试 + # train_step_one(train_data=train_data_healthy[:32, :, :], train_label1=train_label1_healthy[:32, :],train_label2=train_label2_healthy[:32, ]) + # train_step_one(train_data=train_data_healthy, train_label1=train_label1_healthy,train_label2=train_label2_healthy) + + # 导入第一步已经训练好的模型,一个继续训练,一个只输出结果 + step_one_model = Joint_Monitoring() + step_one_model.load_weights(save_name) + # + # step_two_model = Joint_Monitoring() + # step_two_model.load_weights(save_name) + + # TODO 第二步训练 + ### healthy_data.shape: (300333,120,10) + ### unhealthy_data.shape: (16594,10) + healthy_size, _, _ = train_data_healthy.shape + unhealthy_size, _, _ = train_data_unhealthy.shape + train_data, train_label1, train_label2, test_data, test_label1, test_label2 = split_test_data( + healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :, :], + healthy_label1=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + healthy_label2=train_label2_healthy[healthy_size - 2 * unhealthy_size:, ], unhealthy_data=train_data_unhealthy, + unhealthy_label1=train_label1_unhealthy, unhealthy_label2=train_label2_unhealthy) + # train_step_two(step_one_model=step_one_model, step_two_model=step_two_model, + # train_data=train_data, + # train_label1=train_label1, train_label2=np.expand_dims(train_label2, axis=-1)) + + # TODO 测试测试集 + step_two_model = Joint_Monitoring() + step_two_model.load_weights(save_step_two_name) + test(step_one_model=step_one_model, step_two_model=step_two_model, test_data=test_data, test_label1=test_label1, + test_label2=np.expand_dims(test_label2, axis=-1)) + + pass diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring_banda.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring_banda.py index e4d0966..bbfd514 100644 --- a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring_banda.py +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring_banda.py @@ -7,7 +7,6 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D -from model.Dynamic_channelAttention.Dynamic_channelAttention import DynamicChannelAttention from condition_monitoring.data_deal import loadData_daban as loadData from model.Joint_Monitoring.Joint_Monitoring_banda import Joint_Monitoring @@ -40,7 +39,7 @@ save_name = "../hard_model/weight/{0}_epoch16_0.0009_0.0014/weight".format(model feature_num, batch_size, EPOCH) -save_step_two_name = "../hard_model/two_weight/{0}_epoch24_9875_9867/weight".format(model_name, +save_step_two_name = "../hard_model/two_weight/temp{0}/weight".format(model_name, time_stamp, feature_num, batch_size, @@ -385,7 +384,7 @@ def train_step_one(train_data, train_label1, train_label2): k = k + 1 val_loss, val_accuracy = model.get_val_loss(val_data=val_data, val_label1=val_label1, val_label2=val_label2, is_first_time=True) - SaveBestModel(model=model, save_name=save_name, history_loss=history_val_loss, loss_value=val_loss.numpy()) + SaveBestModel(model=model, save_name=save_name, history_loss=history_val_loss, loss_value=val_loss.numpy(),is_all=True) # SaveBestH5Model(model=model, save_name=save_name, history_loss=history_val_loss, loss_value=val_loss.numpy()) history_val_loss.append(val_loss) history_loss.append(loss_value.numpy()) @@ -586,28 +585,32 @@ if __name__ == '__main__': #### TODO 第一步训练 # 单次测试 # train_step_one(train_data=train_data_healthy[:128, :, :], train_label1=train_label1_healthy[:128, :],train_label2=train_label2_healthy[:128, ]) + # 整体训练 # train_step_one(train_data=train_data_healthy, train_label1=train_label1_healthy, train_label2=train_label2_healthy) - # 导入第一步已经训练好的模型,一个继续训练,一个只输出结果 - # step_one_model = Joint_Monitoring() - # step_one_model.load_weights(save_name) - # - # step_two_model = Joint_Monitoring() - # step_two_model.load_weights(save_name) + #### TODO 第二步训练 ### healthy_data.shape: (300333,120,10) ### unhealthy_data.shape: (16594,10) + + #### 导入第一步已经训练好的模型,一个继续训练,一个只输出结果 + step_one_model = Joint_Monitoring() + step_one_model.load_weights(save_name) + + step_two_model = Joint_Monitoring() + step_two_model.load_weights(save_name) + healthy_size, _, _ = train_data_healthy.shape unhealthy_size, _, _ = train_data_unhealthy.shape - # train_data, train_label1, train_label2, test_data, test_label1, test_label2 = split_test_data( - # healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :, :], - # healthy_label1=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], - # healthy_label2=train_label2_healthy[healthy_size - 2 * unhealthy_size:, ], unhealthy_data=train_data_unhealthy, - # unhealthy_label1=train_label1_unhealthy, unhealthy_label2=train_label2_unhealthy) - # train_step_two(step_one_model=step_one_model, step_two_model=step_two_model, - # train_data=train_data, - # train_label1=train_label1, train_label2=np.expand_dims(train_label2, axis=-1)) + train_data, train_label1, train_label2, test_data, test_label1, test_label2 = split_test_data( + healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :, :], + healthy_label1=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + healthy_label2=train_label2_healthy[healthy_size - 2 * unhealthy_size:, ], unhealthy_data=train_data_unhealthy, + unhealthy_label1=train_label1_unhealthy, unhealthy_label2=train_label2_unhealthy) + train_step_two(step_one_model=step_one_model, step_two_model=step_two_model, + train_data=train_data, + train_label1=train_label1, train_label2=np.expand_dims(train_label2, axis=-1)) ### TODO 测试测试集 # step_one_model = Joint_Monitoring() diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring_hard.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring_hard.py new file mode 100644 index 0000000..7ab3cf3 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/Joint_Monitoring_hard.py @@ -0,0 +1,576 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D +from model.Dynamic_channelAttention.Dynamic_channelAttention import DynamicChannelAttention +from condition_monitoring.data_deal import loadData +from model.Joint_Monitoring.Joint_Monitoring3 import Joint_Monitoring + +from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model + +''' +@Author : dingjiawen +@Date : 2022/7/8 10:29 +@Usage : 尝试将预测和分类两种方式相结合,联合监测 +@Desc :REPVGG+unsampling+GRU进行重构,后面接GDP=全局动态池化+分类器 +随epoch衰减的MSELoss+随epoch增强的crossEntropy +''' + +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 16 +learning_rate = 0.001 +EPOCH = 101 +model_name = "joint" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "../hard_model/weight/{0}_timestamp{1}_feature{2}_weight_epoch8/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_step_two_name = "../hard_model/two_weight/{0}_timestamp{1}_feature{2}_weight_epoch14/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +# save_name = "../model/joint/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +# save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +'''文件名''' +file_name = "G:\data\SCADA数据\jb4q_8_delete_total_zero.csv" + +''' +文件说明:jb4q_8_delete_total_zero.csv是删除了只删除了全是0的列的文件 +文件从0:415548行均是正常值(2019/7.30 00:00:00 - 2019/9/18 11:14:00) +从415549:432153行均是异常值(2019/9/18 11:21:01 - 2021/1/18 00:00:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 415548 +# 最后异常的时间点 +unhealthy_date = 432153 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# RepConv重参数化卷积 +def RepConv(input_tensor, k=3): + _, _, output_dim = input_tensor.shape + conv1 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=k, strides=1, padding='SAME')(input_tensor) + b1 = tf.keras.layers.BatchNormalization()(conv1) + + conv2 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=1, strides=1, padding='SAME')(input_tensor) + b2 = tf.keras.layers.BatchNormalization()(conv2) + + b3 = tf.keras.layers.BatchNormalization()(input_tensor) + + out = tf.keras.layers.Add()([b1, b2, b3]) + out = tf.nn.relu(out) + return out + + +# RepBlock模块 +def RepBlock(input_tensor, num: int = 3): + for i in range(num): + input_tensor = RepConv(input_tensor) + return input_tensor + + +# GAP 全局平均池化 +def Global_avg_channelAttention(input_tensor): + _, length, channel = input_tensor.shape + DWC1 = DepthwiseConv1D(kernel_size=1, padding='SAME')(input_tensor) + GAP = tf.keras.layers.GlobalAvgPool1D()(DWC1) + c1 = tf.keras.layers.Conv1D(filters=channel, kernel_size=1, padding='SAME')(GAP) + s1 = tf.nn.sigmoid(c1) + output = tf.multiply(input_tensor, s1) + return output + + +# GDP 全局动态池化 +def Global_Dynamic_channelAttention(input_tensor): + _, length, channel = input_tensor.shape + DWC1 = DepthwiseConv1D(kernel_size=1, padding='SAME')(input_tensor) + + # GAP + GAP = tf.keras.layers.GlobalAvgPool1D()(DWC1) + c1 = tf.keras.layers.Conv1D(filters=channel, kernel_size=1, padding='SAME')(GAP) + s1 = tf.nn.sigmoid(c1) + + # GMP + GMP = tf.keras.layers.GlobalMaxPool1D()(DWC1) + c2 = tf.keras.layers.Conv1D(filters=channel, kernel_size=1, padding='SAME')(GMP) + s3 = tf.nn.sigmoid(c2) + + output = tf.multiply(input_tensor, s1) + return output + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + +def get_MSE(data, label, new_model): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + + dims, = mse.shape + + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + + # plt.plot(max) + # plt.plot(mse) + # plt.plot(mean) + # # plt.plot(min) + # plt.show() + # + # + return mse, mean, max + # pass + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def shuffle(train_data, train_label1, train_label2, is_split: bool = False, split_size: float = 0.2): + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(train_data, + train_label1, + train_label2, + test_size=split_size, + shuffle=True, + random_state=100) + if is_split: + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + train_data = np.concatenate([train_data, test_data], axis=0) + train_label1 = np.concatenate([train_label1, test_label1], axis=0) + train_label2 = np.concatenate([train_label2, test_label2], axis=0) + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2 + pass + + +def split_test_data(healthy_data, healthy_label1, healthy_label2, unhealthy_data, unhealthy_label1, unhealthy_label2, + split_size: float = 0.2, shuffle: bool = True): + data = np.concatenate([healthy_data, unhealthy_data], axis=0) + label1 = np.concatenate([healthy_label1, unhealthy_label1], axis=0) + label2 = np.concatenate([healthy_label2, unhealthy_label2], axis=0) + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(data, + label1, + label2, + test_size=split_size, + shuffle=shuffle, + random_state=100) + + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + + pass + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def train_step_one(train_data, train_label1, train_label2): + model = Joint_Monitoring() + # # # # TODO 需要运行编译一次,才能打印model.summary() + # model.build(input_shape=(batch_size, filter_num, dims)) + # model.summary() + history_loss = [] + history_val_loss = [] + learning_rate = 1e-3 + for epoch in range(EPOCH): + + print() + print("EPOCH:", epoch, "/", EPOCH, ":") + train_data, train_label1, train_label2 = shuffle(train_data, train_label1, train_label2) + if epoch == 0: + train_data, train_label1, train_label2, val_data, val_label1, val_label2 = shuffle(train_data, train_label1, + train_label2, + is_split=True) + # print() + # print("EPOCH:", epoch, "/", EPOCH, ":") + # 用于让train知道,这是这个epoch中的第几次训练 + z = 0 + # 用于batch_size次再训练 + k = 1 + for data_1, label_1, label_2 in zip(train_data, train_label1, train_label2): + size, _, _ = train_data.shape + data_1 = tf.expand_dims(data_1, axis=0) + label_1 = tf.expand_dims(label_1, axis=0) + label_2 = tf.expand_dims(label_2, axis=0) + if batch_size != 1: + if k % batch_size == 1: + data = data_1 + label1 = label_1 + label2 = label_2 + else: + data = tf.concat([data, data_1], axis=0) + label1 = tf.concat([label1, label_1], axis=0) + label2 = tf.concat([label2, label_2], axis=0) + else: + data = data_1 + label1 = label_1 + label2 = label_2 + + if k % batch_size == 0: + # label = tf.expand_dims(label, axis=-1) + loss_value, accuracy_value = model.train(input_tensor=data, label1=label1, label2=label2, + learning_rate=learning_rate, + is_first_time=True) + print(z * batch_size, "/", size, ":===============>", "loss:", loss_value.numpy()) + k = 0 + z = z + 1 + k = k + 1 + val_loss, val_accuracy = model.get_val_loss(val_data=val_data, val_label1=val_label1, val_label2=val_label2, + is_first_time=True) + SaveBestModel(model=model, save_name=save_name, history_loss=history_val_loss, loss_value=val_loss.numpy()) + # SaveBestH5Model(model=model, save_name=save_name, history_loss=history_val_loss, loss_value=val_loss.numpy()) + history_val_loss.append(val_loss) + history_loss.append(loss_value.numpy()) + print('Training loss is :', loss_value.numpy()) + print('Validating loss is :', val_loss.numpy()) + if IsStopTraining(history_loss=history_val_loss, patience=7): + break + if Is_Reduce_learning_rate(history_loss=history_val_loss, patience=3): + if learning_rate >= 1e-4: + learning_rate = learning_rate * 0.1 + pass + + +def train_step_two(step_one_model, step_two_model, train_data, train_label1, train_label2): + # step_two_model = Joint_Monitoring() + # step_two_model.build(input_shape=(batch_size, time_stamp, feature_num)) + # step_two_model.summary() + history_loss = [] + history_val_loss = [] + history_accuracy = [] + learning_rate = 1e-3 + for epoch in range(EPOCH): + print() + print("EPOCH:", epoch, "/", EPOCH, ":") + train_data, train_label1, train_label2 = shuffle(train_data, train_label1, train_label2) + if epoch == 0: + train_data, train_label1, train_label2, val_data, val_label1, val_label2 = shuffle(train_data, train_label1, + train_label2, + is_split=True) + # print() + # print("EPOCH:", epoch, "/", EPOCH, ":") + # 用于让train知道,这是这个epoch中的第几次训练 + z = 0 + # 用于batch_size次再训练 + k = 1 + accuracy_num = 0 + for data_1, label_1, label_2 in zip(train_data, train_label1, train_label2): + size, _, _ = train_data.shape + data_1 = tf.expand_dims(data_1, axis=0) + label_1 = tf.expand_dims(label_1, axis=0) + label_2 = tf.expand_dims(label_2, axis=0) + if batch_size != 1: + if k % batch_size == 1: + data = data_1 + label1 = label_1 + label2 = label_2 + else: + data = tf.concat([data, data_1], axis=0) + label1 = tf.concat([label1, label_1], axis=0) + label2 = tf.concat([label2, label_2], axis=0) + else: + data = data_1 + label1 = label_1 + label2 = label_2 + + if k % batch_size == 0: + # label = tf.expand_dims(label, axis=-1) + output1, output2, output3, _ = step_one_model.call(inputs=data, is_first_time=True) + loss_value, accuracy_value = step_two_model.train(input_tensor=data, label1=label1, label2=label2, + learning_rate=learning_rate, + is_first_time=False, pred_3=output1, pred_4=output2, + pred_5=output3) + accuracy_num += accuracy_value + print(z * batch_size, "/", size, ":===============>", "loss:", loss_value.numpy(), "| accuracy:", + accuracy_num / ((z + 1) * batch_size)) + k = 0 + z = z + 1 + k = k + 1 + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=val_data, val_label1=val_label1, + val_label2=val_label2, + is_first_time=False, step_one_model=step_one_model) + SaveBestModelByAccuracy(model=step_two_model, save_name=save_step_two_name, history_accuracy=history_accuracy, + accuracy_value=val_accuracy) + history_val_loss.append(val_loss) + history_loss.append(loss_value.numpy()) + history_accuracy.append(val_accuracy) + print('Training loss is : {0} | Training accuracy is : {1}'.format(loss_value.numpy(), + accuracy_num / ((z + 1) * batch_size))) + print('Validating loss is : {0} | Validating accuracy is : {1}'.format(val_loss.numpy(), val_accuracy)) + if IsStopTraining(history_loss=history_val_loss, patience=7): + break + if Is_Reduce_learning_rate(history_loss=history_val_loss, patience=3): + if learning_rate >= 1e-4: + learning_rate = learning_rate * 0.1 + pass + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +def showResult(step_two_model: Joint_Monitoring, test_data, isPlot: bool = False): + # 获取模型的所有参数的个数 + # step_two_model.count_params() + total_result = [] + size, length, dims = test_data.shape + for epoch in range(0, size - batch_size + 1, batch_size): + each_test_data = test_data[epoch:epoch + batch_size, :, :] + _, _, _, output4 = step_two_model.call(each_test_data, is_first_time=False) + total_result.append(output4) + total_result = np.reshape(total_result, [total_result.__len__(), -1]) + total_result = np.reshape(total_result, [-1, ]) + if isPlot: + plt.scatter(list(range(total_result.shape[0])), total_result, c='black', s=10) + # 画出 y=1 这条水平线 + plt.axhline(0.5, c='red', label='Failure threshold') + # 箭头指向上面的水平线 + # plt.arrow(35000, 0.9, 33000, 0.75, head_width=0.02, head_length=0.1, shape="full", fc='red', ec='red', + # alpha=0.9, overhang=0.5) + # plt.text(35000, 0.9, "Truth Fault", fontsize=10, color='black', verticalalignment='top') + plt.axvline(test_data.shape[0] * 2 / 3, c='blue', ls='-.') + plt.xlabel("time") + plt.ylabel("confience") + plt.text(total_result.shape[0] * 4 / 5, 0.6, "Fault", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.text(total_result.shape[0] * 1 / 3, 0.4, "Norm", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.grid() + # plt.ylim(0, 1) + # plt.xlim(-50, 1300) + # plt.legend("", loc='upper left') + plt.show() + return total_result + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + #### TODO 第一步训练 + # 单次测试 + # train_step_one(train_data=train_data_healthy[:32, :, :], train_label1=train_label1_healthy[:32, :],train_label2=train_label2_healthy[:32, ]) + # train_step_one(train_data=train_data_healthy, train_label1=train_label1_healthy, train_label2=train_label2_healthy) + + # 导入第一步已经训练好的模型,一个继续训练,一个只输出结果 + # step_one_model = Joint_Monitoring() + # step_one_model.load_weights(save_name) + # + # step_two_model = Joint_Monitoring() + # step_two_model.load_weights(save_name) + + #### TODO 第二步训练 + ### healthy_data.shape: (300333,120,10) + ### unhealthy_data.shape: (16594,10) + healthy_size, _, _ = train_data_healthy.shape + unhealthy_size, _, _ = train_data_unhealthy.shape + # train_data, train_label1, train_label2, test_data, test_label1, test_label2 = split_test_data( + # healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :, :], + # healthy_label1=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + # healthy_label2=train_label2_healthy[healthy_size - 2 * unhealthy_size:, ], unhealthy_data=train_data_unhealthy, + # unhealthy_label1=train_label1_unhealthy, unhealthy_label2=train_label2_unhealthy) + # train_step_two(step_one_model=step_one_model, step_two_model=step_two_model, + # train_data=train_data, + # train_label1=train_label1, train_label2=np.expand_dims(train_label2, axis=-1)) + + ### TODO 测试测试集 + step_one_model = Joint_Monitoring() + step_one_model.load_weights(save_name) + step_two_model = Joint_Monitoring() + step_two_model.load_weights(save_step_two_name) + # test(step_one_model=step_one_model, step_two_model=step_two_model, test_data=test_data, test_label1=test_label1, + # test_label2=np.expand_dims(test_label2, axis=-1)) + + ###TODO 展示全部的结果 + all_data, _, _ = get_training_data_overlapping( + total_data[healthy_size - 2 * unhealthy_size:unhealthy_date, :], is_Healthy=True) + # all_data = np.concatenate([]) + # 单次测试 + # showResult(step_two_model, test_data=all_data[:32], isPlot=True) + showResult(step_two_model, test_data=all_data, isPlot=True) + + pass diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/RNet-C.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/RNet-C.py index aa036de..a0f8efc 100644 --- a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/RNet-C.py +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/RNet-C.py @@ -18,7 +18,7 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D -from model.Dynamic_channelAttention.Dynamic_channelAttention import DynamicChannelAttention +from model.ChannelAttention.Dynamic_channelAttention import DynamicChannelAttention from condition_monitoring.data_deal import loadData_daban as loadData from model.Joint_Monitoring.compare.RNet_C import Joint_Monitoring diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/RNet.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/RNet.py index 93d7827..82e89da 100644 --- a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/RNet.py +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/RNet.py @@ -15,7 +15,8 @@ import numpy as np import pandas as pd import matplotlib.pyplot as plt from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D -from model.Dynamic_channelAttention.Dynamic_channelAttention import DynamicChannelAttention +import time + from condition_monitoring.data_deal import loadData_daban as loadData from model.Joint_Monitoring.compare.RNet import Joint_Monitoring @@ -591,10 +592,21 @@ if __name__ == '__main__': # 导入第一步已经训练好的模型,一个继续训练,一个只输出结果 step_one_model = Joint_Monitoring() step_one_model.load_weights(save_name) + + # step_one_model.build(input_shape=(30,120,10)) + # step_one_model.summary() # # step_two_model = Joint_Monitoring() # step_two_model.load_weights(save_name) + start = time.time() + # 中间写上代码块 + + step_one_model.predict(train_data_healthy, batch_size=32) + end = time.time() + print("data_size:", train_data_healthy.shape) + print('Running time: %s Seconds' % (end - start)) + # #### TODO 计算MSE healthy_size, _, _ = train_data_healthy.shape unhealthy_size, _, _ = train_data_unhealthy.shape diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/resnet_18.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/resnet_18.py index ca3e9f2..1f37482 100644 --- a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/resnet_18.py +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/self_try/compare/resnet_18.py @@ -8,7 +8,7 @@ import seaborn as sns from sklearn.model_selection import train_test_split from condition_monitoring.data_deal import loadData_daban as loadData from keras.callbacks import EarlyStopping - +import time '''超参数设置''' time_stamp = 120 feature_num = 10 @@ -68,22 +68,7 @@ unhealthy_patience = 5 font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 10} # 设置坐标标签的字体大小,字体 -# train_data = np.load("../../../data/train_data.npy") -# train_label = np.load("../../../data/train_label.npy") -# test_data = np.load("../../../data/test_data.npy") -# test_label = np.load("../../../data/test_label.npy") - -# CIFAR_100_data = tf.keras.datasets.cifar100 -# (train_data, train_label), (test_data, test_label) = CIFAR_100_data.load_data() -# train_data=np.array(train_data) -# train_label=np.array(train_label) -# print(train_data.shape) -# print(train_label.shape) -# print(train_data) -# print(test_data) -# -# # 重叠采样 def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): rows, cols = data.shape @@ -328,6 +313,14 @@ if __name__ == '__main__': # model.save("./model/ResNet.h5") model = tf.keras.models.load_model("model/ResNet_banda/ResNet_banda_epoch10_9884.h5") + start = time.time() + # 中间写上代码块 + + model.predict(train_data_healthy, batch_size=32) + end = time.time() + print("data_size:", train_data_healthy.shape) + print('Running time: %s Seconds' % (end - start)) + # 结果展示 healthy_size, _, _ = train_data_healthy.shape diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/Cnn-gru.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/Cnn-gru.py new file mode 100644 index 0000000..47435de --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/Cnn-gru.py @@ -0,0 +1,496 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + + +''' +@Author : dingjiawen +@Date : 2022/10/11 18:52 +@Usage : 对比实验,与JointNet相同深度,进行预测 +@Desc : +''' + + +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +from condition_monitoring.data_deal import loadData_daban as loadData +from model.Joint_Monitoring.Joint_Monitoring3 import Joint_Monitoring + +from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model +from keras.callbacks import EarlyStopping +import random +import time +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 32 +learning_rate = 0.001 +EPOCH = 101 +model_name = "DCConv" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "./trianed/{0}_{1}_{2}.h5".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_step_two_name = "../hard_model/two_weight/{0}_timestamp{1}_feature{2}_weight_epoch14/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_mse_name = "./mse/DCConv/banda/mse.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_max_name = "./mse/DCConv/banda/max.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +# save_name = "../model/joint/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +# save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +'''文件名''' +'''文件名''' +file_name = "G:\data\SCADA数据\SCADA_已处理_粤水电达坂城2020.1月-5月\风机15.csv" + +''' +文件说明:jb4q_8_delete_total_zero.csv是删除了只删除了全是0的列的文件 +文件从0:415548行均是正常值(2019/7.30 00:00:00 - 2019/9/18 11:14:00) +从415549:432153行均是异常值(2019/9/18 11:21:01 - 2021/1/18 00:00:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 96748 +# 最后异常的时间点 +unhealthy_date = 107116 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + + + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def shuffle(train_data, train_label1, train_label2, is_split: bool = False, split_size: float = 0.2): + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(train_data, + train_label1, + train_label2, + test_size=split_size, + shuffle=True, + random_state=100) + if is_split: + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + train_data = np.concatenate([train_data, test_data], axis=0) + train_label1 = np.concatenate([train_label1, test_label1], axis=0) + train_label2 = np.concatenate([train_label2, test_label2], axis=0) + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2 + pass + + +def split_test_data(healthy_data, healthy_label1, healthy_label2, unhealthy_data, unhealthy_label1, unhealthy_label2, + split_size: float = 0.2, shuffle: bool = True): + data = np.concatenate([healthy_data, unhealthy_data], axis=0) + label1 = np.concatenate([healthy_label1, unhealthy_label1], axis=0) + label2 = np.concatenate([healthy_label2, unhealthy_label2], axis=0) + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(data, + label1, + label2, + test_size=split_size, + shuffle=shuffle, + random_state=100) + + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + + pass + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +def showResult(step_two_model: Joint_Monitoring, test_data, isPlot: bool = False): + # 获取模型的所有参数的个数 + # step_two_model.count_params() + total_result = [] + size, length, dims = test_data.shape + for epoch in range(0, size - batch_size + 1, batch_size): + each_test_data = test_data[epoch:epoch + batch_size, :, :] + _, _, _, output4 = step_two_model.call(each_test_data, is_first_time=False) + total_result.append(output4) + total_result = np.reshape(total_result, [total_result.__len__(), -1]) + total_result = np.reshape(total_result, [-1, ]) + if isPlot: + plt.scatter(list(range(total_result.shape[0])), total_result, c='black', s=10) + # 画出 y=1 这条水平线 + plt.axhline(0.5, c='red', label='Failure threshold') + # 箭头指向上面的水平线 + # plt.arrow(35000, 0.9, 33000, 0.75, head_width=0.02, head_length=0.1, shape="full", fc='red', ec='red', + # alpha=0.9, overhang=0.5) + # plt.text(35000, 0.9, "Truth Fault", fontsize=10, color='black', verticalalignment='top') + plt.axvline(test_data.shape[0] * 2 / 3, c='blue', ls='-.') + plt.xlabel("time") + plt.ylabel("confience") + plt.text(total_result.shape[0] * 4 / 5, 0.6, "Fault", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.text(total_result.shape[0] * 1 / 3, 0.4, "Norm", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.grid() + # plt.ylim(0, 1) + # plt.xlim(-50, 1300) + # plt.legend("", loc='upper left') + plt.show() + return total_result + + +def DCConv_Model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + input = tf.cast(input, tf.float32) + + LSTM = tf.keras.layers.Conv1D(10, 3)(input) + LSTM = tf.keras.layers.Conv1D(20, 3)(LSTM) + LSTM = tf.keras.layers.GRU(20, return_sequences=True)(LSTM) + LSTM = tf.keras.layers.GRU(40, return_sequences=True)(LSTM) + LSTM = tf.keras.layers.GRU(80, return_sequences=False)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=64)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=128)(LSTM) + # LSTM = tf.keras.layers.Conv1D(40, 3, padding="causal",dilation_rate=2)(LSTM) + + # LSTM = LSTM[:, -1, :] + # bn = tf.keras.layers.BatchNormalization()(LSTM) + + # d1 = tf.keras.layers.Dense(20)(LSTM) + # bn = tf.keras.layers.BatchNormalization()(d1) + + output = tf.keras.layers.Dense(128, name='output1')(LSTM) + output = tf.keras.layers.Dense(10, name='output')(output) + model = tf.keras.Model(inputs=input, outputs=output) + return model + pass + + +def get_MSE(data, label, new_model, isStandard: bool = True, isPlot: bool = True, predictI: int = 1): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + if isStandard: + dims, = mse.shape + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + print("max:", max) + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + if isPlot: + plt.figure(random.randint(1,9)) + plt.plot(max) + plt.plot(mse) + plt.plot(mean) + # plt.plot(min) + plt.show() + else: + if isPlot: + plt.figure(random.randint(1, 9)) + plt.plot(mse) + # plt.plot(min) + plt.show() + return mse + + return mse, mean, max + # pass + + +# healthy_data是健康数据,用于确定阈值,all_data是完整的数据,用于模型出结果 +def getResult(model: tf.keras.Model, healthy_data, healthy_label, unhealthy_data, unhealthy_label, isPlot: bool = False, + isSave: bool = True, predictI: int = 1): + # TODO 计算MSE确定阈值 + # TODO 计算MSE确定阈值 + + mse, mean, max = get_MSE(healthy_data, healthy_label, model) + + # 误报率的计算 + total, = mse.shape + faultNum = 0 + faultList = [] + faultNum = mse[mse[:] > max[0]].__len__() + # for i in range(total): + # if (mse[i] > max[i]): + # faultNum += 1 + # faultList.append(mse[i]) + + fault_rate = faultNum / total + print("误报率:", fault_rate) + + # 漏报率计算 + missNum = 0 + mse1 = get_MSE(unhealthy_data, unhealthy_label, model, isStandard=False) + + total_mse = np.concatenate([mse, mse1], axis=0) + total_max = np.broadcast_to(max[0], shape=[total_mse.shape[0], ]) + # min = np.broadcast_to(min,shape=[dims,]) + total_mean = np.broadcast_to(mean[0], shape=[total_mse.shape[0], ]) + if isSave: + save_mse_name1 = save_mse_name + save_max_name1 = save_max_name + + np.savetxt(save_mse_name1, total_mse, delimiter=',') + np.savetxt(save_max_name1, total_max, delimiter=',') + + all, = mse1.shape + + + missNum = mse1[mse1[:] < max[0]].__len__() + + + print("all:", all) + miss_rate = missNum / all + print("漏报率:", miss_rate) + + + + plt.figure(random.randint(1, 100)) + plt.plot(total_max) + plt.plot(total_mse) + plt.plot(total_mean) + # plt.plot(min) + plt.show() + pass + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + #### TODO 第一步训练 + # 单次测试 + model = DCConv_Model() + + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=3, min_lr=0.001) + + model.compile(optimizer=tf.optimizers.Adam(), loss=tf.losses.mse) + model.build(input_shape=(batch_size, time_stamp, feature_num)) + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=3, mode='min', verbose=1) + + # history = model.fit(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], + # train_label1_healthy[:train_label1_healthy.shape[0] // 7, ], epochs=EPOCH, + # batch_size=batch_size * 10, validation_split=0.2, shuffle=True, verbose=1, + # callbacks=[checkpoint, lr_scheduler, early_stop]) + + ## TODO testing + # # test_data, test_label = get_training_data(total_data[:healthy_date, :]) + # model = tf.keras.models.load_model(save_name) + # # mse, mean, max = get_MSE(test_data, test_label, new_model=newModel) + # + # start = time.time() + # # 中间写上代码块 + # + # model.predict(train_data_healthy, batch_size=32) + # end = time.time() + # print("data_size:", train_data_healthy.shape) + # print('Running time: %s Seconds' % (end - start)) + # + healthy_size, _, _ = train_data_healthy.shape + unhealthy_size, _, _ = train_data_unhealthy.shape + all_data, _, _ = get_training_data_overlapping( + total_data[healthy_size - 2 * unhealthy_size:unhealthy_date, :], is_Healthy=True) + + newModel = tf.keras.models.load_model(save_name) + # 单次测试 + # getResult(newModel, + # healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, + # :], + # healthy_label=train_label1_healthy[ + # healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, :], + # unhealthy_data=train_data_unhealthy[:200, :], unhealthy_label=train_label1_unhealthy[:200, :],isSave=True) + getResult(newModel, healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + healthy_label=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + unhealthy_data=train_data_unhealthy, unhealthy_label=train_label1_unhealthy,isSave=False) + # mse, mean, max = get_MSE(train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + # train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], new_model=newModel) + pass diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/Conv.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/Conv.py new file mode 100644 index 0000000..4fa1d19 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/Conv.py @@ -0,0 +1,497 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + + +''' +@Author : dingjiawen +@Date : 2022/10/11 18:52 +@Usage : 对比实验,与JointNet相同深度,进行预测 +@Desc : +''' + + +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +from condition_monitoring.data_deal import loadData_daban as loadData +from model.Joint_Monitoring.Joint_Monitoring3 import Joint_Monitoring + +from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model +from keras.callbacks import EarlyStopping +import random +import time +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 32 +learning_rate = 0.001 +EPOCH = 101 +model_name = "DCConv" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "./trianed/{0}_{1}_{2}.h5".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_step_two_name = "../hard_model/two_weight/{0}_timestamp{1}_feature{2}_weight_epoch14/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_mse_name = "E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse/CNN/banda/mse.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_max_name = "E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\self_try\compare\mse/CNN/banda/max.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +# save_name = "../model/joint/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +# save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +'''文件名''' +'''文件名''' +'''文件名''' +file_name = "G:\data\SCADA数据\jb4q_8_delete_all_zero.csv" + +''' +文件说明:jb4q_8_delete_all_zero.csv是删除了除异常以外的所有0值的文件 +文件从0:300454行均是正常值(2019/7.30 00:00:00 - 2019/9/18 11:21:00) +从300455:317052行均是异常值(2019/9/18 11:21:01 - 2019/9/29 23:59:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 300454 +# 最后异常的时间点 +unhealthy_date = 317052 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + + + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def shuffle(train_data, train_label1, train_label2, is_split: bool = False, split_size: float = 0.2): + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(train_data, + train_label1, + train_label2, + test_size=split_size, + shuffle=True, + random_state=100) + if is_split: + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + train_data = np.concatenate([train_data, test_data], axis=0) + train_label1 = np.concatenate([train_label1, test_label1], axis=0) + train_label2 = np.concatenate([train_label2, test_label2], axis=0) + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2 + pass + + +def split_test_data(healthy_data, healthy_label1, healthy_label2, unhealthy_data, unhealthy_label1, unhealthy_label2, + split_size: float = 0.2, shuffle: bool = True): + data = np.concatenate([healthy_data, unhealthy_data], axis=0) + label1 = np.concatenate([healthy_label1, unhealthy_label1], axis=0) + label2 = np.concatenate([healthy_label2, unhealthy_label2], axis=0) + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(data, + label1, + label2, + test_size=split_size, + shuffle=shuffle, + random_state=100) + + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + + pass + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +def showResult(step_two_model: Joint_Monitoring, test_data, isPlot: bool = False): + # 获取模型的所有参数的个数 + # step_two_model.count_params() + total_result = [] + size, length, dims = test_data.shape + for epoch in range(0, size - batch_size + 1, batch_size): + each_test_data = test_data[epoch:epoch + batch_size, :, :] + _, _, _, output4 = step_two_model.call(each_test_data, is_first_time=False) + total_result.append(output4) + total_result = np.reshape(total_result, [total_result.__len__(), -1]) + total_result = np.reshape(total_result, [-1, ]) + if isPlot: + plt.scatter(list(range(total_result.shape[0])), total_result, c='black', s=10) + # 画出 y=1 这条水平线 + plt.axhline(0.5, c='red', label='Failure threshold') + # 箭头指向上面的水平线 + # plt.arrow(35000, 0.9, 33000, 0.75, head_width=0.02, head_length=0.1, shape="full", fc='red', ec='red', + # alpha=0.9, overhang=0.5) + # plt.text(35000, 0.9, "Truth Fault", fontsize=10, color='black', verticalalignment='top') + plt.axvline(test_data.shape[0] * 2 / 3, c='blue', ls='-.') + plt.xlabel("time") + plt.ylabel("confience") + plt.text(total_result.shape[0] * 4 / 5, 0.6, "Fault", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.text(total_result.shape[0] * 1 / 3, 0.4, "Norm", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.grid() + # plt.ylim(0, 1) + # plt.xlim(-50, 1300) + # plt.legend("", loc='upper left') + plt.show() + return total_result + + +def DCConv_Model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + input = tf.cast(input, tf.float32) + + LSTM = tf.keras.layers.Conv1D(10, 3)(input) + LSTM = tf.keras.layers.Conv1D(20, 3)(LSTM) + LSTM = tf.keras.layers.Conv1D(20, 3)(LSTM) + LSTM = tf.keras.layers.Conv1D(40, 3)(LSTM) + LSTM = tf.keras.layers.Conv1D(80, 3)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=64)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=128)(LSTM) + # LSTM = tf.keras.layers.Conv1D(40, 3, padding="causal",dilation_rate=2)(LSTM) + + LSTM = LSTM[:, -1, :] + # bn = tf.keras.layers.BatchNormalization()(LSTM) + + # d1 = tf.keras.layers.Dense(20)(LSTM) + # bn = tf.keras.layers.BatchNormalization()(d1) + + output = tf.keras.layers.Dense(128, name='output1')(LSTM) + output = tf.keras.layers.Dense(10, name='output')(output) + model = tf.keras.Model(inputs=input, outputs=output) + return model + pass + + +def get_MSE(data, label, new_model, isStandard: bool = True, isPlot: bool = True, predictI: int = 1): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + if isStandard: + dims, = mse.shape + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + print("max:", max) + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + if isPlot: + plt.figure(random.randint(1,9)) + plt.plot(max) + plt.plot(mse) + plt.plot(mean) + # plt.plot(min) + plt.show() + else: + if isPlot: + plt.figure(random.randint(1, 9)) + plt.plot(mse) + # plt.plot(min) + plt.show() + return mse + + return mse, mean, max + # pass + + +# healthy_data是健康数据,用于确定阈值,all_data是完整的数据,用于模型出结果 +def getResult(model: tf.keras.Model, healthy_data, healthy_label, unhealthy_data, unhealthy_label, isPlot: bool = False, + isSave: bool = True, predictI: int = 1): + # TODO 计算MSE确定阈值 + # TODO 计算MSE确定阈值 + + mse, mean, max = get_MSE(healthy_data, healthy_label, model) + + # 误报率的计算 + total, = mse.shape + faultNum = 0 + faultList = [] + faultNum = mse[mse[:] > max[0]].__len__() + # for i in range(total): + # if (mse[i] > max[i]): + # faultNum += 1 + # faultList.append(mse[i]) + + fault_rate = faultNum / total + print("误报率:", fault_rate) + + # 漏报率计算 + missNum = 0 + mse1 = get_MSE(unhealthy_data, unhealthy_label, model, isStandard=False) + + total_mse = np.concatenate([mse, mse1], axis=0) + total_max = np.broadcast_to(max[0], shape=[total_mse.shape[0], ]) + # min = np.broadcast_to(min,shape=[dims,]) + total_mean = np.broadcast_to(mean[0], shape=[total_mse.shape[0], ]) + if isSave: + save_mse_name1 = save_mse_name + save_max_name1 = save_max_name + + np.savetxt(save_mse_name1, total_mse, delimiter=',') + np.savetxt(save_max_name1, total_max, delimiter=',') + + all, = mse1.shape + + + missNum = mse1[mse1[:] < max[0]].__len__() + + + print("all:", all) + miss_rate = missNum / all + print("漏报率:", miss_rate) + + + + plt.figure(random.randint(1, 100)) + plt.plot(total_max) + plt.plot(total_mse) + plt.plot(total_mean) + # plt.plot(min) + plt.show() + pass + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + #### TODO 第一步训练 + # 单次测试 + model = DCConv_Model() + + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=3, min_lr=0.001) + + model.compile(optimizer=tf.optimizers.Adam(), loss=tf.losses.mse) + model.build(input_shape=(batch_size, time_stamp, feature_num)) + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=3, mode='min', verbose=1) + + history = model.fit(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], + train_label1_healthy[:train_label1_healthy.shape[0] // 7, ], epochs=EPOCH, + batch_size=batch_size * 10, validation_split=0.2, shuffle=True, verbose=1, + callbacks=[checkpoint, lr_scheduler, early_stop]) + + ## TODO testing + # test_data, test_label = get_training_data(total_data[:healthy_date, :]) + # newModel = tf.keras.models.load_model(save_name) + # mse, mean, max = get_MSE(test_data, test_label, new_model=newModel) + + start = time.time() + # 中间写上代码块 + + model.predict(train_data_healthy, batch_size=32) + end = time.time() + print("data_size:", train_data_healthy.shape) + print('Running time: %s Seconds' % (end - start)) + + healthy_size, _, _ = train_data_healthy.shape + unhealthy_size, _, _ = train_data_unhealthy.shape + all_data, _, _ = get_training_data_overlapping( + total_data[healthy_size - 2 * unhealthy_size:unhealthy_date, :], is_Healthy=True) + + newModel = tf.keras.models.load_model(save_name) + # 单次测试 + # getResult(newModel, + # healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, + # :], + # healthy_label=train_label1_healthy[ + # healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, :], + # unhealthy_data=train_data_unhealthy[:200, :], unhealthy_label=train_label1_unhealthy[:200, :],isSave=True) + getResult(newModel, healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + healthy_label=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + unhealthy_data=train_data_unhealthy, unhealthy_label=train_label1_unhealthy,isSave=True) + # mse, mean, max = get_MSE(train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + # train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], new_model=newModel) + pass diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/DCConv.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/DCConv.py new file mode 100644 index 0000000..58d1b9c --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/DCConv.py @@ -0,0 +1,496 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + + +''' +@Author : dingjiawen +@Date : 2022/10/11 18:52 +@Usage : 对比实验,与JointNet相同深度,进行预测 +@Desc : +''' + + +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +from condition_monitoring.data_deal import loadData_daban as loadData +from model.Joint_Monitoring.Joint_Monitoring3 import Joint_Monitoring + +from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model +from keras.callbacks import EarlyStopping +import random +import time +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 32 +learning_rate = 0.001 +EPOCH = 101 +model_name = "DCConv" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "./trianed/{0}_{1}_{2}.h5".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_step_two_name = "../hard_model/two_weight/{0}_timestamp{1}_feature{2}_weight_epoch14/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_mse_name = "./mse/DCConv/banda/mse.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_max_name = "./mse/DCConv/banda/max.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +# save_name = "../model/joint/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +# save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +'''文件名''' +'''文件名''' +file_name = "G:\data\SCADA数据\SCADA_已处理_粤水电达坂城2020.1月-5月\风机15.csv" + +''' +文件说明:jb4q_8_delete_total_zero.csv是删除了只删除了全是0的列的文件 +文件从0:415548行均是正常值(2019/7.30 00:00:00 - 2019/9/18 11:14:00) +从415549:432153行均是异常值(2019/9/18 11:21:01 - 2021/1/18 00:00:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 96748 +# 最后异常的时间点 +unhealthy_date = 107116 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + + + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def shuffle(train_data, train_label1, train_label2, is_split: bool = False, split_size: float = 0.2): + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(train_data, + train_label1, + train_label2, + test_size=split_size, + shuffle=True, + random_state=100) + if is_split: + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + train_data = np.concatenate([train_data, test_data], axis=0) + train_label1 = np.concatenate([train_label1, test_label1], axis=0) + train_label2 = np.concatenate([train_label2, test_label2], axis=0) + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2 + pass + + +def split_test_data(healthy_data, healthy_label1, healthy_label2, unhealthy_data, unhealthy_label1, unhealthy_label2, + split_size: float = 0.2, shuffle: bool = True): + data = np.concatenate([healthy_data, unhealthy_data], axis=0) + label1 = np.concatenate([healthy_label1, unhealthy_label1], axis=0) + label2 = np.concatenate([healthy_label2, unhealthy_label2], axis=0) + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(data, + label1, + label2, + test_size=split_size, + shuffle=shuffle, + random_state=100) + + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + + pass + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +def showResult(step_two_model: Joint_Monitoring, test_data, isPlot: bool = False): + # 获取模型的所有参数的个数 + # step_two_model.count_params() + total_result = [] + size, length, dims = test_data.shape + for epoch in range(0, size - batch_size + 1, batch_size): + each_test_data = test_data[epoch:epoch + batch_size, :, :] + _, _, _, output4 = step_two_model.call(each_test_data, is_first_time=False) + total_result.append(output4) + total_result = np.reshape(total_result, [total_result.__len__(), -1]) + total_result = np.reshape(total_result, [-1, ]) + if isPlot: + plt.scatter(list(range(total_result.shape[0])), total_result, c='black', s=10) + # 画出 y=1 这条水平线 + plt.axhline(0.5, c='red', label='Failure threshold') + # 箭头指向上面的水平线 + # plt.arrow(35000, 0.9, 33000, 0.75, head_width=0.02, head_length=0.1, shape="full", fc='red', ec='red', + # alpha=0.9, overhang=0.5) + # plt.text(35000, 0.9, "Truth Fault", fontsize=10, color='black', verticalalignment='top') + plt.axvline(test_data.shape[0] * 2 / 3, c='blue', ls='-.') + plt.xlabel("time") + plt.ylabel("confience") + plt.text(total_result.shape[0] * 4 / 5, 0.6, "Fault", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.text(total_result.shape[0] * 1 / 3, 0.4, "Norm", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.grid() + # plt.ylim(0, 1) + # plt.xlim(-50, 1300) + # plt.legend("", loc='upper left') + plt.show() + return total_result + + +def DCConv_Model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + input = tf.cast(input, tf.float32) + + LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=2)(input) + LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=4)(LSTM) + LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=8)(LSTM) + LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=16)(LSTM) + LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=32)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=64)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=128)(LSTM) + # LSTM = tf.keras.layers.Conv1D(40, 3, padding="causal",dilation_rate=2)(LSTM) + + LSTM = LSTM[:, -1, :] + # bn = tf.keras.layers.BatchNormalization()(LSTM) + + # d1 = tf.keras.layers.Dense(20)(LSTM) + # bn = tf.keras.layers.BatchNormalization()(d1) + + output = tf.keras.layers.Dense(128, name='output1')(LSTM) + output = tf.keras.layers.Dense(10, name='output')(output) + model = tf.keras.Model(inputs=input, outputs=output) + return model + pass + + +def get_MSE(data, label, new_model, isStandard: bool = True, isPlot: bool = True, predictI: int = 1): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + if isStandard: + dims, = mse.shape + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + print("max:", max) + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + if isPlot: + plt.figure(random.randint(1,9)) + plt.plot(max) + plt.plot(mse) + plt.plot(mean) + # plt.plot(min) + plt.show() + else: + if isPlot: + plt.figure(random.randint(1, 9)) + plt.plot(mse) + # plt.plot(min) + plt.show() + return mse + + return mse, mean, max + # pass + + +# healthy_data是健康数据,用于确定阈值,all_data是完整的数据,用于模型出结果 +def getResult(model: tf.keras.Model, healthy_data, healthy_label, unhealthy_data, unhealthy_label, isPlot: bool = False, + isSave: bool = True, predictI: int = 1): + # TODO 计算MSE确定阈值 + # TODO 计算MSE确定阈值 + + mse, mean, max = get_MSE(healthy_data, healthy_label, model) + + # 误报率的计算 + total, = mse.shape + faultNum = 0 + faultList = [] + faultNum = mse[mse[:] > max[0]].__len__() + # for i in range(total): + # if (mse[i] > max[i]): + # faultNum += 1 + # faultList.append(mse[i]) + + fault_rate = faultNum / total + print("误报率:", fault_rate) + + # 漏报率计算 + missNum = 0 + mse1 = get_MSE(unhealthy_data, unhealthy_label, model, isStandard=False) + + total_mse = np.concatenate([mse, mse1], axis=0) + total_max = np.broadcast_to(max[0], shape=[total_mse.shape[0], ]) + # min = np.broadcast_to(min,shape=[dims,]) + total_mean = np.broadcast_to(mean[0], shape=[total_mse.shape[0], ]) + if isSave: + save_mse_name1 = save_mse_name + save_max_name1 = save_max_name + + np.savetxt(save_mse_name1, total_mse, delimiter=',') + np.savetxt(save_max_name1, total_max, delimiter=',') + + all, = mse1.shape + + + missNum = mse1[mse1[:] < max[0]].__len__() + + + print("all:", all) + miss_rate = missNum / all + print("漏报率:", miss_rate) + + + + plt.figure(random.randint(1, 100)) + plt.plot(total_max) + plt.plot(total_mse) + plt.plot(total_mean) + # plt.plot(min) + plt.show() + pass + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + #### TODO 第一步训练 + # 单次测试 + model = DCConv_Model() + + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=3, min_lr=0.001) + + model.compile(optimizer=tf.optimizers.Adam(), loss=tf.losses.mse) + model.build(input_shape=(batch_size, time_stamp, feature_num)) + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=3, mode='min', verbose=1) + + history = model.fit(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], + train_label1_healthy[:train_label1_healthy.shape[0] // 7, ], epochs=EPOCH, + batch_size=batch_size * 10, validation_split=0.2, shuffle=True, verbose=1, + callbacks=[checkpoint, lr_scheduler, early_stop]) + + ## TODO testing + # test_data, test_label = get_training_data(total_data[:healthy_date, :]) + # newModel = tf.keras.models.load_model(save_name) + # mse, mean, max = get_MSE(test_data, test_label, new_model=newModel) + + start = time.time() + # 中间写上代码块 + + model.predict(train_data_healthy, batch_size=32) + end = time.time() + print("data_size:", train_data_healthy.shape) + print('Running time: %s Seconds' % (end - start)) + + healthy_size, _, _ = train_data_healthy.shape + unhealthy_size, _, _ = train_data_unhealthy.shape + all_data, _, _ = get_training_data_overlapping( + total_data[healthy_size - 2 * unhealthy_size:unhealthy_date, :], is_Healthy=True) + + newModel = tf.keras.models.load_model(save_name) + # 单次测试 + # getResult(newModel, + # healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, + # :], + # healthy_label=train_label1_healthy[ + # healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, :], + # unhealthy_data=train_data_unhealthy[:200, :], unhealthy_label=train_label1_unhealthy[:200, :],isSave=True) + getResult(newModel, healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + healthy_label=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + unhealthy_data=train_data_unhealthy, unhealthy_label=train_label1_unhealthy,isSave=True) + # mse, mean, max = get_MSE(train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + # train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], new_model=newModel) + pass diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/GRU.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/GRU.py new file mode 100644 index 0000000..256d277 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/GRU.py @@ -0,0 +1,493 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + + +''' +@Author : dingjiawen +@Date : 2022/10/11 18:52 +@Usage : 对比实验,与JointNet相同深度,进行预测 +@Desc : +''' + + +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +from condition_monitoring.data_deal import loadData_daban as loadData +from model.Joint_Monitoring.Joint_Monitoring3 import Joint_Monitoring + +from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model +from keras.callbacks import EarlyStopping +import random +import time +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 32 +learning_rate = 0.001 +EPOCH = 101 +model_name = "DCConv" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "./trianed/{0}_{1}_{2}.h5".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_step_two_name = "../hard_model/two_weight/{0}_timestamp{1}_feature{2}_weight_epoch14/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_mse_name = "./mse/DCConv/banda/mse.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_max_name = "./mse/DCConv/banda/max.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +# save_name = "../model/joint/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +# save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +'''文件名''' +'''文件名''' +file_name = "G:\data\SCADA数据\SCADA_已处理_粤水电达坂城2020.1月-5月\风机15.csv" + +''' +文件说明:jb4q_8_delete_total_zero.csv是删除了只删除了全是0的列的文件 +文件从0:415548行均是正常值(2019/7.30 00:00:00 - 2019/9/18 11:14:00) +从415549:432153行均是异常值(2019/9/18 11:21:01 - 2021/1/18 00:00:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 96748 +# 最后异常的时间点 +unhealthy_date = 107116 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + + + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def shuffle(train_data, train_label1, train_label2, is_split: bool = False, split_size: float = 0.2): + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(train_data, + train_label1, + train_label2, + test_size=split_size, + shuffle=True, + random_state=100) + if is_split: + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + train_data = np.concatenate([train_data, test_data], axis=0) + train_label1 = np.concatenate([train_label1, test_label1], axis=0) + train_label2 = np.concatenate([train_label2, test_label2], axis=0) + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2 + pass + + +def split_test_data(healthy_data, healthy_label1, healthy_label2, unhealthy_data, unhealthy_label1, unhealthy_label2, + split_size: float = 0.2, shuffle: bool = True): + data = np.concatenate([healthy_data, unhealthy_data], axis=0) + label1 = np.concatenate([healthy_label1, unhealthy_label1], axis=0) + label2 = np.concatenate([healthy_label2, unhealthy_label2], axis=0) + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(data, + label1, + label2, + test_size=split_size, + shuffle=shuffle, + random_state=100) + + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + + pass + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +def showResult(step_two_model: Joint_Monitoring, test_data, isPlot: bool = False): + # 获取模型的所有参数的个数 + # step_two_model.count_params() + total_result = [] + size, length, dims = test_data.shape + for epoch in range(0, size - batch_size + 1, batch_size): + each_test_data = test_data[epoch:epoch + batch_size, :, :] + _, _, _, output4 = step_two_model.call(each_test_data, is_first_time=False) + total_result.append(output4) + total_result = np.reshape(total_result, [total_result.__len__(), -1]) + total_result = np.reshape(total_result, [-1, ]) + if isPlot: + plt.scatter(list(range(total_result.shape[0])), total_result, c='black', s=10) + # 画出 y=1 这条水平线 + plt.axhline(0.5, c='red', label='Failure threshold') + # 箭头指向上面的水平线 + # plt.arrow(35000, 0.9, 33000, 0.75, head_width=0.02, head_length=0.1, shape="full", fc='red', ec='red', + # alpha=0.9, overhang=0.5) + # plt.text(35000, 0.9, "Truth Fault", fontsize=10, color='black', verticalalignment='top') + plt.axvline(test_data.shape[0] * 2 / 3, c='blue', ls='-.') + plt.xlabel("time") + plt.ylabel("confience") + plt.text(total_result.shape[0] * 4 / 5, 0.6, "Fault", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.text(total_result.shape[0] * 1 / 3, 0.4, "Norm", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.grid() + # plt.ylim(0, 1) + # plt.xlim(-50, 1300) + # plt.legend("", loc='upper left') + plt.show() + return total_result + + +def DCConv_Model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + input = tf.cast(input, tf.float32) + + LSTM = tf.keras.layers.GRU(10, return_sequences=True)(input) + LSTM = tf.keras.layers.GRU(20, return_sequences=True)(LSTM) + LSTM = tf.keras.layers.GRU(20, return_sequences=True)(LSTM) + LSTM = tf.keras.layers.GRU(40, return_sequences=True)(LSTM) + LSTM = tf.keras.layers.GRU(80, return_sequences=False)(LSTM) + + # LSTM = LSTM[:, -1, :] + # bn = tf.keras.layers.BatchNormalization()(LSTM) + + # d1 = tf.keras.layers.Dense(20)(LSTM) + # bn = tf.keras.layers.BatchNormalization()(d1) + + output = tf.keras.layers.Dense(128, name='output1')(LSTM) + output = tf.keras.layers.Dense(10, name='output')(output) + model = tf.keras.Model(inputs=input, outputs=output) + return model + pass + + +def get_MSE(data, label, new_model, isStandard: bool = True, isPlot: bool = True, predictI: int = 1): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + if isStandard: + dims, = mse.shape + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + print("max:", max) + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + if isPlot: + plt.figure(random.randint(1,9)) + plt.plot(max) + plt.plot(mse) + plt.plot(mean) + # plt.plot(min) + plt.show() + else: + if isPlot: + plt.figure(random.randint(1, 9)) + plt.plot(mse) + # plt.plot(min) + plt.show() + return mse + + return mse, mean, max + # pass + + +# healthy_data是健康数据,用于确定阈值,all_data是完整的数据,用于模型出结果 +def getResult(model: tf.keras.Model, healthy_data, healthy_label, unhealthy_data, unhealthy_label, isPlot: bool = False, + isSave: bool = True, predictI: int = 1): + # TODO 计算MSE确定阈值 + # TODO 计算MSE确定阈值 + + mse, mean, max = get_MSE(healthy_data, healthy_label, model) + + # 误报率的计算 + total, = mse.shape + faultNum = 0 + faultList = [] + faultNum = mse[mse[:] > max[0]].__len__() + # for i in range(total): + # if (mse[i] > max[i]): + # faultNum += 1 + # faultList.append(mse[i]) + + fault_rate = faultNum / total + print("误报率:", fault_rate) + + # 漏报率计算 + missNum = 0 + mse1 = get_MSE(unhealthy_data, unhealthy_label, model, isStandard=False) + + total_mse = np.concatenate([mse, mse1], axis=0) + total_max = np.broadcast_to(max[0], shape=[total_mse.shape[0], ]) + # min = np.broadcast_to(min,shape=[dims,]) + total_mean = np.broadcast_to(mean[0], shape=[total_mse.shape[0], ]) + if isSave: + save_mse_name1 = save_mse_name + save_max_name1 = save_max_name + + np.savetxt(save_mse_name1, total_mse, delimiter=',') + np.savetxt(save_max_name1, total_max, delimiter=',') + + all, = mse1.shape + + + missNum = mse1[mse1[:] < max[0]].__len__() + + + print("all:", all) + miss_rate = missNum / all + print("漏报率:", miss_rate) + + + + plt.figure(random.randint(1, 100)) + plt.plot(total_max) + plt.plot(total_mse) + plt.plot(total_mean) + # plt.plot(min) + plt.show() + pass + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + #### TODO 第一步训练 + # 单次测试 + model = DCConv_Model() + + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=3, min_lr=0.001) + + model.compile(optimizer=tf.optimizers.Adam(), loss=tf.losses.mse) + model.build(input_shape=(batch_size, time_stamp, feature_num)) + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=3, mode='min', verbose=1) + + # history = model.fit(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], + # train_label1_healthy[:train_label1_healthy.shape[0] // 7, ], epochs=EPOCH, + # batch_size=batch_size * 10, validation_split=0.2, shuffle=True, verbose=1, + # callbacks=[checkpoint, lr_scheduler, early_stop]) + + ## TODO testing + # test_data, test_label = get_training_data(total_data[:healthy_date, :]) + model = tf.keras.models.load_model(save_name) + # mse, mean, max = get_MSE(test_data, test_label, new_model=newModel) + + start = time.time() + # 中间写上代码块 + + model.predict(train_data_healthy, batch_size=32) + end = time.time() + print("data_size:", train_data_healthy.shape) + print('Running time: %s Seconds' % (end - start)) + + healthy_size, _, _ = train_data_healthy.shape + unhealthy_size, _, _ = train_data_unhealthy.shape + all_data, _, _ = get_training_data_overlapping( + total_data[healthy_size - 2 * unhealthy_size:unhealthy_date, :], is_Healthy=True) + + newModel = tf.keras.models.load_model(save_name) + # 单次测试 + # getResult(newModel, + # healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, + # :], + # healthy_label=train_label1_healthy[ + # healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, :], + # unhealthy_data=train_data_unhealthy[:200, :], unhealthy_label=train_label1_unhealthy[:200, :],isSave=True) + getResult(newModel, healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + healthy_label=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + unhealthy_data=train_data_unhealthy, unhealthy_label=train_label1_unhealthy,isSave=True) + # mse, mean, max = get_MSE(train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + # train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], new_model=newModel) + pass diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/RepDCConv.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/RepDCConv.py new file mode 100644 index 0000000..a437166 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/RepDCConv.py @@ -0,0 +1,520 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + + +''' +@Author : dingjiawen +@Date : 2022/10/11 18:52 +@Usage : 对比实验,与JointNet相同深度,进行预测 +@Desc : +''' + +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +from condition_monitoring.data_deal import loadData_daban as loadData +from model.Joint_Monitoring.Joint_Monitoring3 import Joint_Monitoring + +from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model +from keras.callbacks import EarlyStopping +import random +import time + +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 32 +learning_rate = 0.001 +EPOCH = 101 +model_name = "DCConv" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "./trianed/{0}_{1}_{2}.h5".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_step_two_name = "../hard_model/two_weight/{0}_timestamp{1}_feature{2}_weight_epoch14/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_mse_name = "./mse/DCConv/banda/mse.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_max_name = "./mse/DCConv/banda/max.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +# save_name = "../model/joint/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +# save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +'''文件名''' +'''文件名''' +file_name = "G:\data\SCADA数据\SCADA_已处理_粤水电达坂城2020.1月-5月\风机15.csv" + +''' +文件说明:jb4q_8_delete_total_zero.csv是删除了只删除了全是0的列的文件 +文件从0:415548行均是正常值(2019/7.30 00:00:00 - 2019/9/18 11:14:00) +从415549:432153行均是异常值(2019/9/18 11:21:01 - 2021/1/18 00:00:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 96748 +# 最后异常的时间点 +unhealthy_date = 107116 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def shuffle(train_data, train_label1, train_label2, is_split: bool = False, split_size: float = 0.2): + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(train_data, + train_label1, + train_label2, + test_size=split_size, + shuffle=True, + random_state=100) + if is_split: + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + train_data = np.concatenate([train_data, test_data], axis=0) + train_label1 = np.concatenate([train_label1, test_label1], axis=0) + train_label2 = np.concatenate([train_label2, test_label2], axis=0) + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2 + pass + + +def split_test_data(healthy_data, healthy_label1, healthy_label2, unhealthy_data, unhealthy_label1, unhealthy_label2, + split_size: float = 0.2, shuffle: bool = True): + data = np.concatenate([healthy_data, unhealthy_data], axis=0) + label1 = np.concatenate([healthy_label1, unhealthy_label1], axis=0) + label2 = np.concatenate([healthy_label2, unhealthy_label2], axis=0) + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(data, + label1, + label2, + test_size=split_size, + shuffle=shuffle, + random_state=100) + + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + + pass + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +def showResult(step_two_model: Joint_Monitoring, test_data, isPlot: bool = False): + # 获取模型的所有参数的个数 + # step_two_model.count_params() + total_result = [] + size, length, dims = test_data.shape + for epoch in range(0, size - batch_size + 1, batch_size): + each_test_data = test_data[epoch:epoch + batch_size, :, :] + _, _, _, output4 = step_two_model.call(each_test_data, is_first_time=False) + total_result.append(output4) + total_result = np.reshape(total_result, [total_result.__len__(), -1]) + total_result = np.reshape(total_result, [-1, ]) + if isPlot: + plt.scatter(list(range(total_result.shape[0])), total_result, c='black', s=10) + # 画出 y=1 这条水平线 + plt.axhline(0.5, c='red', label='Failure threshold') + # 箭头指向上面的水平线 + # plt.arrow(35000, 0.9, 33000, 0.75, head_width=0.02, head_length=0.1, shape="full", fc='red', ec='red', + # alpha=0.9, overhang=0.5) + # plt.text(35000, 0.9, "Truth Fault", fontsize=10, color='black', verticalalignment='top') + plt.axvline(test_data.shape[0] * 2 / 3, c='blue', ls='-.') + plt.xlabel("time") + plt.ylabel("confience") + plt.text(total_result.shape[0] * 4 / 5, 0.6, "Fault", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.text(total_result.shape[0] * 1 / 3, 0.4, "Norm", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.grid() + # plt.ylim(0, 1) + # plt.xlim(-50, 1300) + # plt.legend("", loc='upper left') + plt.show() + return total_result + + +def DCConv_Model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + input = tf.cast(input, tf.float32) + + LSTM1 = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=2)(input) + LSTM2 = tf.keras.layers.Conv1D(10, 2, padding="causal", dilation_rate=2)(input) + LSTM3 = tf.keras.layers.Conv1D(10, 1, padding="causal", dilation_rate=2)(input) + + t1 = tf.add(tf.add(LSTM1, LSTM2), LSTM3) + + LSTM1 = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=4)(t1) + LSTM2 = tf.keras.layers.Conv1D(10, 2, padding="causal", dilation_rate=4)(t1) + LSTM3 = tf.keras.layers.Conv1D(10, 1, padding="causal", dilation_rate=4)(t1) + + t2 = tf.add(tf.add(LSTM1, LSTM2), LSTM3) + + + + LSTM1 = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=8)(t2) + LSTM2 = tf.keras.layers.Conv1D(10, 2, padding="causal", dilation_rate=8)(t2) + LSTM3 = tf.keras.layers.Conv1D(10, 1, padding="causal", dilation_rate=8)(t2) + + t3 = tf.add(tf.add(LSTM1, LSTM2), LSTM3) + + + LSTM1 = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=16)(t3) + LSTM2 = tf.keras.layers.Conv1D(10, 2, padding="causal", dilation_rate=16)(t3) + LSTM3 = tf.keras.layers.Conv1D(10, 1, padding="causal", dilation_rate=16)(t3) + + t4 = tf.add(tf.add(LSTM1, LSTM2), LSTM3) + + + + LSTM1 = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=32)(t4) + LSTM2 = tf.keras.layers.Conv1D(10, 2, padding="causal", dilation_rate=32)(t4) + LSTM3 = tf.keras.layers.Conv1D(10, 1, padding="causal", dilation_rate=32)(t4) + + t5 = tf.add(tf.add(LSTM1, LSTM2), LSTM3) + + + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=64)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=128)(LSTM) + # LSTM = tf.keras.layers.Conv1D(40, 3, padding="causal",dilation_rate=2)(LSTM) + + LSTM = t5[:, -1, :] + # bn = tf.keras.layers.BatchNormalization()(LSTM) + + # d1 = tf.keras.layers.Dense(20)(LSTM) + # bn = tf.keras.layers.BatchNormalization()(d1) + + output = tf.keras.layers.Dense(128, name='output1')(LSTM) + output = tf.keras.layers.Dense(10, name='output')(output) + model = tf.keras.Model(inputs=input, outputs=output) + return model + pass + + +def get_MSE(data, label, new_model, isStandard: bool = True, isPlot: bool = True, predictI: int = 1): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + if isStandard: + dims, = mse.shape + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + print("max:", max) + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + if isPlot: + plt.figure(random.randint(1, 9)) + plt.plot(max) + plt.plot(mse) + plt.plot(mean) + # plt.plot(min) + plt.show() + else: + if isPlot: + plt.figure(random.randint(1, 9)) + plt.plot(mse) + # plt.plot(min) + plt.show() + return mse + + return mse, mean, max + # pass + + +# healthy_data是健康数据,用于确定阈值,all_data是完整的数据,用于模型出结果 +def getResult(model: tf.keras.Model, healthy_data, healthy_label, unhealthy_data, unhealthy_label, isPlot: bool = False, + isSave: bool = True, predictI: int = 1): + # TODO 计算MSE确定阈值 + # TODO 计算MSE确定阈值 + + mse, mean, max = get_MSE(healthy_data, healthy_label, model) + + # 误报率的计算 + total, = mse.shape + faultNum = 0 + faultList = [] + faultNum = mse[mse[:] > max[0]].__len__() + # for i in range(total): + # if (mse[i] > max[i]): + # faultNum += 1 + # faultList.append(mse[i]) + + fault_rate = faultNum / total + print("误报率:", fault_rate) + + # 漏报率计算 + missNum = 0 + mse1 = get_MSE(unhealthy_data, unhealthy_label, model, isStandard=False) + + total_mse = np.concatenate([mse, mse1], axis=0) + total_max = np.broadcast_to(max[0], shape=[total_mse.shape[0], ]) + # min = np.broadcast_to(min,shape=[dims,]) + total_mean = np.broadcast_to(mean[0], shape=[total_mse.shape[0], ]) + if isSave: + save_mse_name1 = save_mse_name + save_max_name1 = save_max_name + + np.savetxt(save_mse_name1, total_mse, delimiter=',') + np.savetxt(save_max_name1, total_max, delimiter=',') + + all, = mse1.shape + + missNum = mse1[mse1[:] < max[0]].__len__() + + print("all:", all) + miss_rate = missNum / all + print("漏报率:", miss_rate) + + plt.figure(random.randint(1, 100)) + plt.plot(total_max) + plt.plot(total_mse) + plt.plot(total_mean) + # plt.plot(min) + plt.show() + pass + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + #### TODO 第一步训练 + # 单次测试 + model = DCConv_Model() + + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath=save_name, + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=3, min_lr=0.001) + + model.compile(optimizer=tf.optimizers.Adam(), loss=tf.losses.mse) + model.build(input_shape=(batch_size, time_stamp, feature_num)) + model.summary() + # early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=3, mode='min', verbose=1) + # + # history = model.fit(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], + # train_label1_healthy[:train_label1_healthy.shape[0] // 7, ], epochs=EPOCH, + # batch_size=batch_size * 10, validation_split=0.2, shuffle=True, verbose=1, + # callbacks=[checkpoint, lr_scheduler, early_stop]) + + ## TODO testing + # test_data, test_label = get_training_data(total_data[:healthy_date, :]) + newModel = tf.keras.models.load_model(save_name) + # mse, mean, max = get_MSE(test_data, test_label, new_model=newModel) + + start = time.time() + # 中间写上代码块 + + model.predict(train_data_healthy, batch_size=32) + end = time.time() + print("data_size:", train_data_healthy.shape) + print('Running time: %s Seconds' % (end - start)) + + healthy_size, _, _ = train_data_healthy.shape + unhealthy_size, _, _ = train_data_unhealthy.shape + all_data, _, _ = get_training_data_overlapping( + total_data[healthy_size - 2 * unhealthy_size:unhealthy_date, :], is_Healthy=True) + + newModel = tf.keras.models.load_model(save_name) + # 单次测试 + # getResult(newModel, + # healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, + # :], + # healthy_label=train_label1_healthy[ + # healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, :], + # unhealthy_data=train_data_unhealthy[:200, :], unhealthy_label=train_label1_unhealthy[:200, :],isSave=True) + getResult(newModel, healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + healthy_label=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + unhealthy_data=train_data_unhealthy, unhealthy_label=train_label1_unhealthy, isSave=True) + # mse, mean, max = get_MSE(train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + # train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], new_model=newModel) + pass diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/__init__.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/__init__.py new file mode 100644 index 0000000..f8b166b --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/23 10:43 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/complete/Transformer.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/complete/Transformer.py new file mode 100644 index 0000000..155ace0 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/complete/Transformer.py @@ -0,0 +1,102 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/23 10:43 +@Usage : +@Desc : 计算transformer的参数和时间复杂度 6层self_attention +''' +import tensorflow as tf +from tensorflow.keras import Model, layers, initializers +import numpy as np +from model.SelfAttention.SelfAttention import Block + + +class Transformer(Model): + + # depth表示的是重复encoder block的次数,num_heads表示的是在multi-head self-attention中head的个数 + # MLP block中有一个Pre_logist,这里指的是,当在较大的数据集上学习的时候Pre_logist就表示一个全连接层加上一个tanh激活函数 + # 当在较小的数据集上学习的时候,Pre_logist是没有的,而这里的representation_size表示的就是Pre_logist中全连接层的节点个数 + # num_classes表示分类的类数 + def __init__(self, embed_dim=768, + depth=12, num_heads=12, qkv_bias=True, qk_scale=None, + drop_ratio=0., attn_drop_ratio=0., drop_path_ratio=0., + representation_size=None, num_classes=1000, name="ViT-B/16"): + super(Transformer, self).__init__(name=name) + + self.embed_dim = embed_dim + self.depth = depth + self.num_heads = num_heads + self.qkv_bias = qkv_bias + self.qk_scale = qk_scale + self.drop_ratio = drop_ratio + self.attn_drop_ratio = attn_drop_ratio + self.drop_path_ratio = drop_path_ratio + self.representation_size = representation_size + self.num_classes = num_classes + + dpr = np.linspace(0., drop_path_ratio, depth) # stochastic depth decay rule + # 用一个for循环重复Block模块 + # 在用droppath时的drop_path_ratio是由0慢慢递增到我们所指定的drop_path_ratio的 + # 所以我们在构建Block时,这里的drop_path_ratio时变化的,所以用 np.linspace方法创建一个等差数列来初始化drop_path_ratio + self.blocks = [Block(dim=embed_dim, num_heads=num_heads, qkv_bias=qkv_bias, + qk_scale=qk_scale, drop_ratio=drop_ratio, attn_drop_ratio=attn_drop_ratio, + drop_path_ratio=dpr[i], name="encoderblock_{}".format(i)) + for i in range(depth)] + + self.norm = layers.LayerNormalization(epsilon=1e-6, name="encoder_norm") + + # 接下来,如果传入了representation_size,就构建一个全连接层,激活函数为tanh + # 如果没有传入的话,就不做任何操作 + # if representation_size: + # self.has_logits = True + # self.pre_logits = layers.Dense(representation_size, activation="tanh", name="pre_logits") + # else: + # self.has_logits = False + # self.pre_logits = layers.Activation("linear") + + # 定义最后一个全连接层,节点个数就是我们的分类个数num_classes + # self.head = layers.Dense(num_classes, name="head", kernel_initializer=initializers.Zeros()) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'embed_dim': self.embed_dim, + 'depth': self.depth, + 'num_heads': self.num_heads, + 'qkv_bias': self.qkv_bias, + 'qk_scale': self.qk_scale, + 'drop_ratio': self.drop_ratio, + 'attn_drop_ratio': self.attn_drop_ratio, + 'drop_path_ratio': self.drop_path_ratio, + 'representation_size': self.representation_size, + 'num_classes': self.num_classes + } + ) + base_config = super(Transformer, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, training=None): + # [B, H, W, C] -> [B, num_patches, embed_dim] + x = inputs # [B, 196, 768] + + for block in self.blocks: + x = block(x, training=training) + + x = self.norm(x) + # 这里是提取class_toke的输出,然后用切片的方式,而刚刚是将class_toke拼接在最前面的 + # 所以这里用切片的方式,去取class_toke的输出,并将它传递给pre_logits + # x = self.pre_logits(x[:, 0]) + # # 最后传递给head + # x = self.head(x) + # # 为什么只用class_toke对应的输出,而不用每一个patches对应的输出呢? + # 可以参考原文bird 网络 + + return x + + +if __name__ == '__main__': + # 使用方式 + input =tf.Variable(shape=[20, 10, 10]) + Transformer(embed_dim=10, depth=8, num_heads=1, num_classes=10) diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/complete/__init__.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/complete/__init__.py new file mode 100644 index 0000000..f8b166b --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/complete/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/23 10:43 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/poor-Cnn-gru.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/poor-Cnn-gru.py new file mode 100644 index 0000000..33b9a13 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/poor-Cnn-gru.py @@ -0,0 +1,569 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + + +''' +@Author : dingjiawen +@Date : 2022/10/11 18:52 +@Usage : 对比实验,使用四分位图技术 +@Desc : +''' + +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +from condition_monitoring.data_deal import loadData_daban as loadData +from model.Joint_Monitoring.Joint_Monitoring3 import Joint_Monitoring + +from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model +from keras.callbacks import EarlyStopping +import random +import time + +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 32 +learning_rate = 0.001 +EPOCH = 101 +model_name = "DCConv" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "./trianed/{0}_{1}_{2}.h5".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_step_two_name = "../hard_model/two_weight/{0}_timestamp{1}_feature{2}_weight_epoch14/weight".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_mse_name = "./mse/DCConv/banda/mse.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) +save_max_name = "./mse/DCConv/banda/max.csv".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +# save_name = "../model/joint/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +# save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, +# time_stamp, +# feature_num, +# batch_size, +# EPOCH) +'''文件名''' +'''文件名''' +save_mse_name=r"./compare/mse/JM_banda/{0}_result.csv".format(model_name) +'''文件名''' +file_name = "G:\data\SCADA数据\SCADA_已处理_粤水电达坂城2020.1月-5月\风机15.csv" + +''' +文件说明:jb4q_8_delete_total_zero.csv是删除了只删除了全是0的列的文件 +文件从0:96748行均是正常值(2019/12.30 00:00:00 - 2020/3/11 05:58:00) +从96748:107116行均是异常值(2020/3/11 05:58:01 - 2021/3/18 11:04:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 96748 +# 最后异常的时间点 +unhealthy_date = 107116 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +# trian_data:(300455,120,10) +# trian_label1:(300455,10) +# trian_label2:(300455,) +def shuffle(train_data, train_label1, train_label2, is_split: bool = False, split_size: float = 0.2): + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(train_data, + train_label1, + train_label2, + test_size=split_size, + shuffle=True, + random_state=100) + if is_split: + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + train_data = np.concatenate([train_data, test_data], axis=0) + train_label1 = np.concatenate([train_label1, test_label1], axis=0) + train_label2 = np.concatenate([train_label2, test_label2], axis=0) + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2 + pass + + +def split_test_data(healthy_data, healthy_label1, healthy_label2, unhealthy_data, unhealthy_label1, unhealthy_label2, + split_size: float = 0.2, shuffle: bool = True): + data = np.concatenate([healthy_data, unhealthy_data], axis=0) + label1 = np.concatenate([healthy_label1, unhealthy_label1], axis=0) + label2 = np.concatenate([healthy_label2, unhealthy_label2], axis=0) + (train_data, test_data, train_label1, test_label1, train_label2, test_label2) = train_test_split(data, + label1, + label2, + test_size=split_size, + shuffle=shuffle, + random_state=100) + + # print(train_data.shape) + # print(train_label1.shape) + # print(train_label2.shape) + # print(train_data.shape) + + return train_data, train_label1, train_label2, test_data, test_label1, test_label2 + + pass + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +def showResult(step_two_model: Joint_Monitoring, test_data, isPlot: bool = False): + # 获取模型的所有参数的个数 + # step_two_model.count_params() + total_result = [] + size, length, dims = test_data.shape + for epoch in range(0, size - batch_size + 1, batch_size): + each_test_data = test_data[epoch:epoch + batch_size, :, :] + _, _, _, output4 = step_two_model.call(each_test_data, is_first_time=False) + total_result.append(output4) + total_result = np.reshape(total_result, [total_result.__len__(), -1]) + total_result = np.reshape(total_result, [-1, ]) + if isPlot: + plt.scatter(list(range(total_result.shape[0])), total_result, c='black', s=10) + # 画出 y=1 这条水平线 + plt.axhline(0.5, c='red', label='Failure threshold') + # 箭头指向上面的水平线 + # plt.arrow(35000, 0.9, 33000, 0.75, head_width=0.02, head_length=0.1, shape="full", fc='red', ec='red', + # alpha=0.9, overhang=0.5) + # plt.text(35000, 0.9, "Truth Fault", fontsize=10, color='black', verticalalignment='top') + plt.axvline(test_data.shape[0] * 2 / 3, c='blue', ls='-.') + plt.xlabel("time") + plt.ylabel("confience") + plt.text(total_result.shape[0] * 4 / 5, 0.6, "Fault", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.text(total_result.shape[0] * 1 / 3, 0.4, "Norm", fontsize=10, color='black', verticalalignment='top', + horizontalalignment='center', + bbox={'facecolor': 'grey', + 'pad': 10}) + plt.grid() + # plt.ylim(0, 1) + # plt.xlim(-50, 1300) + # plt.legend("", loc='upper left') + plt.show() + return total_result + + +def DCConv_Model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + input = tf.cast(input, tf.float32) + + LSTM = tf.keras.layers.Conv1D(10, 3)(input) + LSTM = tf.keras.layers.Conv1D(20, 3)(LSTM) + LSTM = tf.keras.layers.GRU(20, return_sequences=True)(LSTM) + LSTM = tf.keras.layers.GRU(40, return_sequences=True)(LSTM) + LSTM = tf.keras.layers.GRU(80, return_sequences=False)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=64)(LSTM) + # LSTM = tf.keras.layers.Conv1D(10, 3, padding="causal", dilation_rate=128)(LSTM) + # LSTM = tf.keras.layers.Conv1D(40, 3, padding="causal",dilation_rate=2)(LSTM) + + # LSTM = LSTM[:, -1, :] + # bn = tf.keras.layers.BatchNormalization()(LSTM) + + # d1 = tf.keras.layers.Dense(20)(LSTM) + # bn = tf.keras.layers.BatchNormalization()(d1) + + output = tf.keras.layers.Dense(128, name='output1')(LSTM) + output = tf.keras.layers.Dense(10, name='output')(output) + model = tf.keras.Model(inputs=input, outputs=output) + return model + pass + + +def get_MSE(data, label, new_model, isStandard: bool = True, isPlot: bool = True, predictI: int = 1): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + if isStandard: + dims, = mse.shape + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + print("max:", max) + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + if isPlot: + plt.figure(random.randint(1, 9)) + plt.plot(max) + plt.plot(mse) + plt.plot(mean) + # plt.plot(min) + plt.show() + else: + if isPlot: + plt.figure(random.randint(1, 9)) + plt.plot(mse) + # plt.plot(min) + plt.show() + return mse + + return mse, mean, max + # pass + + +# healthy_data是健康数据,用于确定阈值,all_data是完整的数据,用于模型出结果 +def getResult(model: tf.keras.Model, healthy_data, healthy_label, unhealthy_data, unhealthy_label, isPlot: bool = False, + isSave: bool = True, predictI: int = 1): + # TODO 计算MSE确定阈值 + # TODO 计算MSE确定阈值 + + mse, mean, max = get_MSE(healthy_data, healthy_label, model) + + # 误报率的计算 + total, = mse.shape + faultNum = 0 + faultList = [] + faultNum = mse[mse[:] > max[0]].__len__() + # for i in range(total): + # if (mse[i] > max[i]): + # faultNum += 1 + # faultList.append(mse[i]) + + fault_rate = faultNum / total + print("误报率:", fault_rate) + + # 漏报率计算 + missNum = 0 + mse1 = get_MSE(unhealthy_data, unhealthy_label, model, isStandard=False) + + total_mse = np.concatenate([mse, mse1], axis=0) + total_max = np.broadcast_to(max[0], shape=[total_mse.shape[0], ]) + # min = np.broadcast_to(min,shape=[dims,]) + total_mean = np.broadcast_to(mean[0], shape=[total_mse.shape[0], ]) + if isSave: + save_mse_name1 = save_mse_name + save_max_name1 = save_max_name + + np.savetxt(save_mse_name1, total_mse, delimiter=',') + np.savetxt(save_max_name1, total_max, delimiter=',') + + all, = mse1.shape + + missNum = mse1[mse1[:] < max[0]].__len__() + + print("all:", all) + miss_rate = missNum / all + print("漏报率:", miss_rate) + + plt.figure(random.randint(1, 100)) + plt.plot(total_max) + plt.plot(total_mse) + plt.plot(total_mean) + # plt.plot(min) + plt.show() + pass + + +def iqr_outliers(df: pd.DataFrame): + q1 = df.quantile(0.25) + q3 = df.quantile(0.75) + iqr = q3 - q1 + Lower_tail = q1 - 1.5 * iqr + Upper_tail = q3 + 1.5 * iqr + outlier = [] + for i in df.iloc[:, 0]: + if i > float(Upper_tail) or i < float(Lower_tail): # float限定 + outlier.append(i) + print("Outliers:", outlier) + + +def iqr_outliers_np_all(df): + length, feature = df.shape + toatl_Outliers = set() + for i in range(feature): + cur = df[:, i] + cur = np.array(cur) + q1 = np.percentile(cur, [25]) + q3 = np.percentile(cur, [75]) + iqr = q3 - q1 + Lower_tail = q1 - 1.5 * iqr + Upper_tail = q3 + 1.5 * iqr + cur_Outliers = [] + for i in range(len(cur)): + if cur[i] > float(Upper_tail) or cur[i] < float(Lower_tail): # float限定 + toatl_Outliers.add(i) + cur_Outliers.append(i) + print("cur_Outliers.shape:", len(cur_Outliers)) + print("cur_Outliers:", cur_Outliers) + print("Outliers.shape:", len(toatl_Outliers)) + print("Outliers:", toatl_Outliers) + unhealthy_outlier = [] + for s in toatl_Outliers: + if s >= healthy_date: + unhealthy_outlier.append(s) + print("unhealthy_outlier.shape:", len(unhealthy_outlier)) + print("unhealthy_outlier.shape:", len(unhealthy_outlier)/(unhealthy_date-healthy_date)) + print("unhealthy_outlier:", unhealthy_outlier) + return sorted(unhealthy_outlier) + + +def sigma_outliers_np_all(df): + length, feature = df.shape + toatl_Outliers = set() + for i in range(feature): + cur = df[:, i] + cur = np.array(cur) + mean = np.mean(cur[:200000,]) + sigma = np.sqrt(np.var(cur[:200000,])) + + Lower_tail = mean - 3 * sigma + Upper_tail = mean + 3 * sigma + cur_Outliers = [] + for i in range(len(cur)): + if cur[i] > float(Upper_tail) or cur[i] < float(Lower_tail): # float限定 + toatl_Outliers.add(i) + cur_Outliers.append(i) + print("cur_Outliers.shape:", len(cur_Outliers)) + print("cur_Outliers:", cur_Outliers) + print("Outliers.shape:", len(toatl_Outliers)) + print("Outliers:", toatl_Outliers) + unhealthy_outlier = [] + for s in toatl_Outliers: + if s >= healthy_date: + unhealthy_outlier.append(s) + print("unhealthy_outlier.shape:", len(unhealthy_outlier)) + print("unhealthy_outlier.shape:", len(unhealthy_outlier)/(unhealthy_date-healthy_date)) + print("unhealthy_outlier:", unhealthy_outlier) + return sorted(unhealthy_outlier) + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + + total_train_data = total_data[:unhealthy_date, :] + # unhealthy_outlier = iqr_outliers_np_all(total_train_data) + unhealthy_outlier = sigma_outliers_np_all(total_train_data) + # #### TODO 第一步训练 + # # 单次测试 + # model = DCConv_Model() + # + # checkpoint = tf.keras.callbacks.ModelCheckpoint( + # filepath=save_name, + # monitor='val_loss', + # verbose=2, + # save_best_only=True, + # mode='min') + # lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=3, min_lr=0.001) + # + # model.compile(optimizer=tf.optimizers.Adam(), loss=tf.losses.mse) + # model.build(input_shape=(batch_size, time_stamp, feature_num)) + # model.summary() + # early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=3, mode='min', verbose=1) + # + # # history = model.fit(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], + # # train_label1_healthy[:train_label1_healthy.shape[0] // 7, ], epochs=EPOCH, + # # batch_size=batch_size * 10, validation_split=0.2, shuffle=True, verbose=1, + # # callbacks=[checkpoint, lr_scheduler, early_stop]) + # + # ## TODO testing + # # # test_data, test_label = get_training_data(total_data[:healthy_date, :]) + # # model = tf.keras.models.load_model(save_name) + # # # mse, mean, max = get_MSE(test_data, test_label, new_model=newModel) + # # + # # start = time.time() + # # # 中间写上代码块 + # # + # # model.predict(train_data_healthy, batch_size=32) + # # end = time.time() + # # print("data_size:", train_data_healthy.shape) + # # print('Running time: %s Seconds' % (end - start)) + # # + # healthy_size, _, _ = train_data_healthy.shape + # unhealthy_size, _, _ = train_data_unhealthy.shape + # all_data, _, _ = get_training_data_overlapping( + # total_data[healthy_size - 2 * unhealthy_size:unhealthy_date, :], is_Healthy=True) + # + # newModel = tf.keras.models.load_model(save_name) + # # 单次测试 + # # getResult(newModel, + # # healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, + # # :], + # # healthy_label=train_label1_healthy[ + # # healthy_size - 2 * unhealthy_size:healthy_size - 2 * unhealthy_size + 200, :], + # # unhealthy_data=train_data_unhealthy[:200, :], unhealthy_label=train_label1_unhealthy[:200, :],isSave=True) + # getResult(newModel, healthy_data=train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + # healthy_label=train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], + # unhealthy_data=train_data_unhealthy, unhealthy_label=train_label1_unhealthy,isSave=False) + # # mse, mean, max = get_MSE(train_data_healthy[healthy_size - 2 * unhealthy_size:, :], + # # train_label1_healthy[healthy_size - 2 * unhealthy_size:, :], new_model=newModel) + pass diff --git a/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/transformer_complete.py b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/transformer_complete.py new file mode 100644 index 0000000..1e26a06 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/condition_monitoring/返修/transformer_complete.py @@ -0,0 +1,299 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/23 14:23 +@Usage : +@Desc : +''' + +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from condition_monitoring.data_deal import loadData_daban as loadData +# from model.Joint_Monitoring.Joint_Monitoring_banda import Joint_Monitoring + +# from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model +from condition_monitoring.返修.complete.Transformer import Transformer +from model.SelfAttention.SelfAttention import Block +from keras.callbacks import EarlyStopping +import time + +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 32 +learning_rate = 0.001 +EPOCH = 101 +model_name = "transformer" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "../model/weight/{0}_timestamp{1}_feature{2}_weight/weight".format(model_name, + time_stamp, + feature_num, + ) +save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +save_mse_name = r"./compare/mse/JM_banda/{0}_result.csv".format(model_name) +'''文件名''' +file_name = "G:\data\SCADA数据\SCADA_已处理_粤水电达坂城2020.1月-5月\风机15.csv" + +''' +文件说明:jb4q_8_delete_total_zero.csv是删除了只删除了全是0的列的文件 +文件从0:96748行均是正常值(2019/12.30 00:00:00 - 2020/3/11 05:58:00) +从96748:107116行均是异常值(2020/3/11 05:58:01 - 2021/3/18 11:04:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 96748 +# 最后异常的时间点 +unhealthy_date = 107116 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + +def get_MSE(data, label, new_model): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + + dims, = mse.shape + + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + + # plt.plot(max) + # plt.plot(mse) + # plt.plot(mean) + # # plt.plot(min) + # plt.show() + # + # + return mse, mean, max + # pass + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + #### TODO 第一步训练 + + ####### TODO 训练 + # model = Transformer(embed_dim=10, depth=5, num_heads=1, num_classes=10,representation_size=128) + # checkpoint = tf.keras.callbacks.ModelCheckpoint( + # filepath=save_name, + # monitor='val_loss', + # verbose=2, + # save_best_only=True, + # mode='min') + # lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=3, min_lr=0.001) + # + # + # model.build(input_shape=(batch_size, time_stamp, feature_num)) + # model.summary() + # early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=3, mode='min', verbose=1) + # + # history = model.fit(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], + # train_label1_healthy[:train_label1_healthy.shape[0] // 7, ], epochs=5, + # batch_size=batch_size * 10, validation_split=0.2, shuffle=True, verbose=1, + # ) + # + # model.save_weights(save_name) + + model = Transformer(embed_dim=10, depth=5, num_heads=1, num_classes=10, representation_size=128) + model.load_weights(save_name) + model.build(input_shape=(batch_size, time_stamp, feature_num)) + model.summary() + + # + # + # #### TODO 测试 + + # model = tf.keras.models.load_model("E:\self_example\TensorFlow_eaxmple\Model_train_test\condition_monitoring\model\joint/transformer_timestamp120_feature10.h5" + # , custom_objects={'Transformer': Transformer} + # ) + + trained_data = tf.keras.models.Model(inputs=model.input, outputs=model.get_layer('encoder_norm').output).predict(train_data_healthy, batch_size=32) + + print(trained_data) + + # + start = time.time() + # 中间写上代码块 + + model.predict(train_data_healthy, batch_size=32) + end = time.time() + print("data_size:", train_data_healthy.shape) + print('Running time: %s Seconds' % (end - start)) + + # trained_model = tf.keras.models.load_model(save_name, custom_objects={'Block': Block}) + # + # + # + # # 使用已知的点进行预测 + # + # pass diff --git a/TensorFlow_eaxmple/Model_train_test/model/AdamRNN/AdamRNN.py b/TensorFlow_eaxmple/Model_train_test/model/AdamRNN/AdamRNN.py new file mode 100644 index 0000000..e922d33 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/AdamRNN/AdamRNN.py @@ -0,0 +1,149 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 16:42 +@Usage : +@Desc : +''' + +import tensorflow as tf +from model.LossFunction.TransferLoss import TransferLoss + + +class AdaRNN(tf.keras.Model): + def __init__(self, n_input=128, n_hiddens=[64, 64], n_output=6, len_seq=9, trans_loss='mmd'): + super(AdaRNN, self).__init__() + self.n_input = n_input + self.num_layers = len(n_hiddens) + self.hiddens = n_hiddens + self.n_output = n_output + self.trans_loss = trans_loss + self.len_seq = len_seq + + self.features = tf.keras.Sequential() + for hidden in n_hiddens: + rnn = tf.keras.layers.GRU( + units=hidden, + return_sequences=True + ) + self.features.add(rnn) + + self.fc_out = tf.keras.layers.Dense(n_output, activation=None) + + self.gate = [] + for _ in range(len(n_hiddens)): + gate_weight = tf.keras.layers.Dense(len_seq, activation=None) + self.gate.append(gate_weight) + self.bn_lst = [tf.keras.layers.BatchNormalization() for _ in range(len(n_hiddens))] + self.softmax = tf.keras.layers.Softmax(axis=0) + + # def init_layers(self): + # for gate_layer in self.gate: + # gate_layer.build((None, self.len_seq * self.hiddens[i] * 2)) + + def forward_pre_train(self, x, len_win=0): + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out, out_list_all, out_weight_list = self.gru_features(x) + fea = out + + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + out_list_s, out_list_t = self.get_features(out_list_all) + + loss_transfer = tf.zeros((1,)) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = max(j - len_win, 0) + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] + loss_transfer = loss_transfer + weight * criterion_transder( + out_list_s[i][:, j, :], out_list_t[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def call(self, x, len_win=0, training=False): + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out, out_list_all, out_weight_list = self.gru_features(x, training=training) + fea = out + + fc_out = self.fc_out(fea[:, -1, :]) + + loss_transfer = tf.zeros((1,)) + for i in range(len(out_list_all)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = max(j - len_win, 0) + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_all[i][:, j, :], out_list_all[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def gru_features(self, x, training=False): + x_input = x + out = None + out_lis = [] + out_weight_list = [] if ( + self.model_type == 'AdaRNN') else None + for i in range(self.num_layers): + out = self.features[i](x_input, training=training) + x_input = out + out_lis.append(out) + if self.model_type == 'AdaRNN': + out_gate = self.process_gate_weight(x_input, i, training=training) + out_weight_list.append(out_gate) + return out, out_lis, out_weight_list + + def process_gate_weight(self, out, index, training=False): + x_s = out[:, :out.shape[1] // 2] # 可以理解为LSTM的前半段 + x_t = out[:, out.shape[1] // 2:] # 可以理解为LSTM的后半段 + x_all = tf.concat((x_s, x_t), 2) + x_all = tf.reshape(x_all, (x_all.shape[0], -1)) + weight = tf.sigmoid(self.bn_lst[index](self.gate[index](x_all)), training=training) + weight = tf.reduce_mean(weight, axis=0) + res = self.softmax(weight) + return res + + def get_features(self, output_list): + fea_list_src, fea_list_tar = [], [] + for fea in output_list: + fea_list_src.append(fea[:, :fea.shape[1] // 2]) + fea_list_tar.append(fea[:, fea.shape[1] // 2:]) + return fea_list_src, fea_list_tar + + def forward_Boosting(self, x, weight_mat=None): + out, out_list_all, _ = self.gru_features(x, training=False) + fea = out + + fc_out = self.fc_out(fea[:, -1, :]) + + out_list_all = out_list_all + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = tf.zeros((1,)) + if weight_mat is None: + weight = (1.0 / self.len_seq * + tf.ones((self.num_layers, self.len_seq), dtype=tf.float32)) + else: + weight = weight_mat + dist_mat = tf.zeros((self.num_layers, self.len_seq), dtype=tf.float32) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss) + for j in range(self.len_seq): + loss_trans = criterion_transder(out_list_s[i][:, j, :] , out_list_t[i][:, j, :]) + loss_transfer = loss_transfer + weight[i, j] * loss_trans + dist_mat[i, j] = loss_trans + return fc_out, loss_transfer, dist_mat, weight + + def update_weight_Boosting(self, weight_mat, dist_old, dist_new): + epsilon = 1e-12 + dist_old = tf.stop_gradient(dist_old) + dist_new = tf.stop_gradient(dist_new) + ind = dist_new diff --git a/TensorFlow_eaxmple/Model_train_test/model/AdamRNN/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/AdamRNN/__init__.py new file mode 100644 index 0000000..7539a86 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/AdamRNN/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 16:42 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/DCT_channelAttention.py b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/DCT_channelAttention.py new file mode 100644 index 0000000..4c85d15 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/DCT_channelAttention.py @@ -0,0 +1,167 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/18 14:08 +@Usage : +@Desc : DCT的通道注意力模块 +''' +import tensorflow as tf +import tensorflow.keras +from tensorflow.keras import * +import tensorflow.keras.layers as layers +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Dropout, ReLU, BatchNormalization +from scipy.fftpack import dct + +# def dct(x, norm=None): +# """ +# Discrete Cosine Transform, Type II (a.k.a. the DCT) +# +# For the meaning of the parameter `norm`, see: +# https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.fftpack.dct.html +# +# :param x: the input signal +# :param norm: the normalization, None or 'ortho' +# :return: the DCT-II of the signal over the last dimension +# """ +# x_shape = x.shape +# N = x_shape[-1] +# x = x.contiguous().view(-1, N) +# +# +# v = tf.concat([x[:, ::2], x[:, 1::2].flip([1])], axis=1) +# +# # Vc = torch.fft.rfft(v, 1, onesided=False) +# Vc = tf.signal.fft(v, 1) +# +# +# k = - tf.range(N, dtype=x.dtype, device=x.device)[None, :] * np.pi / (2 * N) +# +# W_r = tf.cos(k) +# W_i = tf.sin(k) +# +# V = Vc[:, :, 0] * W_r - Vc[:, :, 1] * W_i +# +# if norm == 'ortho': +# V[:, 0] /= np.sqrt(N) * 2 +# V[:, 1:] /= np.sqrt(N / 2) * 2 +# +# V = 2 * V.view(*x_shape) +# +# return V + + +import tensorflow as tf + +''' +参考: +[1] https://github.com/Zero-coder/FECAM/blob/main/layers/dctnet.py +[2] https://arxiv.org/pdf/2212.01209v1.pdf +''' + + +def sdct_tf(signals, frame_length, frame_step, window_fn=tf.signal.hamming_window): + """Compute Short-Time Discrete Cosine Transform of `signals`. + + No padding is applied to the signals. + + Parameters + ---------- + signal : Time-domain input signal(s), a `[..., n_samples]` tensor. + + frame_length : Window length and DCT frame length in samples. + + frame_step : Number of samples between adjacent DCT columns. + + window_fn : See documentation for `tf.signal.stft`. + Default: hamming window. Window to use for DCT. + + Returns + ------- + dct : Real-valued T-F domain DCT matrix/matrixes, a `[..., n_frames, frame_length]` tensor. + """ + framed = tf.signal.frame(signals, frame_length, frame_step, pad_end=False) + if window_fn is not None: + window = window_fn(frame_length, dtype=framed.dtype) + framed = framed * window[tf.newaxis, :] + return tf.signal.dct(framed, norm="ortho", axis=-1) + + +def isdct_tf(dcts, *, frame_step, frame_length=None, window_fn=tf.signal.hamming_window): + """Compute Inverse Short-Time Discrete Cosine Transform of `dct`. + + Parameters other than `dcts` are keyword-only. + + Parameters + ---------- + dcts : DCT matrix/matrices from `sdct_tf` + + frame_step : Number of samples between adjacent DCT columns (should be the + same value that was passed to `sdct_tf`). + + frame_length : Ignored. Window length and DCT frame length in samples. + Can be None (default) or same value as passed to `sdct_tf`. + + window_fn : See documentation for `tf.signal.istft`. + Default: hamming window. Window to use for DCT. + + Returns + ------- + signals : Time-domain signal(s) reconstructed from `dcts`, a `[..., n_samples]` tensor. + Note that `n_samples` may be different from the original signals' lengths as passed to `sdct_torch`, + because no padding is applied. + """ + *_, n_frames, frame_length2 = dcts.shape + assert frame_length in {None, frame_length2} + signals = tf.signal.overlap_and_add( + tf.signal.idct(dcts, norm="ortho", axis=-1), frame_step + ) + if window_fn is not None: + window = window_fn(frame_length2, dtype=signals.dtype) + window_frames = tf.tile(window[tf.newaxis, :], (n_frames, 1)) + window_signal = tf.signal.overlap_and_add(window_frames, frame_step) + signals = signals / window_signal + return signals + + +class DCTChannelAttention(layers.Layer): + + def build(self, input_shape): + _, hidden, channel = input_shape + self.l1 = Dense(channel * 2, use_bias=False) + self.drop1 = Dropout(0.1) + self.relu = ReLU() + self.l2 = Dense(channel, use_bias=False) + self.bn = BatchNormalization(axis=-1, epsilon=1e-6) + + def call(self, inputs, **kwargs): + batch_size, hidden, channel = inputs.shape + list = [] + change = tf.transpose(inputs, [0, 2, 1]) + stack_dct = tf.signal.dct(change, norm="ortho", axis=-1) + stack_dct = tf.transpose(stack_dct, [0, 2, 1]) + + # for i in range(channel): + # freq = tf.signal.dct(inputs[:, :, i], norm="ortho", axis=-1) + # # print("freq-shape:",freq.shape) + # freq = tf.expand_dims(freq, axis=2) + # if i == 0: + # stack_dct = freq + # else: + # stack_dct = tf.concat([stack_dct, freq], axis=2) + # list.append(freq) + # stack_dct = tf.stack(list, axis=-1) + + lr_weight = self.bn(stack_dct) + lr_weight = self.l1(stack_dct) + lr_weight = self.drop1(lr_weight) + lr_weight = self.relu(lr_weight) + lr_weight = self.l2(lr_weight) + lr_weight = tf.sigmoid(lr_weight) + + lr_weight = self.bn(lr_weight) + + return inputs * lr_weight diff --git a/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/DCT_channelAttentionV2.py b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/DCT_channelAttentionV2.py new file mode 100644 index 0000000..ee30a7e --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/DCT_channelAttentionV2.py @@ -0,0 +1,80 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/8 19:39 +@Usage : +@Desc : +''' +import tensorflow as tf +import numpy as np + + +# 定义DCT函数 +def dct(x, norm=None): + """ + Discrete Cosine Transform, Type II (a.k.a. the DCT) + """ + x_shape = x.shape + N = x_shape[-1] + x = tf.reshape(x, [-1, N]) + + v = tf.concat([x[:, ::2], tf.reverse(x[:, 1::2], [1])], axis=1) + + Vc = tf.signal.rfft(v, 1) + + k = - tf.range(N, dtype=x.dtype) * np.pi / (2 * N) + W_r = tf.cos(k) + W_i = tf.sin(k) + + V = Vc[:, :, 0] * W_r - Vc[:, :, 1] * W_i + + if norm == 'ortho': + V[:, 0] /= np.sqrt(N) * 2 + V[:, 1:] /= np.sqrt(N / 2) * 2 + + V = 2 * tf.reshape(V, x_shape) + + return V + + +# 定义tf.keras版本的dct_channel_block +class DctChannelBlock(tf.keras.layers.Layer): + def __init__(self, channel): + super(DctChannelBlock, self).__init__() + self.fc = tf.keras.Sequential([ + tf.keras.layers.Dense(channel * 2, use_bias=False), + tf.keras.layers.Dropout(0.1), + tf.keras.layers.ReLU(), + tf.keras.layers.Dense(channel, use_bias=False), + tf.keras.layers.Activation('sigmoid') + ]) + self.dct_norm = tf.keras.layers.LayerNormalization(axis=-1, epsilon=1e-6) + + # def get_config(self): + # # 自定义层里面的属性 + # config = ( + # { + # 'units': self.units, + # 'return_sequences': self.return_sequences + # } + # ) + # base_config = super(DctChannelBlock, self).get_config() + # return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, **kwargs): + x = inputs + b, c, l = x.shape + dct_list = [] + for i in range(c): + freq = dct(x[:, i, :]) + dct_list.append(freq) + + stack_dct = tf.stack(dct_list, axis=1) + lr_weight = self.dct_norm(stack_dct) + lr_weight = self.fc(stack_dct) + lr_weight = self.dct_norm(lr_weight) + + return x * lr_weight + + diff --git a/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/Dynamic_channelAttention.py b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/Dynamic_channelAttention.py new file mode 100644 index 0000000..db9054c --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/Dynamic_channelAttention.py @@ -0,0 +1,139 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/12 17:48 +@Usage : +@Desc : +''' + +import tensorflow as tf +import tensorflow.keras +from tensorflow.keras import * +import tensorflow.keras.layers as layers +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D + +import keras.backend as K + + +class Between_0_1(tf.keras.constraints.Constraint): + def __call__(self, w): + # 调用父类__init__()方法 + super(Between_0_1, self).__init__() + return K.clip(w, 0, 1) + + +class DynamicChannelAttention(layers.Layer): + + def __init__(self): + # 调用父类__init__()方法 + super(DynamicChannelAttention, self).__init__() + self.DWC = DepthwiseConv1D(kernel_size=1, padding='SAME') + # self.DWC = DepthwiseConv1D(kernel_size=1, padding='causal',dilation_rate=4,data_format='channels_last') + + def build(self, input_shape): + if len(input_shape) != 3: + raise ValueError('Inputs to `DynamicChannelAttention` should have rank 3. ' + 'Received input shape:', str(input_shape)) + + # print(input_shape) + # GAP + self.GAP = tf.keras.layers.GlobalAvgPool1D() + self.c1 = tf.keras.layers.Conv1D(filters=input_shape[2], kernel_size=1, padding='SAME') + # s1 = tf.nn.sigmoid(c1) + + # GMP + self.GMP = tf.keras.layers.GlobalMaxPool1D() + self.c2 = tf.keras.layers.Conv1D(filters=input_shape[2], kernel_size=1, padding='SAME') + # s2 = tf.nn.sigmoid(c2) + + # weight + self.weight_kernel = self.add_weight( + shape=(1, input_shape[2]), + initializer='glorot_uniform', + name='weight_kernel', + constraint=Between_0_1()) + + def call(self, inputs, **kwargs): + batch_size, length, channel = inputs.shape + # print(batch_size,length,channel) + DWC1 = self.DWC(inputs) + + + # GAP + GAP = self.GAP(DWC1) + GAP = tf.expand_dims(GAP, axis=1) + c1 = self.c1(GAP) + c1 = tf.keras.layers.BatchNormalization()(c1) + s1 = tf.nn.sigmoid(c1) + + # GMP + GMP = self.GMP(DWC1) + GMP = tf.expand_dims(GMP, axis=1) + c2 = self.c2(GMP) + c2 = tf.keras.layers.BatchNormalization()(c2) + s2 = tf.nn.sigmoid(c2) + + # print(self.weight_kernel) + + weight_kernel = tf.broadcast_to(self.weight_kernel, shape=[length, channel]) + weight_kernel = tf.broadcast_to(weight_kernel, shape=[batch_size, length, channel]) + s1 = tf.broadcast_to(s1, shape=[batch_size, length, channel]) + s2 = tf.broadcast_to(s2, shape=[batch_size, length, channel]) + + output = tf.add(weight_kernel * s1 * inputs, (tf.ones_like(weight_kernel) - weight_kernel) * s2 * inputs) + return output + + +class DynamicPooling(layers.Layer): + + def __init__(self, pool_size=2): + # 调用父类__init__()方法 + super(DynamicPooling, self).__init__() + self.pool_size = pool_size + pass + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'pool_size': self.pool_size + } + ) + base_config = super(DynamicPooling, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + if len(input_shape) != 3: + raise ValueError('Inputs to `DynamicChannelAttention` should have rank 3. ' + 'Received input shape:', str(input_shape)) + # GAP + self.AP = tf.keras.layers.AveragePooling1D(pool_size=self.pool_size) + + # GMP + self.MP = tf.keras.layers.MaxPool1D(pool_size=self.pool_size) + + # weight + self.weight_kernel = self.add_weight( + shape=(int(input_shape[1] / self.pool_size), input_shape[2]), + initializer='glorot_uniform', + name='weight_kernel', + constraint=Between_0_1()) + + def call(self, inputs, **kwargs): + batch_size, length, channel = inputs.shape + + # GAP + GAP = self.AP(inputs) + + # GMP + GMP = self.MP(inputs) + + weight_kernel = tf.broadcast_to(self.weight_kernel, shape=GMP.shape) + + output = tf.add(weight_kernel * GAP, (tf.ones_like(weight_kernel) - weight_kernel) * GMP) + return output diff --git a/TensorFlow_eaxmple/Model_train_test/model/Dynamic_channelAttention/Light_channelAttention.py b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/Light_channelAttention.py similarity index 75% rename from TensorFlow_eaxmple/Model_train_test/model/Dynamic_channelAttention/Light_channelAttention.py rename to TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/Light_channelAttention.py index 233ae1e..46ab24e 100644 --- a/TensorFlow_eaxmple/Model_train_test/model/Dynamic_channelAttention/Light_channelAttention.py +++ b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/Light_channelAttention.py @@ -64,15 +64,6 @@ class LightChannelAttention(layers.Layer): c1 = tf.keras.layers.BatchNormalization()(c1) s1 = tf.nn.sigmoid(c1) - # # GMP - # GMP = self.GMP(DWC1) - # GMP = tf.expand_dims(GMP, axis=1) - # c2 = self.c2(GMP) - # c2 = tf.keras.layers.BatchNormalization()(c2) - # s2 = tf.nn.sigmoid(c2) - - # print(self.weight_kernel) - # weight_kernel = tf.broadcast_to(self.weight_kernel, shape=[length, channel]) # weight_kernel = tf.broadcast_to(weight_kernel, shape=[batch_size, length, channel]) s1 = tf.broadcast_to(s1, shape=[batch_size, length, channel]) @@ -82,6 +73,42 @@ class LightChannelAttention(layers.Layer): return s1 +class LightChannelAttention1(layers.Layer): + + def __init__(self): + # 调用父类__init__()方法 + super(LightChannelAttention1, self).__init__() + self.DWC = DepthwiseConv1D(kernel_size=1, padding='SAME') + # self.DWC = DepthwiseConv1D(kernel_size=1, padding='causal',dilation_rate=4,data_format='channels_last') + + def build(self, input_shape): + if len(input_shape) != 3: + raise ValueError('Inputs to `DynamicChannelAttention` should have rank 3. ' + 'Received input shape:', str(input_shape)) + + # GAP + self.GAP = tf.keras.layers.GlobalAvgPool1D() + self.c1 = tf.keras.layers.Conv1D(filters=input_shape[2], kernel_size=1, padding='SAME') + + + def call(self, inputs, **kwargs): + batch_size, length, channel = inputs.shape + DWC1 = self.DWC(inputs) + + # GAP + GAP = self.GAP(DWC1) + + GAP = tf.expand_dims(GAP, axis=1) + c1 = self.c1(GAP) + c1 = tf.keras.layers.BatchNormalization()(c1) + s1 = tf.nn.sigmoid(c1) + + + s1 = tf.tile(s1, [1, length, 1]) + + + return s1 * inputs + class DynamicPooling(layers.Layer): def __init__(self, pool_size=2): diff --git a/TensorFlow_eaxmple/Model_train_test/model/Dynamic_channelAttention/SE_channelAttention.py b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/SE_channelAttention.py similarity index 100% rename from TensorFlow_eaxmple/Model_train_test/model/Dynamic_channelAttention/SE_channelAttention.py rename to TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/SE_channelAttention.py diff --git a/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/__init__.py new file mode 100644 index 0000000..e6b6376 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/ChannelAttention/__init__.py @@ -0,0 +1,9 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/12 17:48 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/CommonFunction/CommonFunction.py b/TensorFlow_eaxmple/Model_train_test/model/CommonFunction/CommonFunction.py new file mode 100644 index 0000000..c619e90 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/CommonFunction/CommonFunction.py @@ -0,0 +1,163 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + + +''' +@Author : dingjiawen +@Date : 2022/7/14 17:36 +@Usage : +@Desc : +''' + +import os +import shutil +import tensorflow as tf +import tensorflow.keras as keras +import numpy as np +import pandas as pd + + +def folderGenerate(folder_name): + if not os.path.exists(folder_name): + os.makedirs(folder_name) + # os.mkdir(folder_name) + + +# 递归删除文件夹 +def folderDelete(folder_name): + if os.path.exists(folder_name): + shutil.rmtree(folder_name) + + +# 判断这次是否进行模型保存,history_loss存储历史上的loss +def SaveBestModel(model, save_name, history_loss, loss_value, pattern: str = "min",epoch=0,is_all=False): + weight_folder = save_name[:-7] + if is_all: + weight_folder=weight_folder+'_epoch'+str(epoch)+"_"+str(loss_value) + save_name=weight_folder+save_name[-7:] + + # 如果history_loss为空,那么直接保存 + if len(history_loss) == 0: + folderGenerate(weight_folder) + model.save_weights(save_name) + return + + if pattern == "min": + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.min(history_loss) > loss_value: + # 删除上一次的保存这一次的 + folderDelete(weight_folder) + folderGenerate(weight_folder) + model.save_weights(save_name) + print("保存这次模型") + return + elif pattern == "max": + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.max(history_loss) < loss_value: + # 删除上一次的保存这一次的 + folderDelete(weight_folder) + folderGenerate(weight_folder) + model.save_weights(save_name) + print("保存这次模型") + return + else: + raise ValueError("算法尚未实现") + + pass + + +# 判断这次是否进行模型保存,history_loss存储历史上的loss +def SaveBestModelByAccuracy(model, save_name, history_accuracy, accuracy_value): + weight_folder = save_name[:-7] + + # 如果history_loss为空,那么直接保存 + if len(history_accuracy) == 0: + folderGenerate(weight_folder) + model.save_weights(save_name) + return + + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.max(history_accuracy) < accuracy_value: + # 删除上一次的保存这一次的 + folderDelete(weight_folder) + folderGenerate(weight_folder) + model.save_weights(save_name) + print("保存这次模型") + return + + pass + + +# 判断这次是否进行模型保存,history_loss存储历史上的loss +def SaveBestH5Model(model: tf.keras.Model, save_name, history_loss, loss_value): + dirpath = os.path.dirname(save_name) + folderGenerate(dirpath) + # 如果history_loss为空,那么直接保存 + if len(history_loss) == 0: + model.save(save_name) + return + + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.min(history_loss) > loss_value: + # 删除上一次的保存这一次的 + model.save(save_name, overwrite=True) + print("保存这次模型") + return + + pass + + +def IsStopTraining(history_loss, patience=5, pattern: str = "min"): + if len(history_loss) <= patience: + return False + if pattern == "min": + for i in range(1, patience): + if history_loss[-(patience + 1)] > history_loss[-i]: + return False + elif pattern == "max": + for i in range(1, patience): + if history_loss[-(patience + 1)] > history_loss[-i]: + return False + else: + raise ValueError("算法尚未实现") + print(patience, "次loss未下降,训练停止") + return True + + +def shuffle(data, label): + label = tf.expand_dims(label, axis=-1) + total = tf.concat([data, label], axis=-1) + total = tf.random.shuffle(total) + data = total[:, :, :-1] + label = total[:, :, -1] + return data, label + + +def splitValData(data, label, val_radio=0.2): + size, filter_num, dims = data.shape + val_data = data[:int(size * val_radio), :, :] + train_data = data[int(size * val_radio):, :, :] + val_label = label[:int(size * val_radio), :] + train_label = label[int(size * val_radio):, :] + val_query = tf.expand_dims(val_label, axis=-1) + train_query = tf.expand_dims(train_label, axis=-1) + + return (train_data, train_label, train_query), (val_data, val_label, val_query) + + +def Is_Reduce_learning_rate(history_loss, patience=3, pattern: str = "min"): + if len(history_loss) <= patience: + return False + if pattern == "min": + for i in range(patience): + if history_loss[-(patience + 1)] > history_loss[-i]: + return False + elif pattern == "max": + for i in range(patience): + if history_loss[-(patience + 1)] < history_loss[-i]: + return False + else: + raise ValueError("算法尚未实现") + print(patience, "次loss未下降,降低学习率") + return True \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/CommonFunction/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/CommonFunction/__init__.py new file mode 100644 index 0000000..eeabec8 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/CommonFunction/__init__.py @@ -0,0 +1,9 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/14 17:36 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/DepthwiseCon1D/DepthwiseConv1D.py b/TensorFlow_eaxmple/Model_train_test/model/DepthwiseCon1D/DepthwiseConv1D.py new file mode 100644 index 0000000..d3217af --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/DepthwiseCon1D/DepthwiseConv1D.py @@ -0,0 +1,247 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/12 16:59 +@Usage : +@Desc : +''' +import tensorflow as tf +from tensorflow.python.framework import tensor_shape +from tensorflow.python.keras import models, layers, initializers, regularizers, constraints +from tensorflow.python.keras.layers import Conv1D +from tensorflow.python.keras.engine.input_spec import InputSpec +from tensorflow.python.keras.utils import conv_utils +from tensorflow.python.keras.utils import tf_utils +from tensorflow.python.keras import backend +from tensorflow.python.ops import array_ops +from tensorflow.python.ops import nn +from tensorflow.python.ops import nn_ops +from tensorflow.python.util.tf_export import keras_export + +""" + Depthwise separable 1D convolution. + Depthwise Separable convolutions consists in performing + just the first step in a depthwise spatial convolution + (which acts on each input channel separately). + The `depth_multiplier` argument controls how many + output channels are generated per input channel in the depthwise step. + Arguments: + kernel_size: An integer, specifying the + length of the 1D convolution window. + strides: An integer specifying the strides of the convolution. + padding: one of `'valid'` or `'same'` (case-insensitive). + common_kernel: if set to True, same kernel is applied to each channel, + if False, separate kernel is applied to each channel (default case) + depth_multiplier: The number of depthwise convolution output channels + for each input channel. + The total number of depthwise convolution output + channels will be equal to `filters_in * depth_multiplier`. + data_format: A string, + one of `channels_last` (default) or `channels_first`. + The ordering of the dimensions in the inputs. + `channels_last` corresponds to inputs with shape + `(batch_size, length, channels)` while `channels_first` + corresponds to inputs with shape + `(batch_size, channels, length)`. + It defaults to the `image_data_format` value found in your + Keras config file at `~/.keras/keras.json`. + If you never set it, then it will be 'channels_last'. + activation: Activation function to use. + If you don't specify anything, no activation is applied ( + see `keras.activations`). + use_bias: Boolean, whether the layer uses a bias vector. + depthwise_initializer: Initializer for the depthwise kernel matrix ( + see `keras.initializers`). + bias_initializer: Initializer for the bias vector ( + see `keras.initializers`). + depthwise_regularizer: Regularizer function applied to + the depthwise kernel matrix (see `keras.regularizers`). + bias_regularizer: Regularizer function applied to the bias vector ( + see `keras.regularizers`). + activity_regularizer: Regularizer function applied to + the output of the layer (its 'activation') ( + see `keras.regularizers`). + depthwise_constraint: Constraint function applied to + the depthwise kernel matrix ( + see `keras.constraints`). + bias_constraint: Constraint function applied to the bias vector ( + see `keras.constraints`). + Input shape: + 3D tensor with shape: + `[batch_size, channels, length]` if data_format='channels_first' + or 3D tensor with shape: + `[batch_size, length, channels]` if data_format='channels_last'. + Output shape: + 3D tensor with shape: + `[batch_size, filters, new_length]` if data_format='channels_first' + or 3D tensor with shape: + `[batch_size, new_length, filters]` if data_format='channels_last'. + `length` value might have changed due to padding. + Returns: + A tensor of rank 3 representing + `activation(depthwiseconv1d(inputs, kernel) + bias)`. + """ + + +class DepthwiseConv1D(Conv1D): + def __init__(self, + kernel_size, + strides=1, + padding='valid', + common_kernel=False, + depth_multiplier=1, + data_format=None, + activation=None, + use_bias=True, + depthwise_initializer='glorot_uniform', + bias_initializer='zeros', + depthwise_regularizer=None, + bias_regularizer=None, + activity_regularizer=None, + depthwise_constraint=None, + bias_constraint=None, + dilation_rate=1, + **kwargs): + super(DepthwiseConv1D, self).__init__( + filters=None, + kernel_size=kernel_size, + strides=strides, + padding=padding, + data_format=data_format, + activation=activation, + use_bias=use_bias, + bias_regularizer=bias_regularizer, + activity_regularizer=activity_regularizer, + bias_constraint=bias_constraint, + **kwargs) + + self.common_kernel = common_kernel + self.depth_multiplier = depth_multiplier + self.depthwise_initializer = initializers.get(depthwise_initializer) + self.depthwise_regularizer = regularizers.get(depthwise_regularizer) + self.depthwise_constraint = constraints.get(depthwise_constraint) + self.bias_initializer = initializers.get(bias_initializer) + self.dilation_rate = (dilation_rate,dilation_rate) + + # For compatibility with some older versions of Keras + def _get_channel_axis(self): + if self.data_format == 'channels_first': + return 1 + else: + return -1 + + def build(self, input_shape): + if len(input_shape) != 3: + raise ValueError('Inputs to `DepthwiseConv1D` should have rank 3. ' + 'Received input shape:', str(input_shape)) + input_shape = tensor_shape.TensorShape(input_shape) + channel_axis = self._get_channel_axis() + if input_shape.dims[channel_axis].value is None: + raise ValueError('The channel dimension of the inputs to ' + '`DepthwiseConv1D` should be defined. Found `None`.') + input_dim = int(input_shape[channel_axis]) + kernel_dim = 1 if self.common_kernel == True else input_dim + depthwise_kernel_shape = (self.kernel_size[0], kernel_dim, self.depth_multiplier) + + self.channels = input_dim + + self.depthwise_kernel = self.add_weight( + shape=depthwise_kernel_shape, + initializer=self.depthwise_initializer, + name='depthwise_kernel', + regularizer=self.depthwise_regularizer, + constraint=self.depthwise_constraint) + + if self.use_bias: + self.bias = self.add_weight(shape=(kernel_dim * self.depth_multiplier,), + initializer=self.bias_initializer, + name='bias', + regularizer=self.bias_regularizer, + constraint=self.bias_constraint) + else: + self.bias = None + self.input_spec = InputSpec(ndim=3, axes={channel_axis: input_dim}) + self.built = True + + def call(self, inputs): + if self.padding == 'causal': + inputs = array_ops.pad(inputs, self._compute_causal_padding()) + if self.data_format == 'channels_last': + strides = (1,) + self.strides * 2 + (1,) + spatial_start_dim = 1 + else: + strides = (1, 1) + self.strides * 2 + spatial_start_dim = 2 + + # Explicitly broadcast inputs and kernels to 4D. + inputs = array_ops.expand_dims(inputs, spatial_start_dim) + + if self.common_kernel == True: + # Need to replicate kernel {channels} times over axis 1 + dw_kernel = tf.tile(self.depthwise_kernel, (1, self.channels, 1)) + bias_kernel = tf.tile(self.bias, (self.channels,)) + else: + dw_kernel = self.depthwise_kernel + bias_kernel = self.bias + + dw_kernel = array_ops.expand_dims(dw_kernel, 0) + + if self.padding == 'causal': + op_padding = 'valid' + else: + op_padding = self.padding + outputs = nn.depthwise_conv2d( + inputs, + dw_kernel, + strides=strides, + padding=op_padding.upper(), + data_format=conv_utils.convert_data_format(self.data_format, ndim=4)) + # outputs = backend.depthwise_conv2d( + # inputs, + # dw_kernel, + # strides=strides, + # padding=op_padding.upper(), + # dilation_rate=self.dilation_rate, + # data_format='channels_last') + + outputs = array_ops.squeeze(outputs, [spatial_start_dim]) + + if self.use_bias: + outputs = backend.bias_add(outputs, bias_kernel, data_format=self.data_format) + + if self.activation is not None: + return self.activation(outputs) + + return outputs + + @tf_utils.shape_type_conversion + def compute_output_shape(self, input_shape): + if self.data_format == 'channels_first': + length = input_shape[2] + out_filters = input_shape[1] * self.depth_multiplier + elif self.data_format == 'channels_last': + length = input_shape[1] + out_filters = input_shape[2] * self.depth_multiplier + + length_new = conv_utils.conv_output_length(length, self.kernel_size, + self.padding, + self.strides) + + if self.data_format == 'channels_first': + return (input_shape[0], out_filters, length_new) + elif self.data_format == 'channels_last': + return (input_shape[0], length_new, out_filters) + + def get_config(self): + config = super(DepthwiseConv1D, self).get_config() + config.pop('filters') + config.pop('kernel_initializer') + config.pop('kernel_regularizer') + config.pop('kernel_constraint') + config['depth_multiplier'] = self.depth_multiplier + config['depthwise_initializer'] = initializers.serialize(self.depthwise_initializer) + config['depthwise_regularizer'] = regularizers.serialize(self.depthwise_regularizer) + config['depthwise_constraint'] = constraints.serialize(self.depthwise_constraint) + return config \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/DepthwiseCon1D/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/DepthwiseCon1D/__init__.py new file mode 100644 index 0000000..d7df0ff --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/DepthwiseCon1D/__init__.py @@ -0,0 +1,9 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/12 16:59 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring.py b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring.py new file mode 100644 index 0000000..87b0ac4 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring.py @@ -0,0 +1,402 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/14 9:40 +@Usage : 联合监测模型 +@Desc : 将CNN特征提取结果放入分类器 +''' + +import tensorflow as tf +import tensorflow.keras as keras +from tensorflow.keras import * +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D +from model.Dynamic_channelAttention.Dynamic_channelAttention import DynamicChannelAttention, DynamicPooling +from condition_monitoring.data_deal import loadData +from model.LossFunction.smooth_L1_Loss import SmoothL1Loss + + +class Joint_Monitoring(keras.Model): + + def __init__(self, conv_filter=20): + # 调用父类__init__()方法 + super(Joint_Monitoring, self).__init__() + # step one + self.RepDCBlock1 = RevConvBlock(num=3, kernel_size=5) + self.conv1 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=1, strides=2, padding='SAME') + self.upsample1 = tf.keras.layers.UpSampling1D(size=2) + + self.DACU2 = DynamicChannelAttention() + self.RepDCBlock2 = RevConvBlock(num=3, kernel_size=3) + self.conv2 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=1, strides=2, padding='SAME') + self.upsample2 = tf.keras.layers.UpSampling1D(size=2) + + self.DACU3 = DynamicChannelAttention() + self.RepDCBlock3 = RevConvBlock(num=3, kernel_size=3) + self.p1 = DynamicPooling(pool_size=2) + self.conv3 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=3, strides=2, padding='SAME') + + self.DACU4 = DynamicChannelAttention() + self.RepDCBlock4 = RevConvBlock(num=3, kernel_size=3) + self.p2 = DynamicPooling(pool_size=4) + self.conv4 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=3, strides=2, padding='SAME') + + self.RepDCBlock5 = RevConvBlock(num=3, kernel_size=3) + self.p3 = DynamicPooling(pool_size=2) + + # step two + # 重现原数据 + self.GRU1 = tf.keras.layers.GRU(128, return_sequences=False) + self.d1 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output1 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + self.GRU2 = tf.keras.layers.GRU(128, return_sequences=False) + self.d2 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output2 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + self.GRU3 = tf.keras.layers.GRU(128, return_sequences=False) + self.d3 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output3 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + # step three + # 分类器 + self.d4 = tf.keras.layers.Dense(1024, activation=tf.nn.leaky_relu) + self.d5 = tf.keras.layers.Dense(512, activation=tf.nn.leaky_relu) + # tf.nn.softmax + self.output4 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid) + + # loss + self.train_loss = [] + + def call(self, inputs, training=None, mask=None, is_first_time: bool = True): + # step one + RepDCBlock1 = self.RepDCBlock1(inputs) + RepDCBlock1 = tf.keras.layers.BatchNormalization()(RepDCBlock1) + conv1 = self.conv1(RepDCBlock1) + conv1 = tf.nn.leaky_relu(conv1) + conv1 = tf.keras.layers.BatchNormalization()(conv1) + upsample1 = self.upsample1(conv1) + + DACU2 = self.DACU2(upsample1) + DACU2 = tf.keras.layers.BatchNormalization()(DACU2) + RepDCBlock2 = self.RepDCBlock2(DACU2) + RepDCBlock2 = tf.keras.layers.BatchNormalization()(RepDCBlock2) + conv2 = self.conv2(RepDCBlock2) + conv2 = tf.nn.leaky_relu(conv2) + conv2 = tf.keras.layers.BatchNormalization()(conv2) + upsample2 = self.upsample2(conv2) + + DACU3 = self.DACU3(upsample2) + DACU3 = tf.keras.layers.BatchNormalization()(DACU3) + RepDCBlock3 = self.RepDCBlock3(DACU3) + RepDCBlock3 = tf.keras.layers.BatchNormalization()(RepDCBlock3) + conv3 = self.conv3(RepDCBlock3) + conv3 = tf.nn.leaky_relu(conv3) + conv3 = tf.keras.layers.BatchNormalization()(conv3) + + concat1 = tf.concat([conv2, conv3], axis=1) + + DACU4 = self.DACU4(concat1) + DACU4 = tf.keras.layers.BatchNormalization()(DACU4) + RepDCBlock4 = self.RepDCBlock4(DACU4) + RepDCBlock4 = tf.keras.layers.BatchNormalization()(RepDCBlock4) + conv4 = self.conv4(RepDCBlock4) + conv4 = tf.nn.leaky_relu(conv4) + conv4 = tf.keras.layers.BatchNormalization()(conv4) + + concat2 = tf.concat([conv1, conv4], axis=1) + + RepDCBlock5 = self.RepDCBlock5(concat2) + RepDCBlock5 = tf.keras.layers.BatchNormalization()(RepDCBlock5) + + output1 = [] + output2 = [] + output3 = [] + output4 = [] + + if is_first_time: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + else: + # 多尺度动态池化 + # 多尺度动态池化 + p1 = self.p1(RepDCBlock3) + B, _, _ = p1.shape + f1 = tf.reshape(p1, shape=[B, -1]) + p2 = self.p2(RepDCBlock4) + f2 = tf.reshape(p2, shape=[B, -1]) + p3 = self.p3(RepDCBlock5) + f3 = tf.reshape(p3, shape=[B, -1]) + # step three + # 分类器 + concat3 = tf.concat([f1, f2, f3], axis=0) + d4 = self.d4(concat3) + d4 = tf.keras.layers.BatchNormalization()(d4) + output4 = self.output4(d4) + + return RepDCBlock3, RepDCBlock4, RepDCBlock5, output4 + + def get_loss(self, inputs_tensor, label1=None, label2=None, is_first_time: bool = True, pred_3=None, pred_4=None, + pred_5=None): + # step one + RepDCBlock1 = self.RepDCBlock1(inputs_tensor) + RepDCBlock1 = tf.keras.layers.BatchNormalization()(RepDCBlock1) + conv1 = self.conv1(RepDCBlock1) + conv1 = tf.nn.leaky_relu(conv1) + conv1 = tf.keras.layers.BatchNormalization()(conv1) + upsample1 = self.upsample1(conv1) + + DACU2 = self.DACU2(upsample1) + DACU2 = tf.keras.layers.BatchNormalization()(DACU2) + RepDCBlock2 = self.RepDCBlock2(DACU2) + RepDCBlock2 = tf.keras.layers.BatchNormalization()(RepDCBlock2) + conv2 = self.conv2(RepDCBlock2) + conv2 = tf.nn.leaky_relu(conv2) + conv2 = tf.keras.layers.BatchNormalization()(conv2) + upsample2 = self.upsample2(conv2) + + DACU3 = self.DACU3(upsample2) + DACU3 = tf.keras.layers.BatchNormalization()(DACU3) + RepDCBlock3 = self.RepDCBlock3(DACU3) + RepDCBlock3 = tf.keras.layers.BatchNormalization()(RepDCBlock3) + conv3 = self.conv3(RepDCBlock3) + conv3 = tf.nn.leaky_relu(conv3) + conv3 = tf.keras.layers.BatchNormalization()(conv3) + + concat1 = tf.concat([conv2, conv3], axis=1) + + DACU4 = self.DACU4(concat1) + DACU4 = tf.keras.layers.BatchNormalization()(DACU4) + RepDCBlock4 = self.RepDCBlock4(DACU4) + RepDCBlock4 = tf.keras.layers.BatchNormalization()(RepDCBlock4) + conv4 = self.conv4(RepDCBlock4) + conv4 = tf.nn.leaky_relu(conv4) + conv4 = tf.keras.layers.BatchNormalization()(conv4) + + concat2 = tf.concat([conv1, conv4], axis=1) + + RepDCBlock5 = self.RepDCBlock5(concat2) + RepDCBlock5 = tf.keras.layers.BatchNormalization()(RepDCBlock5) + + if is_first_time: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # reduce_mean降维计算均值 + MSE_loss1 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output1)) + MSE_loss2 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output2)) + MSE_loss3 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output3)) + + print("MSE_loss1:", MSE_loss1.numpy()) + print("MSE_loss2:", MSE_loss2.numpy()) + print("MSE_loss3:", MSE_loss3.numpy()) + loss = MSE_loss1 + MSE_loss2 + MSE_loss3 + else: + # 多尺度动态池化 + p1 = self.p1(RepDCBlock3) + B, _, _ = p1.shape + f1 = tf.reshape(p1, shape=[B, -1]) + p2 = self.p2(RepDCBlock4) + f2 = tf.reshape(p2, shape=[B, -1]) + p3 = self.p3(RepDCBlock5) + f3 = tf.reshape(p3, shape=[B, -1]) + # step three + # 分类器 + concat3 = tf.concat([f1, f2, f3], axis=1) + # dropout = tf.keras.layers.Dropout(0.25)(concat3) + d4 = self.d4(concat3) + d5 = self.d5(d4) + # d4 = tf.keras.layers.BatchNormalization()(d4) + output4 = self.output4(d5) + + # reduce_mean降维计算均值 + MSE_loss = SmoothL1Loss()(y_true=pred_3, y_pred=RepDCBlock3) + MSE_loss += SmoothL1Loss()(y_true=pred_4, y_pred=RepDCBlock4) + MSE_loss += SmoothL1Loss()(y_true=pred_5, y_pred=RepDCBlock5) + Cross_Entropy_loss = tf.reduce_mean( + tf.losses.binary_crossentropy(y_true=label2, y_pred=output4, from_logits=True)) + + print("MSE_loss:", MSE_loss.numpy()) + print("Cross_Entropy_loss:", Cross_Entropy_loss.numpy()) + Accuracy_num = self.get_Accuracy(label=label2, output=output4) + loss = MSE_loss + 100 * Cross_Entropy_loss + return loss, Accuracy_num + + def get_Accuracy(self, output, label): + + predict_label = tf.round(output) + label = tf.cast(label, dtype=tf.float32) + + t = np.array(label - predict_label) + + b = t[t[:] == 0] + + return b.__len__() + + def get_grad(self, input_tensor, label1=None, label2=None, is_first_time: bool = True, pred_3=None, pred_4=None, + pred_5=None): + with tf.GradientTape() as tape: + # todo 原本tape只会监控由tf.Variable创建的trainable=True属性 + # tape.watch(self.variables) + L, Accuracy_num = self.get_loss(input_tensor, label1=label1, label2=label2, is_first_time=is_first_time, + pred_3=pred_3, + pred_4=pred_4, pred_5=pred_5) + # 保存一下loss,用于输出 + self.train_loss = L + g = tape.gradient(L, self.variables) + return g, Accuracy_num + + def train(self, input_tensor, label1=None, label2=None, learning_rate=1e-3, is_first_time: bool = True, pred_3=None, + pred_4=None, pred_5=None): + g, Accuracy_num = self.get_grad(input_tensor, label1=label1, label2=label2, is_first_time=is_first_time, + pred_3=pred_3, + pred_4=pred_4, pred_5=pred_5) + optimizers.Adam(learning_rate).apply_gradients(zip(g, self.variables)) + return self.train_loss, Accuracy_num + + # 暂时只支持batch_size等于1,不然要传z比较麻烦 + def get_val_loss(self, val_data, val_label1, val_label2, batch_size=16, is_first_time: bool = True, + step_one_model=None): + val_loss = [] + accuracy_num = 0 + size, length, dims = val_data.shape + if batch_size == None: + batch_size = self.batch_size + for epoch in range(0, size - batch_size, batch_size): + each_val_data = val_data[epoch:epoch + batch_size, :, :] + each_val_label1 = val_label1[epoch:epoch + batch_size, :] + each_val_label2 = val_label2[epoch:epoch + batch_size, ] + # each_val_data = tf.expand_dims(each_val_data, axis=0) + # each_val_query = tf.expand_dims(each_val_query, axis=0) + # each_val_label = tf.expand_dims(each_val_label, axis=0) + if not is_first_time: + output1, output2, output3, _ = step_one_model.call(inputs=each_val_data, is_first_time=True) + + each_loss, each_accuracy_num = self.get_loss(each_val_data, each_val_label1, each_val_label2, + is_first_time=is_first_time, + pred_3=output1, pred_4=output2, pred_5=output3) + accuracy_num += each_accuracy_num + val_loss.append(each_loss) + val_accuracy = accuracy_num / (epoch - 1) * batch_size + val_total_loss = tf.reduce_mean(val_loss) + return val_total_loss, val_accuracy + + +class RevConv(keras.layers.Layer): + + def __init__(self, kernel_size=3): + # 调用父类__init__()方法 + super(RevConv, self).__init__() + self.kernel_size = kernel_size + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_size': self.kernel_size + } + ) + base_config = super(RevConv, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + # print(input_shape) + _, _, output_dim = input_shape[0], input_shape[1], input_shape[2] + self.conv1 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=self.kernel_size, strides=1, + padding='causal', + dilation_rate=4) + + self.conv2 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=1, strides=1, padding='causal', + dilation_rate=4) + # self.b2 = tf.keras.layers.BatchNormalization() + + # self.b3 = tf.keras.layers.BatchNormalization() + + # out = tf.keras.layers.Add()([b1, b2, b3]) + # out = tf.nn.relu(out) + + def call(self, inputs, **kwargs): + conv1 = self.conv1(inputs) + b1 = tf.keras.layers.BatchNormalization()(conv1) + b1 = tf.nn.leaky_relu(b1) + # b1 = self.b1 + + conv2 = self.conv2(inputs) + b2 = tf.keras.layers.BatchNormalization()(conv2) + b2 = tf.nn.leaky_relu(b2) + + b3 = tf.keras.layers.BatchNormalization()(inputs) + + out = tf.keras.layers.Add()([b1, b2, b3]) + out = tf.nn.relu(out) + + return out + + +class RevConvBlock(keras.layers.Layer): + + def __init__(self, num: int = 3, kernel_size=3): + # 调用父类__init__()方法 + super(RevConvBlock, self).__init__() + self.num = num + self.kernel_size = kernel_size + self.L = [] + for i in range(num): + RepVGG = RevConv(kernel_size=kernel_size) + self.L.append(RepVGG) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_size': self.kernel_size, + 'num': self.num + } + ) + base_config = super(RevConvBlock, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, **kwargs): + for i in range(self.num): + inputs = self.L[i](inputs) + return inputs diff --git a/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring2.py b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring2.py new file mode 100644 index 0000000..440c3b5 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring2.py @@ -0,0 +1,445 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/14 9:40 +@Usage : 联合监测模型 +@Desc : 将预测值放入分类器,已测试,准确率可以到99.7% ,dense层300后直接接output,cross_entropy Loss还放大了一百倍 +''' + +import tensorflow as tf +import tensorflow.keras as keras +from tensorflow.keras import * +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D +from model.Dynamic_channelAttention.Dynamic_channelAttention import DynamicChannelAttention, DynamicPooling +from condition_monitoring.data_deal import loadData +from model.LossFunction.smooth_L1_Loss import SmoothL1Loss + + +class Joint_Monitoring(keras.Model): + + def __init__(self, conv_filter=20): + # 调用父类__init__()方法 + super(Joint_Monitoring, self).__init__() + # step one + self.RepDCBlock1 = RevConvBlock(num=3, kernel_size=5) + self.conv1 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=1, strides=2, padding='SAME') + self.upsample1 = tf.keras.layers.UpSampling1D(size=2) + + self.DACU2 = DynamicChannelAttention() + self.RepDCBlock2 = RevConvBlock(num=3, kernel_size=3) + self.conv2 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=1, strides=2, padding='SAME') + self.upsample2 = tf.keras.layers.UpSampling1D(size=2) + + self.DACU3 = DynamicChannelAttention() + self.RepDCBlock3 = RevConvBlock(num=3, kernel_size=3) + self.p1 = DynamicPooling(pool_size=2) + self.conv3 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=3, strides=2, padding='SAME') + + self.DACU4 = DynamicChannelAttention() + self.RepDCBlock4 = RevConvBlock(num=3, kernel_size=3) + self.p2 = DynamicPooling(pool_size=4) + self.conv4 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=3, strides=2, padding='SAME') + + self.RepDCBlock5 = RevConvBlock(num=3, kernel_size=3) + self.p3 = DynamicPooling(pool_size=2) + + # step two + # 重现原数据 + self.GRU1 = tf.keras.layers.GRU(128, return_sequences=False) + self.d1 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output1 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + self.GRU2 = tf.keras.layers.GRU(128, return_sequences=False) + self.d2 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output2 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + self.GRU3 = tf.keras.layers.GRU(128, return_sequences=False) + self.d3 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output3 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + # step three + # 分类器 + self.d4 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.d5 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + # tf.nn.softmax + self.output4 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid) + + # loss + self.train_loss = [] + + def call(self, inputs, training=None, mask=None, is_first_time: bool = True): + # step one + RepDCBlock1 = self.RepDCBlock1(inputs) + RepDCBlock1 = tf.keras.layers.BatchNormalization()(RepDCBlock1) + conv1 = self.conv1(RepDCBlock1) + conv1 = tf.nn.leaky_relu(conv1) + conv1 = tf.keras.layers.BatchNormalization()(conv1) + upsample1 = self.upsample1(conv1) + + DACU2 = self.DACU2(upsample1) + DACU2 = tf.keras.layers.BatchNormalization()(DACU2) + RepDCBlock2 = self.RepDCBlock2(DACU2) + RepDCBlock2 = tf.keras.layers.BatchNormalization()(RepDCBlock2) + conv2 = self.conv2(RepDCBlock2) + conv2 = tf.nn.leaky_relu(conv2) + conv2 = tf.keras.layers.BatchNormalization()(conv2) + upsample2 = self.upsample2(conv2) + + DACU3 = self.DACU3(upsample2) + DACU3 = tf.keras.layers.BatchNormalization()(DACU3) + RepDCBlock3 = self.RepDCBlock3(DACU3) + RepDCBlock3 = tf.keras.layers.BatchNormalization()(RepDCBlock3) + conv3 = self.conv3(RepDCBlock3) + conv3 = tf.nn.leaky_relu(conv3) + conv3 = tf.keras.layers.BatchNormalization()(conv3) + + concat1 = tf.concat([conv2, conv3], axis=1) + + DACU4 = self.DACU4(concat1) + DACU4 = tf.keras.layers.BatchNormalization()(DACU4) + RepDCBlock4 = self.RepDCBlock4(DACU4) + RepDCBlock4 = tf.keras.layers.BatchNormalization()(RepDCBlock4) + conv4 = self.conv4(RepDCBlock4) + conv4 = tf.nn.leaky_relu(conv4) + conv4 = tf.keras.layers.BatchNormalization()(conv4) + + concat2 = tf.concat([conv1, conv4], axis=1) + + RepDCBlock5 = self.RepDCBlock5(concat2) + RepDCBlock5 = tf.keras.layers.BatchNormalization()(RepDCBlock5) + + output1 = [] + output2 = [] + output3 = [] + output4 = [] + + if is_first_time: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + else: + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # 多尺度动态池化 + # p1 = self.p1(output1) + # B, _, _ = p1.shape + # f1 = tf.reshape(p1, shape=[B, -1]) + # p2 = self.p2(output2) + # f2 = tf.reshape(p2, shape=[B, -1]) + # p3 = self.p3(output3) + # f3 = tf.reshape(p3, shape=[B, -1]) + # step three + # 分类器 + concat3 = tf.concat([output1, output2, output3], axis=1) + # dropout = tf.keras.layers.Dropout(0.25)(concat3) + d4 = self.d4(concat3) + # d5 = self.d5(d4) + # d4 = tf.keras.layers.BatchNormalization()(d4) + output4 = self.output4(d4) + + return output1, output2, output3, output4 + + def get_loss(self, inputs_tensor, label1=None, label2=None, is_first_time: bool = True, pred_3=None, pred_4=None, + pred_5=None): + # step one + RepDCBlock1 = self.RepDCBlock1(inputs_tensor) + RepDCBlock1 = tf.keras.layers.BatchNormalization()(RepDCBlock1) + conv1 = self.conv1(RepDCBlock1) + conv1 = tf.nn.leaky_relu(conv1) + conv1 = tf.keras.layers.BatchNormalization()(conv1) + upsample1 = self.upsample1(conv1) + + DACU2 = self.DACU2(upsample1) + DACU2 = tf.keras.layers.BatchNormalization()(DACU2) + RepDCBlock2 = self.RepDCBlock2(DACU2) + RepDCBlock2 = tf.keras.layers.BatchNormalization()(RepDCBlock2) + conv2 = self.conv2(RepDCBlock2) + conv2 = tf.nn.leaky_relu(conv2) + conv2 = tf.keras.layers.BatchNormalization()(conv2) + upsample2 = self.upsample2(conv2) + + DACU3 = self.DACU3(upsample2) + DACU3 = tf.keras.layers.BatchNormalization()(DACU3) + RepDCBlock3 = self.RepDCBlock3(DACU3) + RepDCBlock3 = tf.keras.layers.BatchNormalization()(RepDCBlock3) + conv3 = self.conv3(RepDCBlock3) + conv3 = tf.nn.leaky_relu(conv3) + conv3 = tf.keras.layers.BatchNormalization()(conv3) + + concat1 = tf.concat([conv2, conv3], axis=1) + + DACU4 = self.DACU4(concat1) + DACU4 = tf.keras.layers.BatchNormalization()(DACU4) + RepDCBlock4 = self.RepDCBlock4(DACU4) + RepDCBlock4 = tf.keras.layers.BatchNormalization()(RepDCBlock4) + conv4 = self.conv4(RepDCBlock4) + conv4 = tf.nn.leaky_relu(conv4) + conv4 = tf.keras.layers.BatchNormalization()(conv4) + + concat2 = tf.concat([conv1, conv4], axis=1) + + RepDCBlock5 = self.RepDCBlock5(concat2) + RepDCBlock5 = tf.keras.layers.BatchNormalization()(RepDCBlock5) + + if is_first_time: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # reduce_mean降维计算均值 + MSE_loss1 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output1)) + MSE_loss2 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output2)) + MSE_loss3 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output3)) + + print("MSE_loss1:", MSE_loss1.numpy()) + print("MSE_loss2:", MSE_loss2.numpy()) + print("MSE_loss3:", MSE_loss3.numpy()) + loss = MSE_loss1 + MSE_loss2 + MSE_loss3 + Accuracy_num=0 + else: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # 多尺度动态池化 + # p1 = self.p1(output1) + # B, _, _ = p1.shape + # f1 = tf.reshape(p1, shape=[B, -1]) + # p2 = self.p2(output2) + # f2 = tf.reshape(p2, shape=[B, -1]) + # p3 = self.p3(output3) + # f3 = tf.reshape(p3, shape=[B, -1]) + # step three + # 分类器 + concat3 = tf.concat([output1, output2, output3], axis=1) + # dropout = tf.keras.layers.Dropout(0.25)(concat3) + d4 = self.d4(concat3) + # d5=self.d5(d4) + # d4 = tf.keras.layers.BatchNormalization()(d4) + output4 = self.output4(d4) + + # reduce_mean降维计算均值 + MSE_loss = SmoothL1Loss()(y_true=pred_3, y_pred=output1) + MSE_loss += SmoothL1Loss()(y_true=pred_4, y_pred=output2) + MSE_loss += SmoothL1Loss()(y_true=pred_5, y_pred=output3) + Cross_Entropy_loss = tf.reduce_mean( + tf.losses.binary_crossentropy(y_true=label2, y_pred=output4, from_logits=True)) + + print("MSE_loss:", MSE_loss.numpy()) + print("Cross_Entropy_loss:", Cross_Entropy_loss.numpy()) + Accuracy_num = self.get_Accuracy(label=label2, output=output4) + loss = MSE_loss + Cross_Entropy_loss + + return loss, Accuracy_num + + def get_Accuracy(self, output, label): + + predict_label = tf.round(output) + label = tf.cast(label, dtype=tf.float32) + + t = np.array(label - predict_label) + + b = t[t[:] == 0] + + return b.__len__() + + def get_grad(self, input_tensor, label1=None, label2=None, is_first_time: bool = True, pred_3=None, pred_4=None, + pred_5=None): + with tf.GradientTape() as tape: + # todo 原本tape只会监控由tf.Variable创建的trainable=True属性 + # tape.watch(self.variables) + L, Accuracy_num = self.get_loss(input_tensor, label1=label1, label2=label2, is_first_time=is_first_time, + pred_3=pred_3, + pred_4=pred_4, pred_5=pred_5) + # 保存一下loss,用于输出 + self.train_loss = L + g = tape.gradient(L, self.variables) + return g, Accuracy_num + + def train(self, input_tensor, label1=None, label2=None, learning_rate=1e-3, is_first_time: bool = True, pred_3=None, + pred_4=None, pred_5=None): + g, Accuracy_num = self.get_grad(input_tensor, label1=label1, label2=label2, is_first_time=is_first_time, + pred_3=pred_3, + pred_4=pred_4, pred_5=pred_5) + optimizers.Adam(learning_rate).apply_gradients(zip(g, self.variables)) + return self.train_loss, Accuracy_num + + # 暂时只支持batch_size等于1,不然要传z比较麻烦 + def get_val_loss(self, val_data, val_label1, val_label2, batch_size=16, is_first_time: bool = True, + step_one_model=None): + val_loss = [] + accuracy_num = 0 + size, length, dims = val_data.shape + if batch_size == None: + batch_size = self.batch_size + for epoch in range(0, size - batch_size, batch_size): + each_val_data = val_data[epoch:epoch + batch_size, :, :] + each_val_label1 = val_label1[epoch:epoch + batch_size, :] + each_val_label2 = val_label2[epoch:epoch + batch_size, ] + # each_val_data = tf.expand_dims(each_val_data, axis=0) + # each_val_query = tf.expand_dims(each_val_query, axis=0) + # each_val_label = tf.expand_dims(each_val_label, axis=0) + if not is_first_time: + output1, output2, output3, _ = step_one_model.call(inputs=each_val_data, is_first_time=True) + + each_loss, each_accuracy_num = self.get_loss(each_val_data, each_val_label1, each_val_label2, + is_first_time=is_first_time, + pred_3=output1, pred_4=output2, pred_5=output3) + accuracy_num += each_accuracy_num + val_loss.append(each_loss) + # print(accuracy_num) + val_accuracy = accuracy_num / (epoch+1) * batch_size + val_total_loss = tf.reduce_mean(val_loss) + return val_total_loss, val_accuracy + + +class RevConv(keras.layers.Layer): + + def __init__(self, kernel_size=3): + # 调用父类__init__()方法 + super(RevConv, self).__init__() + self.kernel_size = kernel_size + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_size': self.kernel_size + } + ) + base_config = super(RevConv, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + # print(input_shape) + _, _, output_dim = input_shape[0], input_shape[1], input_shape[2] + self.conv1 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=self.kernel_size, strides=1, + padding='causal', + dilation_rate=4) + + self.conv2 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=1, strides=1, padding='causal', + dilation_rate=4) + # self.b2 = tf.keras.layers.BatchNormalization() + + # self.b3 = tf.keras.layers.BatchNormalization() + + # out = tf.keras.layers.Add()([b1, b2, b3]) + # out = tf.nn.relu(out) + + def call(self, inputs, **kwargs): + conv1 = self.conv1(inputs) + b1 = tf.keras.layers.BatchNormalization()(conv1) + b1 = tf.nn.leaky_relu(b1) + # b1 = self.b1 + + conv2 = self.conv2(inputs) + b2 = tf.keras.layers.BatchNormalization()(conv2) + b2 = tf.nn.leaky_relu(b2) + + b3 = tf.keras.layers.BatchNormalization()(inputs) + + out = tf.keras.layers.Add()([b1, b2, b3]) + out = tf.nn.relu(out) + + return out + + +class RevConvBlock(keras.layers.Layer): + + def __init__(self, num: int = 3, kernel_size=3): + # 调用父类__init__()方法 + super(RevConvBlock, self).__init__() + self.num = num + self.kernel_size = kernel_size + self.L = [] + for i in range(num): + RepVGG = RevConv(kernel_size=kernel_size) + self.L.append(RepVGG) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_size': self.kernel_size, + 'num': self.num + } + ) + base_config = super(RevConvBlock, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, **kwargs): + for i in range(self.num): + inputs = self.L[i](inputs) + return inputs diff --git a/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring3.py b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring3.py new file mode 100644 index 0000000..cf83f17 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring3.py @@ -0,0 +1,452 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/14 9:40 +@Usage : 联合监测模型 +@Desc : 将预测值放入分类器,分类器放两层逐渐递减的dense层 +''' + +import tensorflow as tf +import tensorflow.keras as keras +from tensorflow.keras import * +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D +from condition_monitoring.data_deal import loadData +from model.LossFunction.smooth_L1_Loss import SmoothL1Loss +import math + + +class Joint_Monitoring(keras.Model): + + def __init__(self, conv_filter=20): + # 调用父类__init__()方法 + super(Joint_Monitoring, self).__init__() + # step one + self.RepDCBlock1 = RevConvBlock(num=3, kernel_size=5) + self.conv1 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=1, strides=2, padding='SAME') + self.upsample1 = tf.keras.layers.UpSampling1D(size=2) + + self.DACU2 = DynamicChannelAttention() + self.RepDCBlock2 = RevConvBlock(num=3, kernel_size=3) + self.conv2 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=1, strides=2, padding='SAME') + self.upsample2 = tf.keras.layers.UpSampling1D(size=2) + + self.DACU3 = DynamicChannelAttention() + self.RepDCBlock3 = RevConvBlock(num=3, kernel_size=3) + self.p1 = DynamicPooling(pool_size=2) + self.conv3 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=3, strides=2, padding='SAME') + + self.DACU4 = DynamicChannelAttention() + self.RepDCBlock4 = RevConvBlock(num=3, kernel_size=3) + self.p2 = DynamicPooling(pool_size=4) + self.conv4 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=3, strides=2, padding='SAME') + + self.RepDCBlock5 = RevConvBlock(num=3, kernel_size=3) + self.p3 = DynamicPooling(pool_size=2) + + # step two + # 重现原数据 + self.GRU1 = tf.keras.layers.GRU(128, return_sequences=False) + self.d1 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output1 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + self.GRU2 = tf.keras.layers.GRU(128, return_sequences=False) + self.d2 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output2 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + self.GRU3 = tf.keras.layers.GRU(128, return_sequences=False) + self.d3 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output3 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + # step three + # 分类器 + self.d4 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.d5 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + # tf.nn.softmax + self.output4 = tf.keras.layers.Dense(1, activation=tf.nn.sigmoid) + + # loss + self.train_loss = [] + + def call(self, inputs, training=None, mask=None, is_first_time: bool = True): + # step one + RepDCBlock1 = self.RepDCBlock1(inputs) + RepDCBlock1 = tf.keras.layers.BatchNormalization()(RepDCBlock1) + conv1 = self.conv1(RepDCBlock1) + conv1 = tf.nn.leaky_relu(conv1) + conv1 = tf.keras.layers.BatchNormalization()(conv1) + upsample1 = self.upsample1(conv1) + + DACU2 = self.DACU2(upsample1) + DACU2 = tf.keras.layers.BatchNormalization()(DACU2) + RepDCBlock2 = self.RepDCBlock2(DACU2) + RepDCBlock2 = tf.keras.layers.BatchNormalization()(RepDCBlock2) + conv2 = self.conv2(RepDCBlock2) + conv2 = tf.nn.leaky_relu(conv2) + conv2 = tf.keras.layers.BatchNormalization()(conv2) + upsample2 = self.upsample2(conv2) + + DACU3 = self.DACU3(upsample2) + DACU3 = tf.keras.layers.BatchNormalization()(DACU3) + RepDCBlock3 = self.RepDCBlock3(DACU3) + RepDCBlock3 = tf.keras.layers.BatchNormalization()(RepDCBlock3) + conv3 = self.conv3(RepDCBlock3) + conv3 = tf.nn.leaky_relu(conv3) + conv3 = tf.keras.layers.BatchNormalization()(conv3) + + concat1 = tf.concat([conv2, conv3], axis=1) + + DACU4 = self.DACU4(concat1) + DACU4 = tf.keras.layers.BatchNormalization()(DACU4) + RepDCBlock4 = self.RepDCBlock4(DACU4) + RepDCBlock4 = tf.keras.layers.BatchNormalization()(RepDCBlock4) + conv4 = self.conv4(RepDCBlock4) + conv4 = tf.nn.leaky_relu(conv4) + conv4 = tf.keras.layers.BatchNormalization()(conv4) + + concat2 = tf.concat([conv1, conv4], axis=1) + + RepDCBlock5 = self.RepDCBlock5(concat2) + RepDCBlock5 = tf.keras.layers.BatchNormalization()(RepDCBlock5) + + output1 = [] + output2 = [] + output3 = [] + output4 = [] + + if is_first_time: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + else: + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # 多尺度动态池化 + # p1 = self.p1(output1) + # B, _, _ = p1.shape + # f1 = tf.reshape(p1, shape=[B, -1]) + # p2 = self.p2(output2) + # f2 = tf.reshape(p2, shape=[B, -1]) + # p3 = self.p3(output3) + # f3 = tf.reshape(p3, shape=[B, -1]) + # step three + # 分类器 + concat3 = tf.concat([output1, output2, output3], axis=1) + # dropout = tf.keras.layers.Dropout(0.25)(concat3) + d4 = self.d4(concat3) + d5 = self.d5(d4) + # d4 = tf.keras.layers.BatchNormalization()(d4) + output4 = self.output4(d5) + + return output1, output2, output3, output4 + + def get_loss(self, inputs_tensor, label1=None, label2=None, is_first_time: bool = True, pred_3=None, pred_4=None, + pred_5=None): + # step one + RepDCBlock1 = self.RepDCBlock1(inputs_tensor) + RepDCBlock1 = tf.keras.layers.BatchNormalization()(RepDCBlock1) + conv1 = self.conv1(RepDCBlock1) + conv1 = tf.nn.leaky_relu(conv1) + conv1 = tf.keras.layers.BatchNormalization()(conv1) + upsample1 = self.upsample1(conv1) + + DACU2 = self.DACU2(upsample1) + DACU2 = tf.keras.layers.BatchNormalization()(DACU2) + RepDCBlock2 = self.RepDCBlock2(DACU2) + RepDCBlock2 = tf.keras.layers.BatchNormalization()(RepDCBlock2) + conv2 = self.conv2(RepDCBlock2) + conv2 = tf.nn.leaky_relu(conv2) + conv2 = tf.keras.layers.BatchNormalization()(conv2) + upsample2 = self.upsample2(conv2) + + DACU3 = self.DACU3(upsample2) + DACU3 = tf.keras.layers.BatchNormalization()(DACU3) + RepDCBlock3 = self.RepDCBlock3(DACU3) + RepDCBlock3 = tf.keras.layers.BatchNormalization()(RepDCBlock3) + conv3 = self.conv3(RepDCBlock3) + conv3 = tf.nn.leaky_relu(conv3) + conv3 = tf.keras.layers.BatchNormalization()(conv3) + + concat1 = tf.concat([conv2, conv3], axis=1) + + DACU4 = self.DACU4(concat1) + DACU4 = tf.keras.layers.BatchNormalization()(DACU4) + RepDCBlock4 = self.RepDCBlock4(DACU4) + RepDCBlock4 = tf.keras.layers.BatchNormalization()(RepDCBlock4) + conv4 = self.conv4(RepDCBlock4) + conv4 = tf.nn.leaky_relu(conv4) + conv4 = tf.keras.layers.BatchNormalization()(conv4) + + concat2 = tf.concat([conv1, conv4], axis=1) + + RepDCBlock5 = self.RepDCBlock5(concat2) + RepDCBlock5 = tf.keras.layers.BatchNormalization()(RepDCBlock5) + + if is_first_time: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # reduce_mean降维计算均值 + MSE_loss1 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output1)) + MSE_loss2 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output2)) + MSE_loss3 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output3)) + + # print("MSE_loss1:", MSE_loss1.numpy()) + # print("MSE_loss2:", MSE_loss2.numpy()) + # print("MSE_loss3:", MSE_loss3.numpy()) + loss = MSE_loss1 + MSE_loss2 + MSE_loss3 + Accuracy_num = 0 + + else: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # 多尺度动态池化 + # p1 = self.p1(output1) + # B, _, _ = p1.shape + # f1 = tf.reshape(p1, shape=[B, -1]) + # p2 = self.p2(output2) + # f2 = tf.reshape(p2, shape=[B, -1]) + # p3 = self.p3(output3) + # f3 = tf.reshape(p3, shape=[B, -1]) + # step three + # 分类器 + concat3 = tf.concat([output1, output2, output3], axis=1) + # dropout = tf.keras.layers.Dropout(0.25)(concat3) + d4 = self.d4(concat3) + d5 = self.d5(d4) + # d4 = tf.keras.layers.BatchNormalization()(d4) + output4 = self.output4(d5) + + # reduce_mean降维计算均值 + a = 50 + beta = 0.5 * math.cos(min(self.epoch * 2 / self.epochs, 1) * math.pi) + 0.5 + MSE_loss = SmoothL1Loss()(y_true=pred_3, y_pred=output1) + MSE_loss += SmoothL1Loss()(y_true=pred_4, y_pred=output2) + MSE_loss += SmoothL1Loss()(y_true=pred_5, y_pred=output3) + Cross_Entropy_loss = tf.reduce_mean( + tf.losses.binary_crossentropy(y_true=label2, y_pred=output4, from_logits=True)) + + print("MSE_loss:", MSE_loss.numpy()) + print("Cross_Entropy_loss:", Cross_Entropy_loss.numpy()) + Accuracy_num = self.get_Accuracy(label=label2, output=output4) + loss = beta * MSE_loss + a * Cross_Entropy_loss + return loss, Accuracy_num + + def get_Accuracy(self, output, label): + + predict_label = tf.round(output) + label = tf.cast(label, dtype=tf.float32) + + t = np.array(label - predict_label) + + b = t[t[:] == 0] + + return b.__len__() + + def get_grad(self, input_tensor, label1=None, label2=None, is_first_time: bool = True, pred_3=None, pred_4=None, + pred_5=None): + with tf.GradientTape() as tape: + # todo 原本tape只会监控由tf.Variable创建的trainable=True属性 + # tape.watch(self.variables) + L, Accuracy_num = self.get_loss(input_tensor, label1=label1, label2=label2, is_first_time=is_first_time, + pred_3=pred_3, + pred_4=pred_4, pred_5=pred_5) + # 保存一下loss,用于输出 + self.train_loss = L + g = tape.gradient(L, self.variables) + return g, Accuracy_num + + def train(self, input_tensor, label1=None, label2=None, learning_rate=1e-3, is_first_time: bool = True, pred_3=None, + pred_4=None, pred_5=None): + g, Accuracy_num = self.get_grad(input_tensor, label1=label1, label2=label2, is_first_time=is_first_time, + pred_3=pred_3, + pred_4=pred_4, pred_5=pred_5) + optimizers.Adam(learning_rate).apply_gradients(zip(g, self.variables)) + return self.train_loss, Accuracy_num + + # 暂时只支持batch_size等于1,不然要传z比较麻烦 + def get_val_loss(self, val_data, val_label1, val_label2, batch_size=16, is_first_time: bool = True, + step_one_model=None): + val_loss = [] + accuracy_num = 0 + output1 = 0 + output2 = 0 + output3 = 0 + z = 1 + size, length, dims = val_data.shape + if batch_size == None: + batch_size = self.batch_size + for epoch in range(0, size - batch_size, batch_size): + each_val_data = val_data[epoch:epoch + batch_size, :, :] + each_val_label1 = val_label1[epoch:epoch + batch_size, :] + each_val_label2 = val_label2[epoch:epoch + batch_size, ] + # each_val_data = tf.expand_dims(each_val_data, axis=0) + # each_val_query = tf.expand_dims(each_val_query, axis=0) + # each_val_label = tf.expand_dims(each_val_label, axis=0) + if not is_first_time: + output1, output2, output3, _ = step_one_model.call(inputs=each_val_data, is_first_time=True) + + each_loss, each_accuracy_num = self.get_loss(each_val_data, each_val_label1, each_val_label2, + is_first_time=is_first_time, + pred_3=output1, pred_4=output2, pred_5=output3) + accuracy_num += each_accuracy_num + val_loss.append(each_loss) + z += 1 + + val_accuracy = accuracy_num / ((z - 1) * batch_size) + val_total_loss = tf.reduce_mean(val_loss) + return val_total_loss, val_accuracy + + +class RevConv(keras.layers.Layer): + + def __init__(self, kernel_size=3): + # 调用父类__init__()方法 + super(RevConv, self).__init__() + self.kernel_size = kernel_size + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_size': self.kernel_size + } + ) + base_config = super(RevConv, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + # print(input_shape) + _, _, output_dim = input_shape[0], input_shape[1], input_shape[2] + self.conv1 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=self.kernel_size, strides=1, + padding='causal', + dilation_rate=4) + + self.conv2 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=1, strides=1, padding='causal', + dilation_rate=4) + # self.b2 = tf.keras.layers.BatchNormalization() + + # self.b3 = tf.keras.layers.BatchNormalization() + + # out = tf.keras.layers.Add()([b1, b2, b3]) + # out = tf.nn.relu(out) + + def call(self, inputs, **kwargs): + conv1 = self.conv1(inputs) + b1 = tf.keras.layers.BatchNormalization()(conv1) + b1 = tf.nn.leaky_relu(b1) + # b1 = self.b1 + + conv2 = self.conv2(inputs) + b2 = tf.keras.layers.BatchNormalization()(conv2) + b2 = tf.nn.leaky_relu(b2) + + b3 = tf.keras.layers.BatchNormalization()(inputs) + + out = tf.keras.layers.Add()([b1, b2, b3]) + out = tf.nn.relu(out) + + return out + + +class RevConvBlock(keras.layers.Layer): + + def __init__(self, num: int = 3, kernel_size=3): + # 调用父类__init__()方法 + super(RevConvBlock, self).__init__() + self.num = num + self.kernel_size = kernel_size + self.L = [] + for i in range(num): + RepVGG = RevConv(kernel_size=kernel_size) + self.L.append(RepVGG) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_size': self.kernel_size, + 'num': self.num + } + ) + base_config = super(RevConvBlock, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, **kwargs): + for i in range(self.num): + inputs = self.L[i](inputs) + return inputs diff --git a/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring_banda.py b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring_banda.py index f3acba7..5133bb8 100644 --- a/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring_banda.py +++ b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/Joint_Monitoring_banda.py @@ -13,13 +13,13 @@ import tensorflow.keras as keras from tensorflow.keras import * import numpy as np import pandas as pd -import matplotlib.pyplot as plt -from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D -from model.Dynamic_channelAttention.Dynamic_channelAttention import DynamicChannelAttention, DynamicPooling -from condition_monitoring.data_deal import loadData +from model.ChannelAttention.Dynamic_channelAttention import DynamicChannelAttention, DynamicPooling from model.LossFunction.smooth_L1_Loss import SmoothL1Loss import math +MSE_loss1_list=[] +MSE_loss2_list=[] +MSE_loss3_list=[] class Joint_Monitoring(keras.Model): @@ -28,12 +28,13 @@ class Joint_Monitoring(keras.Model): super(Joint_Monitoring, self).__init__() # step one self.RepDCBlock1 = RevConvBlock(num=3, kernel_size=5) - self.conv1 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=1, strides=2, padding='SAME',kernel_initializer=0.7,bias_initializer=1) + # self.conv1 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=1, strides=2, padding='SAME',kernel_initializer=0.7,bias_initializer=1) + self.conv1 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=1, strides=2, padding='SAME') self.upsample1 = tf.keras.layers.UpSampling1D(size=2) self.DACU2 = DynamicChannelAttention() self.RepDCBlock2 = RevConvBlock(num=3, kernel_size=3) - self.conv2 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=1, strides=2, padding='SAME',kernel_initializer=0.7,bias_initializer=1) + self.conv2 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=1, strides=2, padding='SAME') self.upsample2 = tf.keras.layers.UpSampling1D(size=2) self.DACU3 = DynamicChannelAttention() @@ -255,6 +256,11 @@ class Joint_Monitoring(keras.Model): print("MSE_loss1:", MSE_loss1.numpy()) print("MSE_loss2:", MSE_loss2.numpy()) print("MSE_loss3:", MSE_loss3.numpy()) + + # MSE_loss1_list.append(MSE_loss1.numpy()) + # MSE_loss2_list.append(MSE_loss2.numpy()) + # MSE_loss3_list.append(MSE_loss3.numpy()) + loss = MSE_loss1 + MSE_loss2 + MSE_loss3 Accuracy_num = 0 diff --git a/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/__init__.py new file mode 100644 index 0000000..48e28b3 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/__init__.py @@ -0,0 +1,9 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/14 9:40 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/compare/RNet.py b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/compare/RNet.py new file mode 100644 index 0000000..d71190f --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/compare/RNet.py @@ -0,0 +1,447 @@ +# _*_ coding: UTF-8 _*_ + + +''' +@Author : dingjiawen +@Date : 2022/7/14 9:40 +@Usage : 联合监测模型 +@Desc : RNet:去除掉DCAU +''' + +import tensorflow as tf +import tensorflow.keras as keras +from tensorflow.keras import * +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from model.DepthwiseCon1D.DepthwiseConv1D import DepthwiseConv1D +from model.ChannelAttention.Dynamic_channelAttention import DynamicChannelAttention, DynamicPooling +from condition_monitoring.data_deal import loadData +from model.LossFunction.smooth_L1_Loss import SmoothL1Loss + + +class Joint_Monitoring(keras.Model): + + def __init__(self, conv_filter=20): + # 调用父类__init__()方法 + super(Joint_Monitoring, self).__init__() + # step one + self.RepDCBlock1 = RevConvBlock(num=3, kernel_size=5) + self.conv1 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=1, strides=2, padding='SAME') + self.upsample1 = tf.keras.layers.UpSampling1D(size=2) + + # self.DACU2 = DynamicChannelAttention() + self.RepDCBlock2 = RevConvBlock(num=3, kernel_size=3) + self.conv2 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=1, strides=2, padding='SAME') + self.upsample2 = tf.keras.layers.UpSampling1D(size=2) + + # self.DACU3 = DynamicChannelAttention() + self.RepDCBlock3 = RevConvBlock(num=3, kernel_size=3) + self.p1 = DynamicPooling(pool_size=2) + self.conv3 = tf.keras.layers.Conv1D(filters=2 * conv_filter, kernel_size=3, strides=2, padding='SAME') + + # self.DACU4 = DynamicChannelAttention() + self.RepDCBlock4 = RevConvBlock(num=3, kernel_size=3) + self.p2 = DynamicPooling(pool_size=4) + self.conv4 = tf.keras.layers.Conv1D(filters=conv_filter, kernel_size=3, strides=2, padding='SAME') + + self.RepDCBlock5 = RevConvBlock(num=3, kernel_size=3) + self.p3 = DynamicPooling(pool_size=2) + + # step two + # 重现原数据 + self.GRU1 = tf.keras.layers.GRU(128, return_sequences=False) + self.d1 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output1 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + self.GRU2 = tf.keras.layers.GRU(128, return_sequences=False) + self.d2 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output2 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + self.GRU3 = tf.keras.layers.GRU(128, return_sequences=False) + self.d3 = tf.keras.layers.Dense(300, activation=tf.nn.leaky_relu) + self.output3 = tf.keras.layers.Dense(10, activation=tf.nn.leaky_relu) + + + # loss + self.train_loss = [] + + def call(self, inputs, training=None, mask=None, is_first_time: bool = True): + # step one + RepDCBlock1 = self.RepDCBlock1(inputs) + RepDCBlock1 = tf.keras.layers.BatchNormalization()(RepDCBlock1) + conv1 = self.conv1(RepDCBlock1) + conv1 = tf.nn.leaky_relu(conv1) + conv1 = tf.keras.layers.BatchNormalization()(conv1) + upsample1 = self.upsample1(conv1) + + # DACU2 = self.DACU2(upsample1) + DACU2 = tf.keras.layers.BatchNormalization()(upsample1) + RepDCBlock2 = self.RepDCBlock2(DACU2) + RepDCBlock2 = tf.keras.layers.BatchNormalization()(RepDCBlock2) + conv2 = self.conv2(RepDCBlock2) + conv2 = tf.nn.leaky_relu(conv2) + conv2 = tf.keras.layers.BatchNormalization()(conv2) + upsample2 = self.upsample2(conv2) + + # DACU3 = self.DACU3(upsample2) + DACU3 = tf.keras.layers.BatchNormalization()(upsample2) + RepDCBlock3 = self.RepDCBlock3(DACU3) + RepDCBlock3 = tf.keras.layers.BatchNormalization()(RepDCBlock3) + conv3 = self.conv3(RepDCBlock3) + conv3 = tf.nn.leaky_relu(conv3) + conv3 = tf.keras.layers.BatchNormalization()(conv3) + + concat1 = tf.concat([conv2, conv3], axis=1) + + # DACU4 = self.DACU4(concat1) + DACU4 = tf.keras.layers.BatchNormalization()(concat1) + RepDCBlock4 = self.RepDCBlock4(DACU4) + RepDCBlock4 = tf.keras.layers.BatchNormalization()(RepDCBlock4) + conv4 = self.conv4(RepDCBlock4) + conv4 = tf.nn.leaky_relu(conv4) + conv4 = tf.keras.layers.BatchNormalization()(conv4) + + concat2 = tf.concat([conv1, conv4], axis=1) + + RepDCBlock5 = self.RepDCBlock5(concat2) + RepDCBlock5 = tf.keras.layers.BatchNormalization()(RepDCBlock5) + + output1 = [] + output2 = [] + output3 = [] + output4 = [] + + if is_first_time: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + else: + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # 多尺度动态池化 + # p1 = self.p1(output1) + # B, _, _ = p1.shape + # f1 = tf.reshape(p1, shape=[B, -1]) + # p2 = self.p2(output2) + # f2 = tf.reshape(p2, shape=[B, -1]) + # p3 = self.p3(output3) + # f3 = tf.reshape(p3, shape=[B, -1]) + # step three + # 分类器 + concat3 = tf.concat([output1, output2, output3], axis=1) + # dropout = tf.keras.layers.Dropout(0.25)(concat3) + d4 = self.d4(concat3) + d5 = self.d5(d4) + # d4 = tf.keras.layers.BatchNormalization()(d4) + output4 = self.output4(d5) + + return output1, output2, output3, output4 + + def get_loss(self, inputs_tensor, label1=None, label2=None, is_first_time: bool = True, pred_3=None, pred_4=None, + pred_5=None): + # step one + RepDCBlock1 = self.RepDCBlock1(inputs_tensor) + RepDCBlock1 = tf.keras.layers.BatchNormalization()(RepDCBlock1) + conv1 = self.conv1(RepDCBlock1) + conv1 = tf.nn.leaky_relu(conv1) + conv1 = tf.keras.layers.BatchNormalization()(conv1) + upsample1 = self.upsample1(conv1) + + # DACU2 = self.DACU2(upsample1) + DACU2 = tf.keras.layers.BatchNormalization()(upsample1) + RepDCBlock2 = self.RepDCBlock2(DACU2) + RepDCBlock2 = tf.keras.layers.BatchNormalization()(RepDCBlock2) + conv2 = self.conv2(RepDCBlock2) + conv2 = tf.nn.leaky_relu(conv2) + conv2 = tf.keras.layers.BatchNormalization()(conv2) + upsample2 = self.upsample2(conv2) + + # DACU3 = self.DACU3(upsample2) + DACU3 = tf.keras.layers.BatchNormalization()(upsample2) + RepDCBlock3 = self.RepDCBlock3(DACU3) + RepDCBlock3 = tf.keras.layers.BatchNormalization()(RepDCBlock3) + conv3 = self.conv3(RepDCBlock3) + conv3 = tf.nn.leaky_relu(conv3) + conv3 = tf.keras.layers.BatchNormalization()(conv3) + + concat1 = tf.concat([conv2, conv3], axis=1) + + # DACU4 = self.DACU4(concat1) + DACU4 = tf.keras.layers.BatchNormalization()(concat1) + RepDCBlock4 = self.RepDCBlock4(DACU4) + RepDCBlock4 = tf.keras.layers.BatchNormalization()(RepDCBlock4) + conv4 = self.conv4(RepDCBlock4) + conv4 = tf.nn.leaky_relu(conv4) + conv4 = tf.keras.layers.BatchNormalization()(conv4) + + concat2 = tf.concat([conv1, conv4], axis=1) + + RepDCBlock5 = self.RepDCBlock5(concat2) + RepDCBlock5 = tf.keras.layers.BatchNormalization()(RepDCBlock5) + + if is_first_time: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # reduce_mean降维计算均值 + MSE_loss1 = SmoothL1Loss()(y_true=label1, y_pred=output1) + MSE_loss2 = SmoothL1Loss()(y_true=label1, y_pred=output2) + MSE_loss3 = SmoothL1Loss()(y_true=label1, y_pred=output3) + # MSE_loss1 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output1)) + # MSE_loss2 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output2)) + # MSE_loss3 = tf.reduce_mean(tf.keras.losses.mse(y_true=label1, y_pred=output3)) + + print("MSE_loss1:", MSE_loss1.numpy()) + print("MSE_loss2:", MSE_loss2.numpy()) + print("MSE_loss3:", MSE_loss3.numpy()) + loss = MSE_loss1 + MSE_loss2 + MSE_loss3 + Accuracy_num = 0 + + else: + # step two + # 重现原数据 + # 接block3 + GRU1 = self.GRU1(RepDCBlock3) + GRU1 = tf.keras.layers.BatchNormalization()(GRU1) + d1 = self.d1(GRU1) + # tf.nn.softmax + output1 = self.output1(d1) + # 接block4 + GRU2 = self.GRU2(RepDCBlock4) + GRU2 = tf.keras.layers.BatchNormalization()(GRU2) + d2 = self.d2(GRU2) + # tf.nn.softmax + output2 = self.output2(d2) + # 接block5 + GRU3 = self.GRU3(RepDCBlock5) + GRU3 = tf.keras.layers.BatchNormalization()(GRU3) + d3 = self.d3(GRU3) + # tf.nn.softmax + output3 = self.output3(d3) + + # 多尺度动态池化 + # p1 = self.p1(output1) + # B, _, _ = p1.shape + # f1 = tf.reshape(p1, shape=[B, -1]) + # p2 = self.p2(output2) + # f2 = tf.reshape(p2, shape=[B, -1]) + # p3 = self.p3(output3) + # f3 = tf.reshape(p3, shape=[B, -1]) + # step three + # 分类器 + concat3 = tf.concat([output1, output2, output3], axis=1) + # dropout = tf.keras.layers.Dropout(0.25)(concat3) + d4 = self.d4(concat3) + d5 = self.d5(d4) + # d4 = tf.keras.layers.BatchNormalization()(d4) + output4 = self.output4(d5) + + # reduce_mean降维计算均值 + MSE_loss = SmoothL1Loss()(y_true=pred_3, y_pred=output1) + MSE_loss += SmoothL1Loss()(y_true=pred_4, y_pred=output2) + MSE_loss += SmoothL1Loss()(y_true=pred_5, y_pred=output3) + Cross_Entropy_loss = tf.reduce_mean( + tf.losses.binary_crossentropy(y_true=label2, y_pred=output4, from_logits=True)) + + print("MSE_loss:", MSE_loss.numpy()) + print("Cross_Entropy_loss:", Cross_Entropy_loss.numpy()) + Accuracy_num = self.get_Accuracy(label=label2, output=output4) + loss = MSE_loss + Cross_Entropy_loss + return loss, Accuracy_num + + def get_Accuracy(self, output, label): + + predict_label = tf.round(output) + label = tf.cast(label, dtype=tf.float32) + + t = np.array(label - predict_label) + + b = t[t[:] == 0] + + return b.__len__() + + def get_grad(self, input_tensor, label1=None, label2=None, is_first_time: bool = True, pred_3=None, pred_4=None, + pred_5=None): + with tf.GradientTape() as tape: + # todo 原本tape只会监控由tf.Variable创建的trainable=True属性 + # tape.watch(self.variables) + L, Accuracy_num = self.get_loss(input_tensor, label1=label1, label2=label2, is_first_time=is_first_time, + pred_3=pred_3, + pred_4=pred_4, pred_5=pred_5) + # 保存一下loss,用于输出 + self.train_loss = L + g = tape.gradient(L, self.variables) + return g, Accuracy_num + + def train(self, input_tensor, label1=None, label2=None, learning_rate=1e-3, is_first_time: bool = True, pred_3=None, + pred_4=None, pred_5=None): + g, Accuracy_num = self.get_grad(input_tensor, label1=label1, label2=label2, is_first_time=is_first_time, + pred_3=pred_3, + pred_4=pred_4, pred_5=pred_5) + optimizers.Adam(learning_rate).apply_gradients(zip(g, self.variables)) + return self.train_loss, Accuracy_num + + # 暂时只支持batch_size等于1,不然要传z比较麻烦 + def get_val_loss(self, val_data, val_label1, val_label2, batch_size=16, is_first_time: bool = True, + step_one_model=None): + val_loss = [] + accuracy_num = 0 + output1 = 0 + output2 = 0 + output3 = 0 + z = 1 + size, length, dims = val_data.shape + if batch_size == None: + batch_size = self.batch_size + for epoch in range(0, size - batch_size, batch_size): + each_val_data = val_data[epoch:epoch + batch_size, :, :] + each_val_label1 = val_label1[epoch:epoch + batch_size, :] + each_val_label2 = val_label2[epoch:epoch + batch_size, ] + # each_val_data = tf.expand_dims(each_val_data, axis=0) + # each_val_query = tf.expand_dims(each_val_query, axis=0) + # each_val_label = tf.expand_dims(each_val_label, axis=0) + if not is_first_time: + output1, output2, output3, _ = step_one_model.call(inputs=each_val_data, is_first_time=True) + + each_loss, each_accuracy_num = self.get_loss(each_val_data, each_val_label1, each_val_label2, + is_first_time=is_first_time, + pred_3=output1, pred_4=output2, pred_5=output3) + accuracy_num += each_accuracy_num + val_loss.append(each_loss) + z += 1 + + val_accuracy = accuracy_num / ((z-1) * batch_size) + val_total_loss = tf.reduce_mean(val_loss) + return val_total_loss, val_accuracy + + +class RevConv(keras.layers.Layer): + + def __init__(self, kernel_size=3): + # 调用父类__init__()方法 + super(RevConv, self).__init__() + self.kernel_size = kernel_size + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_size': self.kernel_size + } + ) + base_config = super(RevConv, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + # print(input_shape) + _, _, output_dim = input_shape[0], input_shape[1], input_shape[2] + self.conv1 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=self.kernel_size, strides=1, + padding='causal', + dilation_rate=4) + + self.conv2 = tf.keras.layers.Conv1D(filters=output_dim, kernel_size=1, strides=1, padding='causal', + dilation_rate=4) + # self.b2 = tf.keras.layers.BatchNormalization() + + # self.b3 = tf.keras.layers.BatchNormalization() + + # out = tf.keras.layers.Add()([b1, b2, b3]) + # out = tf.nn.relu(out) + + def call(self, inputs, **kwargs): + conv1 = self.conv1(inputs) + b1 = tf.keras.layers.BatchNormalization()(conv1) + b1 = tf.nn.leaky_relu(b1) + # b1 = self.b1 + + conv2 = self.conv2(inputs) + b2 = tf.keras.layers.BatchNormalization()(conv2) + b2 = tf.nn.leaky_relu(b2) + + b3 = tf.keras.layers.BatchNormalization()(inputs) + + out = tf.keras.layers.Add()([b1, b2, b3]) + out = tf.nn.relu(out) + + return out + + +class RevConvBlock(keras.layers.Layer): + + def __init__(self, num: int = 3, kernel_size=3): + # 调用父类__init__()方法 + super(RevConvBlock, self).__init__() + self.num = num + self.kernel_size = kernel_size + self.L = [] + for i in range(num): + RepVGG = RevConv(kernel_size=kernel_size) + self.L.append(RepVGG) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_size': self.kernel_size, + 'num': self.num + } + ) + base_config = super(RevConvBlock, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, **kwargs): + for i in range(self.num): + inputs = self.L[i](inputs) + return inputs diff --git a/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/compare/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/compare/__init__.py new file mode 100644 index 0000000..00271b1 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/Joint_Monitoring/compare/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + +''' +@Author : dingjiawen +@Date : 2022/10/11 20:30 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/LRU/README.md b/TensorFlow_eaxmple/Model_train_test/model/LRU/README.md new file mode 100644 index 0000000..2728fc4 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LRU/README.md @@ -0,0 +1,18 @@ +# 线性RNN的相关变体 + +用bert4keras实现三个快速可并行的RNN变体:LRU、SLRU和RWKV。 + +## 简介 + +- 中文博客:https://kexue.fm/archives/9554 +- LRU论文:https://arxiv.org/abs/2303.06349 +- RWKV链接:https://github.com/BlinkDL/RWKV-LM + +## 并行 + +线性RNN支持并行算法,可以将O(L)的运算降低到O(log L),本项目利用的是prefix sum问题的“Upper/Lower算法”来实现RNN并行。 + +具体细节可以参考中文博客的“[并行化](https://kexue.fm/archives/9554#%E5%B9%B6%E8%A1%8C%E5%8C%96)”一节 + +## 交流 +QQ交流群:808623966,微信群请加机器人微信号spaces_ac_cn diff --git a/TensorFlow_eaxmple/Model_train_test/model/LRU/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/LRU/__init__.py new file mode 100644 index 0000000..999db90 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LRU/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/13 19:13 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/LRU/lru.py b/TensorFlow_eaxmple/Model_train_test/model/LRU/lru.py new file mode 100644 index 0000000..735e383 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LRU/lru.py @@ -0,0 +1,124 @@ +#! -*- coding: utf-8 -*- +# 线性循环单元(Linear Recurrent Unit) +# tensorflow 1.15 + bert4keras 0.11.4 测试通过 + +# from bert4keras.layers import * +import numpy as np +import tensorflow.keras.backend as K +import tensorflow as tf +import tensorflow.keras.layers as layers +import tensorflow.keras.activations as activations +import tensorflow.keras.initializers as initializers +from tensorflow.keras.layers import Dense,Layer + + +class LRU(Layer): + """线性循环单元 + 链接1:https://arxiv.org/abs/2303.06349 + 链接2:https://kexue.fm/archives/9554 + """ + def __init__( + self, + units, + activation='linear', + use_bias=True, + unroll=True, # unroll可以加速训练,但是会增加显存消耗 + kernel_initializer='glorot_uniform', + **kwargs + ): + super(LRU, self).__init__(**kwargs) + self.units = units + self.activation = activations.get(activation) + self.use_bias = use_bias + self.unroll = unroll + self.kernel_initializer = initializers.get(kernel_initializer) + + + def build(self, input_shape): + super(LRU, self).build(input_shape) + hidden_size = input_shape[-1] + self.i_dense = Dense( + units=self.units * 2, + use_bias=self.use_bias, + kernel_initializer=self.kernel_initializer + ) + self.o_dense = Dense( + units=hidden_size, + use_bias=self.use_bias, + activation=self.activation, + kernel_initializer=self.kernel_initializer + ) + + def initializer(shape, dtype=None): + r_min, r_max = 0.9, 0.999 + u1 = np.random.random(size=shape[1]) + u2 = np.random.random(size=shape[1]) + nu_log = np.log( + -0.5 * np.log(u1 * (r_max**2 - r_min**2) + r_min**2) + ) + theta_log = np.log(u2 * np.pi * 2) + gamma_log = np.log(np.sqrt(1 - np.exp(-np.exp(nu_log))**2)) + return np.array([nu_log, theta_log, gamma_log]) + + self.params_log = self.add_weight( + name='params_log', shape=(3, self.units), initializer=initializer + ) + + + def call(self, inputs, mask=None): + u = self.i_dense(inputs) + params = K.exp(self.params_log) + nu, theta, gamma = params[0], params[1], params[2] + + if self.unroll: + L_in = K.int_shape(u)[1] + assert L_in is not None, 'input_length can not be None while unroll=True' + log2_L = int(np.ceil(np.log2(L_in))) + else: + L_in = K.shape(u)[1] + log2_L = K.log(K.cast(L_in, K.floatx())) / K.log(2.) + log2_L = K.cast(tf.math.ceil(log2_L), 'int32') + + u = tf.complex(u[..., ::2], u[..., 1::2]) + u = tf.pad(u, [[0, 0], [0, 2**log2_L - K.shape(u)[1]], [0, 0]]) + B, L, D = K.shape(u)[0], K.shape(u)[1], K.int_shape(u)[-1] + + def lru(i, x): + l = 2**i + x = K.reshape(x, [B * L // l, l, D]) + x1, x2 = x[:, :l // 2], x[:, l // 2:] + + pos = K.arange(1, l // 2 + 1, dtype=K.floatx()) + nus = tf.einsum('n,d->nd', pos, nu) + thetas = tf.einsum('n,d->nd', pos, theta) + lambs = K.exp(tf.complex(-nus, thetas)) + + x2 = x2 + lambs * x1[:, -1:] + x = K.concatenate([x1, x2], axis=1) + if (not self.unroll) and K.int_shape(u)[1] is not None: + x = K.reshape(x, [B, L, D]) + + return i + 1, x + + if self.unroll: + x = u + for i in range(log2_L): + _, x = lru(i + 1, x) + else: + _, x = tf.while_loop(lambda i, x: i <= log2_L, lru, [1, u]) + + x = x[:, :L_in] * tf.complex(gamma, 0.) + x = K.concatenate([tf.math.real(x), tf.math.imag(x)], axis=-1) + return self.o_dense(x) + + def get_config(self): + config = { + 'units': self.units, + 'activation': activations.serialize(self.activation), + 'use_bias': self.use_bias, + 'unroll': self.unroll, + 'kernel_initializer': + initializers.serialize(self.kernel_initializer), + } + base_config = super(LRU, self).get_config() + return dict(list(base_config.items()) + list(config.items())) diff --git a/TensorFlow_eaxmple/Model_train_test/model/LRU/models.py b/TensorFlow_eaxmple/Model_train_test/model/LRU/models.py new file mode 100644 index 0000000..f907517 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LRU/models.py @@ -0,0 +1,80 @@ +#! -*- coding: utf-8 -*- +# RNN-α 模型实现 +# tensorflow 1.15 + bert4keras 0.11.4 测试通过 + +from bert4keras.models import * +from lru import LRU +from slru import SLRU +from rwkv import RWKV + +RNN = LRU # SLRU、RWKV + + +class RNN_alpha(RoFormerV2): + """RNN-α + 改动:基本模块换成RNN + """ + def initializer(self, shape, dtype=None, order=2, gain=1.0): + return super(RNN_alpha, self).initializer(shape, dtype, order, gain) + + def apply_main_layers(self, inputs, index): + """RNN-α 的主体是基于RNN的模块 + 顺序:RNN --> Add --> LN --> FFN --> Add --> LN + """ + x = inputs + rnn_name = 'Transformer-%d-RNN' % index + ffn_name = 'Transformer-%d-FFN' % index + + xi = x + x = self.apply( + inputs=x, + layer=RNN, + units=(2 if RNN is SLRU else 1) * self.hidden_size, + use_bias=False, + kernel_initializer=self.initializer, + name=rnn_name + ) + x = self.apply( + inputs=x, + layer=Dropout, + rate=self.dropout_rate, + name='%s-Dropout' % rnn_name + ) + x = self.apply(inputs=[xi, x], layer=Add, name='%s-Add' % rnn_name) + x = self.apply( + inputs=x, + layer=LayerNormalization, + zero_mean=False, + scale=False, + offset=False, + epsilon=1e-12, + name='%s-Norm' % rnn_name + ) + + xi = x + x = self.apply( + inputs=x, + layer=FeedForward, + units=self.intermediate_size, + kernel_initializer=self.initializer, + use_bias=False, + name=ffn_name + ) + x = self.apply( + inputs=x, + layer=Dropout, + rate=self.dropout_rate, + name='%s-Dropout' % ffn_name + ) + x = self.apply(inputs=[xi, x], layer=Add, name='%s-Add' % rnn_name) + x = self.apply( + inputs=x, + layer=LayerNormalization, + zero_mean=False, + scale=False, + offset=False, + epsilon=1e-12, + name='%s-Norm' % ffn_name + ) + + return x diff --git a/TensorFlow_eaxmple/Model_train_test/model/LRU/rwkv.py b/TensorFlow_eaxmple/Model_train_test/model/LRU/rwkv.py new file mode 100644 index 0000000..1d60008 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LRU/rwkv.py @@ -0,0 +1,111 @@ +#! -*- coding: utf-8 -*- +# RWKV +# tensorflow 1.15 + bert4keras 0.11.4 测试通过 + +from bert4keras.layers import * + + +class RWKV(Layer): + """RWKV + 链接1:https://github.com/BlinkDL/RWKV-LM + 链接2:https://kexue.fm/archives/9554 + """ + def __init__( + self, + units, + use_bias=True, + unroll=True, + kernel_initializer='glorot_uniform', + **kwargs + ): + super(RWKV, self).__init__(**kwargs) + self.units = units + self.use_bias = use_bias + self.unroll = unroll + self.kernel_initializer = initializers.get(kernel_initializer) + + @integerize_shape + def build(self, input_shape): + super(RWKV, self).build(input_shape) + hidden_size = input_shape[-1] + self.rkv_dense = Dense( + units=self.units * 3, + use_bias=self.use_bias, + kernel_initializer=self.kernel_initializer + ) + self.o_dense = Dense( + units=hidden_size, + use_bias=self.use_bias, + kernel_initializer=self.kernel_initializer + ) + + def initializer(shape, dtype=None): + r_min, r_max = 0.9, 0.999 + u = np.random.random(size=shape) + return np.log(-0.5 * np.log(u * (r_max**2 - r_min**2) + r_min**2)) + + self.nu_log = self.add_weight( + name='nu_log', shape=(self.units,), initializer=initializer + ) + self.gamma_log = self.add_weight( + name='gamma_log', shape=(self.units,), initializer='zeros' + ) + + @recompute_grad + def call(self, inputs, mask=None): + rkv = self.rkv_dense(inputs) + r, k, v = tf.split(rkv, 3, axis=-1) + r, k = K.sigmoid(r), K.exp(k) + kv = k * v + u = K.concatenate([kv, k], axis=-1) + nu = K.exp(K.concatenate([self.nu_log, self.nu_log], axis=0)) + gamma = K.exp(self.nu_log + self.gamma_log) - 1 + + if self.unroll: + L_in = K.int_shape(u)[1] + assert L_in is not None, 'input_length can not be None while unroll=True' + log2_L = int(np.ceil(np.log2(L_in))) + else: + L_in = K.shape(u)[1] + log2_L = K.log(K.cast(L_in, K.floatx())) / K.log(2.) + log2_L = K.cast(tf.ceil(log2_L), 'int32') + + u = tf.pad(u, [[0, 0], [0, 2**log2_L - K.shape(u)[1]], [0, 0]]) + B, L, D = K.shape(u)[0], K.shape(u)[1], K.int_shape(u)[-1] + + def rwkv(i, x): + l = 2**i + x = K.reshape(x, [B * L // l, l, D]) + x1, x2 = x[:, :l // 2], x[:, l // 2:] + + pos = K.arange(1, l // 2 + 1, dtype=K.floatx()) + nus = tf.einsum('n,d->nd', pos, nu) + lambs = K.exp(-nus) + + x2 = x2 + lambs * x1[:, -1:] + x = K.concatenate([x1, x2], axis=1) + if (not self.unroll) and K.int_shape(u)[1] is not None: + x = K.reshape(x, [B, L, D]) + + return i + 1, x + + if self.unroll: + for i in range(log2_L): + _, u = rwkv(i + 1, u) + else: + _, u = tf.while_loop(lambda i, x: i <= log2_L, rwkv, [1, u]) + + u1, u2 = tf.split(u[:, :L_in], 2, axis=-1) + u = tf.math.divide_no_nan(u1 + gamma * kv, u2 + gamma * k) * r + return self.o_dense(u) + + def get_config(self): + config = { + 'units': self.units, + 'use_bias': self.use_bias, + 'unroll': self.unroll, + 'kernel_initializer': + initializers.serialize(self.kernel_initializer), + } + base_config = super(RWKV, self).get_config() + return dict(list(base_config.items()) + list(config.items())) diff --git a/TensorFlow_eaxmple/Model_train_test/model/LRU/slru.py b/TensorFlow_eaxmple/Model_train_test/model/LRU/slru.py new file mode 100644 index 0000000..88f01a0 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LRU/slru.py @@ -0,0 +1,110 @@ +#! -*- coding: utf-8 -*- +# 简化版线性循环单元(Simpler Linear Recurrent Unit) +# tensorflow 1.15 + bert4keras 0.11.4 测试通过 + +from bert4keras.layers import * + + +class SLRU(Layer): + """实数版线性循环单元 + 链接1:https://arxiv.org/abs/2303.06349 + 链接2:https://kexue.fm/archives/9554 + """ + def __init__( + self, + units, + activation='linear', + use_bias=True, + unroll=True, # unroll可以加速训练,但是会增加显存消耗 + kernel_initializer='glorot_uniform', + **kwargs + ): + super(SLRU, self).__init__(**kwargs) + self.units = units + self.activation = activations.get(activation) + self.use_bias = use_bias + self.unroll = unroll + self.kernel_initializer = initializers.get(kernel_initializer) + + @integerize_shape + def build(self, input_shape): + super(SLRU, self).build(input_shape) + hidden_size = input_shape[-1] + self.i_dense = Dense( + units=self.units, + use_bias=self.use_bias, + kernel_initializer=self.kernel_initializer + ) + self.o_dense = Dense( + units=hidden_size, + use_bias=self.use_bias, + activation=self.activation, + kernel_initializer=self.kernel_initializer + ) + + def initializer(shape, dtype=None): + r_min, r_max = 0.9, 0.999 + u = np.random.random(size=shape[1]) + nu_log = np.log(-0.5 * np.log(u * (r_max**2 - r_min**2) + r_min**2)) + gamma_log = np.log(np.sqrt(1 - np.exp(-np.exp(nu_log))**2)) + return np.array([nu_log, gamma_log]) + + self.params_log = self.add_weight( + name='params_log', shape=(2, self.units), initializer=initializer + ) + + @recompute_grad + def call(self, inputs, mask=None): + u = self.i_dense(inputs) + params = K.exp(self.params_log) + nu, gamma = params[0], params[1] + + if self.unroll: + L_in = K.int_shape(u)[1] + assert L_in is not None, 'input_length can not be None while unroll=True' + log2_L = int(np.ceil(np.log2(L_in))) + else: + L_in = K.shape(u)[1] + log2_L = K.log(K.cast(L_in, K.floatx())) / K.log(2.) + log2_L = K.cast(tf.ceil(log2_L), 'int32') + + u = tf.pad(u, [[0, 0], [0, 2**log2_L - K.shape(u)[1]], [0, 0]]) + B, L, D = K.shape(u)[0], K.shape(u)[1], K.int_shape(u)[-1] + + def lru(i, x): + l = 2**i + x = K.reshape(x, [B * L // l, l, D]) + x1, x2 = x[:, :l // 2], x[:, l // 2:] + + pos = K.arange(1, l // 2 + 1, dtype=K.floatx()) + nus = tf.einsum('n,d->nd', pos, nu) + lambs = K.exp(-nus) + + x2 = x2 + lambs * x1[:, -1:] + x = K.concatenate([x1, x2], axis=1) + if (not self.unroll) and K.int_shape(u)[1] is not None: + x = K.reshape(x, [B, L, D]) + + return i + 1, x + + if self.unroll: + x = u + for i in range(log2_L): + _, x = lru(i + 1, x) + else: + _, x = tf.while_loop(lambda i, x: i <= log2_L, lru, [1, u]) + + x = x[:, :L_in] * gamma + return self.o_dense(x) + + def get_config(self): + config = { + 'units': self.units, + 'activation': activations.serialize(self.activation), + 'use_bias': self.use_bias, + 'unroll': self.unroll, + 'kernel_initializer': + initializers.serialize(self.kernel_initializer), + } + base_config = super(SLRU, self).get_config() + return dict(list(base_config.items()) + list(config.items())) diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/DCTAttention_embed_LSTM.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/DCTAttention_embed_LSTM.py new file mode 100644 index 0000000..8f1a374 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/DCTAttention_embed_LSTM.py @@ -0,0 +1,120 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 13:49 +@Usage : +@Desc : 标准版LSTM +''' + +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D +from model.ChannelAttention.DCT_channelAttention import DCTChannelAttention as DctChannelBlock + +from tensorflow.keras import * +import tensorflow.keras.layers as layers + + +class AttentionEmbedLSTMLayer(layers.Layer): + # 定义两个权重初始化方法,方便后续调用 + k_ini = initializers.GlorotUniform() + b_ini = initializers.Zeros() + + def __init__(self, units=30, return_sequences: bool = False, **kwargs): + super(AttentionEmbedLSTMLayer, self).__init__() + self.units = units + self.return_sequences = return_sequences + + def get_params(self, num_inputs, num_outputs): + def _one(shape, name): + # return tf.Variable(tf.random.normal(shape=shape, stddev=0.01, mean=0, dtype=tf.float32)) + return self.add_weight(shape=shape, name=name, initializer=tf.random_normal_initializer) + + def _three(name1, name2): + return (_one(shape=(num_inputs + num_outputs, num_outputs), name=name1), + self.add_weight(shape=(num_outputs,), name=name2, + initializer=tf.zeros_initializer)) + + W_i, b_i = _three("W_i", "b_i") # 输入门参数 + W_f, b_f = _three("W_f", "b_f") # 遗忘门参数 + W_o, b_o = _three("W_o", "b_o") # 输出门参数 + W_c, b_c = _three("W_c", "b_c") # 候选记忆细胞参数 + + # 输出层参数 + return W_i, b_i, W_f, b_f, W_o, b_o, W_c, b_c + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'units': self.units, + 'return_sequences': self.return_sequences + } + ) + base_config = super(AttentionEmbedLSTMLayer, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + num_inputs, num_outputs = input_shape[-1], self.units + + self.W_i, self.b_i, self.W_f, self.b_f, self.W_o, self.b_o, self.W_c, self.b_c = self.get_params( + num_inputs=num_inputs, num_outputs=num_outputs) + self.dctAttention = DctChannelBlock(num_inputs + num_outputs) + pass + + def call(self, inputs, **kwargs): + epoch, hiddens, dims = inputs.shape + # print(filter_num, dims) + + for hidden in range(hiddens): + new_input = inputs[:, hidden, :] + new_input = tf.expand_dims(new_input, axis=1) + + if hidden != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + else: + new_input = tf.pad(new_input, [[0, 0], [0, 0], [0, self.units]]) + + new_input = self.dctAttention(new_input) + + Wi = tf.matmul(new_input, self.W_i) + self.b_i + Wf = tf.matmul(new_input, self.W_f) + self.b_f + Wc = tf.matmul(new_input, self.W_c) + self.b_c + Wo = tf.matmul(new_input, self.W_o) + self.b_o + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if hidden != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.multiply(it, ct_) + ht = tf.multiply(tf.nn.tanh(ct), ot) + + if self.return_sequences: + if hidden == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + else: + if hidden == hiddens - 1: + output = tf.squeeze(ht, axis=1) + + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(output, [-1, filter_num, units]) + + # print(output.shape) + return output + + +if __name__ == '__main__': + pass + +# tf.keras.layers.LSTM(return_sequences=) diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/LSTM.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/LSTM.py new file mode 100644 index 0000000..d3db9fc --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/LSTM.py @@ -0,0 +1,116 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 13:49 +@Usage : +@Desc : 标准版LSTM +''' + +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D + +from tensorflow.keras import * +import tensorflow.keras.layers as layers + + +class LSTMLayer(layers.Layer): + # 定义两个权重初始化方法,方便后续调用 + k_ini = initializers.GlorotUniform() + b_ini = initializers.Zeros() + + def __init__(self, units=30, return_sequences: bool = False, **kwargs): + super(LSTMLayer, self).__init__() + self.units = units + self.return_sequences = return_sequences + + def get_params(self, num_inputs, num_outputs): + def _one(shape, name): + # return tf.Variable(tf.random.normal(shape=shape, stddev=0.01, mean=0, dtype=tf.float32)) + return self.add_weight(shape=shape, name=name, initializer=tf.random_normal_initializer) + + def _three(name1, name2): + return (_one(shape=(num_inputs + num_outputs, num_outputs), name=name1), + self.add_weight(shape=(num_outputs,), name=name2, + initializer=tf.zeros_initializer)) + + W_i, b_i = _three("W_i", "b_i") # 输入门参数 + W_f, b_f = _three("W_f", "b_f") # 遗忘门参数 + W_o, b_o = _three("W_o", "b_o") # 输出门参数 + W_c, b_c = _three("W_c", "b_c") # 候选记忆细胞参数 + + # 输出层参数 + return W_i, b_i, W_f, b_f, W_o, b_o, W_c, b_c + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'units': self.units, + 'return_sequences': self.return_sequences + } + ) + base_config = super(LSTMLayer, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + num_inputs, num_outputs = input_shape[-1], self.units + + self.W_i, self.b_i, self.W_f, self.b_f, self.W_o, self.b_o, self.W_c, self.b_c = self.get_params( + num_inputs=num_inputs, num_outputs=num_outputs) + pass + + def call(self, inputs, **kwargs): + epoch, hiddens, dims = inputs.shape + # print(filter_num, dims) + + for hidden in range(hiddens): + new_input = inputs[:, hidden, :] + new_input = tf.expand_dims(new_input, axis=1) + + if hidden != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + else: + new_input = tf.pad(new_input, [[0, 0], [0, 0], [0, self.units]]) + + Wi = tf.matmul(new_input, self.W_i) + self.b_i + Wf = tf.matmul(new_input, self.W_f) + self.b_f + Wc = tf.matmul(new_input, self.W_c) + self.b_c + Wo = tf.matmul(new_input, self.W_o) + self.b_o + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if hidden != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.multiply(it, ct_) + ht = tf.multiply(tf.nn.tanh(ct), ot) + + if self.return_sequences: + if hidden == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + else: + if hidden == hiddens-1: + output = tf.squeeze(ht,axis=1) + + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(output, [-1, filter_num, units]) + + # print(output.shape) + return output + + +if __name__ == '__main__': + pass + +# tf.keras.layers.LSTM(return_sequences=) diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/LSTMByDense.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/LSTMByDense.py new file mode 100644 index 0000000..af6e220 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/LSTMByDense.py @@ -0,0 +1,110 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 13:49 +@Usage : +@Desc : 标准版LSTM 使用网络层实现加速 +''' + +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D + +from tensorflow.keras import * +import tensorflow.keras.layers as layers + + +class LSTMLayer(layers.Layer): + # 定义两个权重初始化方法,方便后续调用 + k_ini = initializers.GlorotUniform() + b_ini = initializers.Zeros() + + def __init__(self, units=30, return_sequences: bool = False, **kwargs): + super(LSTMLayer, self).__init__() + self.units = units + self.return_sequences = return_sequences + + def get_params(self, num_outputs): + + def _three(): + return Dense(num_outputs) + + W_i = _three() # 输入门参数 + W_f = _three() # 遗忘门参数 + W_o = _three() # 输出门参数 + W_c = _three() # 候选记忆细胞参数 + + # 输出层参数 + return W_i, W_f, W_o, W_c + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'units': self.units, + 'return_sequences': self.return_sequences + } + ) + base_config = super(LSTMLayer, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + num_inputs, num_outputs = input_shape[-1], self.units + + self.W_i, self.W_f, self.W_o, self.W_c = self.get_params(num_outputs=num_outputs) + pass + + def call(self, inputs, **kwargs): + epoch, hiddens, dims = inputs.shape + # print(filter_num, dims) + + for hidden in range(hiddens): + new_input = inputs[:, hidden, :] + new_input = tf.expand_dims(new_input, axis=1) + + if hidden != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + else: + new_input = tf.pad(new_input, [[0, 0], [0, 0], [0, self.units]]) + + Wi = self.W_i(new_input) + Wf = self.W_f(new_input) + Wc = self.W_c(new_input) + Wo = self.W_o(new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if hidden != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.multiply(it, ct_) + ht = tf.multiply(tf.nn.tanh(ct), ot) + + if self.return_sequences: + if hidden == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + else: + if hidden == hiddens - 1: + output = tf.squeeze(ht, axis=1) + + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(output, [-1, filter_num, units]) + + # print(output.shape) + return output + + +if __name__ == '__main__': + pass + +# tf.keras.layers.LSTM(return_sequences=) diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self.py new file mode 100644 index 0000000..93e33e6 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self.py @@ -0,0 +1,300 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D + + +class LSTM_realize(): + + def __init__(self, input=np.empty(shape=[100, 1]), filters=100, batch_size=10, if_SA=False): + self.input = input + self.filters = filters + self.batch_size = batch_size + self.if_SA = if_SA + + def getLayer(self, layer='LSTM', query=None): + + if layer == 'LSTM': + layer = self.LSTM_layer() + return layer + + elif layer == 'ConvLSTM': + layer = self.convLSTM() + return layer + + elif layer == 'SA_LSTM': + layer = self.SA_LSTM(query) + return layer + + elif layer == 'SA_ConvLSTM': + self.if_SA = True + layer = self.SA_ConvLSTM(query) + return layer + + else: + raise ValueError("算法尚未实现") + + def LSTM_layer(self): + input = self.input + batch_size = self.batch_size + + epoch, seq, filter_num = input.shape + print(seq, filter_num) + + ct_1 = tf.zeros(shape=[1, 1]) + ht_1 = tf.zeros(shape=[1, 1]) + + for i in range(batch_size): + output = [] + + for batch in range(filter_num): + + new_input = input[0, :, batch] + new_input = tf.expand_dims(new_input, axis=0) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + Wi = Dense(1)(new_input) + Wf = Dense(1)(new_input) + Wc = Dense(1)(new_input) + Wo = Dense(1)(new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + if i == 0: + sum = output + else: + sum = tf.concat([sum, output], axis=0) + + output = tf.reshape(sum, [batch_size, filter_num]) + # output=tf.expand_dims(output,axis=0) + + print(output.shape) + return output + + def ConvLSTM(self): + input = self.input + batch_size = self.batch_size + + epoch, seq, filter_num = input.shape + print(seq, filter_num) + + ct_1 = tf.zeros(shape=[1, 1]) + ht_1 = tf.zeros(shape=[1, 1]) + + for i in range(batch_size): + output = [] + + for batch in range(filter_num): + + new_input = input[0, :, batch] + new_input = tf.expand_dims(new_input, axis=0) + + new_input = tf.transpose(new_input, [1, 0]) + new_input = tf.expand_dims(new_input, axis=0) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + Wi = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + Wf = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + Wc = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + Wo = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=-1) + ht_1 = ht + ct_1 = ct + + if i == 0: + sum = output + else: + sum = tf.concat([sum, output], axis=0) + + output = tf.reshape(sum, [batch_size, filter_num]) + # output=tf.expand_dims(output,axis=0) + + print(output.shape) + return output + + def SA_LSTM(self, query): + + self.query = query + + input = self.input + batch_size = self.batch_size + + epoch, seq, filter_num = input.shape + print(seq, filter_num) + + ct_1 = tf.zeros(shape=[1, 1]) + ht_1 = tf.zeros(shape=[1, 1]) + + for i in range(batch_size): + output = [] + + for batch in range(filter_num): + + new_input = input[0, :, batch] + new_input = tf.expand_dims(new_input, axis=0) + + # new_input = tf.transpose(new_input, [1, 0]) + # new_input = tf.expand_dims(new_input, axis=0) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + # new_input.shape=(1,50) + # self_attention模块 + temp = tf.expand_dims(query[i][batch], axis=0) + query_cell=tf.expand_dims(temp,axis=1) + new_input1 = tf.concat([new_input, query_cell], axis=1) + (_, new_input_dims) = new_input1.shape + temp1 = Dense(new_input_dims)(new_input1) + temp1=temp1[:,:-1] + + temp2 = tf.nn.tanh(temp1) + + Si = Dense(new_input_dims-1)(temp2) + ai = tf.nn.softmax(Si) + ones=tf.ones(shape=ai.shape) + + new_input = tf.multiply((ai + ones), new_input) + + Wi = Dense(1)(new_input) + Wf = Dense(1)(new_input) + Wc = Dense(1)(new_input) + Wo = Dense(1)(new_input) + + # Wi = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + # Wf = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + # Wc = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + # Wo = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=-1) + ht_1 = ht + ct_1 = ct + + if i == 0: + sum = output + else: + sum = tf.concat([sum, output], axis=0) + + output = tf.reshape(sum, [batch_size, filter_num]) + # output=tf.expand_dims(output,axis=0) + + print(output.shape) + return output + + def SA_ConvLSTM(self, query): + + self.query = query + + input = self.input + batch_size = self.batch_size + + epoch, seq, filter_num = input.shape + print(seq, filter_num) + + ct_1 = tf.zeros(shape=[1, 1]) + ht_1 = tf.zeros(shape=[1, 1]) + + for i in range(batch_size): + output = [] + + for batch in range(filter_num): + + new_input = input[0, :, batch] + new_input = tf.expand_dims(new_input, axis=0) + + # new_input = tf.transpose(new_input, [1, 0]) + # new_input = tf.expand_dims(new_input, axis=0) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + # new_input.shape=(1,50) + # self_attention模块 + temp = tf.expand_dims(query[i][batch], axis=0) + query_cell=tf.expand_dims(temp,axis=1) + new_input1 = tf.concat([new_input, query_cell], axis=1) + (_, new_input_dims) = new_input1.shape + temp1 = Dense(new_input_dims)(new_input1) + temp1=temp1[:,:-1] + + temp2 = tf.nn.tanh(temp1) + + Si = Dense(new_input_dims-1)(temp2) + ai = tf.nn.softmax(Si) + ones=tf.ones(shape=ai.shape) + + new_input = tf.multiply((ai + ones), new_input) + + + + Wi = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + Wf = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + Wc = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + Wo = Conv1D(1, kernel_size=3, padding='SAME')(new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=-1) + ht_1 = ht + ct_1 = ct + + if i == 0: + sum = output + else: + sum = tf.concat([sum, output], axis=0) + + output = tf.reshape(sum, [batch_size, filter_num]) + # output=tf.expand_dims(output,axis=0) + + print(output.shape) + return output + +# if __name__ == '__main__': +# input=tf.random.truncated_normal(shape=[5,10]) +# LSTM(input=input).getlayer() diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self1.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self1.py new file mode 100644 index 0000000..255b6ae --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self1.py @@ -0,0 +1,179 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D + + +class LSTM_realize(): + + def __init__(self, input=np.empty(shape=[100, 1]), units=30, batch_size=10, if_SA=False): + self.input = input + self.units = units + self.batch_size = batch_size + self.if_SA = if_SA + + def getLayer(self, layer='LSTM', query=None): + + if layer == 'LSTM': + layer = self.LSTM_layer() + return layer + + elif layer == 'ConvLSTM': + layer = self.convLSTM() + return layer + + elif layer == 'SA_LSTM': + layer = self.SA_LSTM(query) + return layer + + elif layer == 'SA_ConvLSTM': + self.if_SA = True + layer = self.SA_ConvLSTM(query) + return layer + + else: + raise ValueError("算法尚未实现") + + def LSTM_layer(self): + input = self.input + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + print(filter_num, dims) + + ct_1 = tf.zeros(shape=[1, units]) + ht_1 = tf.zeros(shape=[1, units]) + + for i in range(batch_size): + + + output = [] + + for batch in range(filter_num): + + new_input = input[0, batch, :] + new_input = tf.expand_dims(new_input, axis=0) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + Wi = Dense(units)(new_input) + Wf = Dense(units)(new_input) + Wc = Dense(units)(new_input) + Wo = Dense(units)(new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=-1) + ht_1 = ht + ct_1 = ct + + if i == 0: + sum = output + # sum = tf.expand_dims(sum,axis=0) + else: + # output = tf.expand_dims(output, axis=0) + sum = tf.concat([sum, output], axis=0) + + # + output = tf.reshape(sum, [batch_size, filter_num]) + # output=tf.expand_dims(output,axis=0) + + print(output.shape) + return output + + def convLSTM(self): + return None + + def SA_ConvLSTM(self, query): + + self.query = query + + input = self.input + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + print(filter_num, dims) + + ct_1 = tf.zeros(shape=[1, units]) + ht_1 = tf.zeros(shape=[1, units]) + + for i in range(batch_size): + output = [] + + for batch in range(filter_num): + + new_input = input[0, batch, :] + new_input = tf.expand_dims(new_input, axis=0) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + # new_input.shape=(1,50) + # self_attention模块 + temp = tf.expand_dims(query[i][batch], axis=0) + query_cell = tf.expand_dims(temp, axis=1) + new_input1 = tf.concat([new_input, query_cell], axis=1) + + (_, new_input_dims) = new_input1.shape + temp1 = Dense(new_input_dims)(new_input1) + temp1 = temp1[:, :-1] + + temp2 = tf.nn.tanh(temp1) + + Si = Dense(new_input_dims - 1)(temp2) + ai = tf.nn.softmax(Si) + ones = tf.ones(shape=ai.shape) + + new_input = tf.multiply((ai + ones), new_input) + new_input = tf.expand_dims(new_input, axis=1) + + Wi = Conv1D(units, kernel_size=3, padding='SAME')(new_input) + Wf = Conv1D(units, kernel_size=3, padding='SAME')(new_input) + Wc = Conv1D(units, kernel_size=3, padding='SAME')(new_input) + Wo = Conv1D(units, kernel_size=3, padding='SAME')(new_input) + + Wi = tf.keras.layers.Flatten()(Wi) + Wf = tf.keras.layers.Flatten()(Wf) + Wc = tf.keras.layers.Flatten()(Wc) + Wo = tf.keras.layers.Flatten()(Wo) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=-1) + ht_1 = ht + ct_1 = ct + + if i == 0: + sum = output + else: + sum = tf.concat([sum, output], axis=0) + + output = tf.reshape(sum, [batch_size, filter_num]) + # output=tf.expand_dims(output,axis=0) + + print(output.shape) + return output + +# if __name__ == '__main__': +# input=tf.random.truncated_normal(shape=[5,10]) +# LSTM(input=input).getlayer() diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self2.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self2.py new file mode 100644 index 0000000..a53580d --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self2.py @@ -0,0 +1,162 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D + +tf.keras.backend.clear_session() +import tensorflow.keras as keras +import tensorflow.keras.layers as layers + + +''' +支持各种dim维度的数据进去,但是SA模块的查询暂时有问题 +需要知道batch是第几次 +''' +class LSTM_realize(layers.Layer): + + def __init__(self, input, units=30, batch_size=10, if_SA=False): + super(LSTM_realize, self).__init__() + self.input = input + self.units = units + self.batch_size = batch_size + self.if_SA = if_SA + + def getLayer(self, layer='LSTM', query=None): + + if layer == 'LSTM': + layer = self.LSTM_layer() + return layer + + elif layer == 'ConvLSTM': + layer = self.convLSTM() + return layer + + elif layer == 'SA_LSTM': + layer = self.SA_LSTM(query) + return layer + + elif layer == 'SA_ConvLSTM': + self.if_SA = True + layer = self.SA_ConvLSTM(query) + return layer + + else: + raise ValueError("算法尚未实现") + + def LSTM_layer(self): + input = self.input + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + print(filter_num, dims) + + ct_1 = tf.zeros(shape=[batch_size, 1, units]) + ht_1 = tf.zeros(shape=[batch_size, 1, units]) + + for batch in range(filter_num): + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + Wi = Dense(units)(new_input) + Wf = Dense(units)(new_input) + Wc = Dense(units)(new_input) + Wo = Dense(units)(new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + output = tf.reshape(output, [batch_size, filter_num, units]) + + print(output.shape) + return output + + def convLSTM(self): + return None + + def SA_ConvLSTM(self, query): + + self.query = query + print(query.shape) + + input = self.input + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + print(filter_num, dims) + + ct_1 = tf.zeros(shape=[batch_size, 1, units]) + ht_1 = tf.zeros(shape=[batch_size, 1, units]) + + for batch in range(filter_num): + + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + # new_input.shape=(1,50,1) + # self_attention模块 + # query_cell = query[batch * batch_size:(batch + 1) * batch_size, batch, :] + query_cell = tf.expand_dims(query[batch * batch_size:(batch + 1) * batch_size, batch, :], axis=-1) + # query_cell = tf.expand_dims(temp, axis=1) + new_input1 = tf.concat([new_input, query_cell], axis=-1) + + (_, _, new_input_dims) = new_input1.shape + temp1 = Dense(new_input_dims)(new_input1) + temp1 = temp1[:, :, :-1] + + temp2 = tf.nn.tanh(temp1) + + Si = Dense(new_input_dims - 1)(temp2) + ai = tf.nn.softmax(Si) + ones = tf.ones(shape=ai.shape) + + new_input = tf.multiply((ai + ones), new_input) + + Wi = Conv1D(units, kernel_size=3, padding='SAME')(new_input) + Wf = Conv1D(units, kernel_size=3, padding='SAME')(new_input) + Wc = Conv1D(units, kernel_size=3, padding='SAME')(new_input) + Wo = Conv1D(units, kernel_size=3, padding='SAME')(new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(sum, [batch_size , filter_num, units]) + # output=tf.expand_dims(output,axis=0) + + print(output.shape) + + return output + +# if __name__ == '__main__': +# input=tf.random.truncated_normal(shape=[5,10]) +# LSTM(input=input).getlayer() diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self3.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self3.py new file mode 100644 index 0000000..3ffb6e3 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self3.py @@ -0,0 +1,235 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D + +tf.keras.backend.clear_session() +import tensorflow.keras as keras +import tensorflow.keras.layers as layers + +''' +增加了build和call方法,初始化参数z,做到可以知道当前的batch +也可以去查询SA模块 +init中带参数的层必须重写get_config +存在问题:首先是模型保存问题,添加self.z知道当前的训练次数以后,这个参数似乎无法保存,保存之后无法提取的问题 +第二点是 由于在训练的时候使用的model.fit,训练过程封装的太好了,以至于这个类似乎只在初始化和训练第一次时加载一次,self.z不会随着训练次数的增加而增加 +TODO 第一个问题已经解决 +''' + + +class LSTM_realize(layers.Layer): + + def __init__(self, units=30, batch_size=10, if_SA=False, if_Conv=False,query=None, **kwargs): + super(LSTM_realize, self).__init__() + self.units = units + self.batch_size = batch_size + self.if_SA = if_SA + self.if_Conv = if_Conv + self.query=query + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'units': self.units, + 'batch_size': self.batch_size, + 'if_SA': self.if_SA, + 'if_Conv': self.if_Conv, + 'query': self.query + } + ) + base_config = super(LSTM_realize, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + # 初始化可训练参数 + self.Wi = [] + self.Wf = [] + self.Wc = [] + self.Wo = [] + self.Si = [] + self.temp1 = [] + for i in range(input_shape[1]): + if not self.if_Conv: + Wi = Dense(self.units) + Wf = Dense(self.units) + Wc = Dense(self.units) + Wo = Dense(self.units) + else: + Wi = Conv1D(self.units, kernel_size=3, padding='SAME') + Wf = Conv1D(self.units, kernel_size=3, padding='SAME') + Wc = Conv1D(self.units, kernel_size=3, padding='SAME') + Wo = Conv1D(self.units, kernel_size=3, padding='SAME') + + if self.if_SA: + if i == 0: + Si = Dense(input_shape[-1]) + temp1 = Dense(input_shape[-1] + 1) + else: + Si = Dense(self.units + input_shape[-1]) + temp1 = Dense(self.units + input_shape[-1] + 1) + + self.Si.append(Si) + self.temp1.append(temp1) + + self.Wi.append(Wi) + self.Wf.append(Wf) + self.Wc.append(Wc) + self.Wo.append(Wo) + + self.z = 0 + + def call(self, inputs, layer='LSTM', **kwargs): + self.inputs = inputs + + return self.getLayer(layer=layer, query=self.query) + + def getLayer(self, layer='LSTM', query=None): + + if layer == 'LSTM': + self.if_SA = False + self.if_Conv = False + layer = self.LSTM_layer() + return layer + + elif layer == 'ConvLSTM': + self.if_SA = False + self.if_Conv = True + layer = self.convLSTM() + return layer + + elif layer == 'SA_LSTM': + self.if_SA = True + self.if_Conv = False + layer = self.SA_LSTM(query) + return layer + + elif layer == 'SA_ConvLSTM': + self.if_SA = True + self.if_Conv = True + layer = self.SA_ConvLSTM(query) + return layer + + else: + raise ValueError("算法尚未实现") + + def LSTM_layer(self): + input = self.inputs + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + print(filter_num, dims) + + for batch in range(filter_num): + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + Wi = self.Wi[batch](new_input) + Wf = self.Wf[batch](new_input) + Wc = self.Wc[batch](new_input) + Wo = self.Wo[batch](new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if batch != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.add(ft, tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(output, [-1, filter_num, units]) + + print(output.shape) + return output + + def convLSTM(self): + return None + + def SA_ConvLSTM(self, query): + + # TODO 解决模型保存时,该数组会被序列化,然后返序列化以后不再是np或者是tf的问题 + query = tf.cast(query, dtype=tf.float32) + # print(query.shape) + + input = self.inputs + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + # print(filter_num, dims) + + for batch in range(filter_num): + + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + # new_input.shape=(1,50,1) + # self_attention模块 + # query_cell = query[batch * batch_size:(batch + 1) * batch_size, batch, :] + query_cell = tf.expand_dims(query[self.z * batch_size:(self.z + 1) * batch_size, batch, :], axis=-1) + # query_cell = tf.expand_dims(temp, axis=1) + new_input1 = tf.concat([new_input, query_cell], axis=-1) + + (_, _, new_input_dims) = new_input1.shape + temp1 = self.temp1[batch](new_input1) + temp1 = temp1[:, :, :-1] + + temp2 = tf.nn.tanh(temp1) + + Si = self.Si[batch](temp2) + ai = tf.nn.softmax(Si) + ones = tf.ones(shape=ai.shape) + + new_input = tf.multiply((ai + ones), new_input) + + Wi = self.Wi[batch](new_input) + Wf = self.Wf[batch](new_input) + Wc = self.Wc[batch](new_input) + Wo = self.Wo[batch](new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if batch != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.add(ft, tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(sum, [batch_size , filter_num, units]) + # output=tf.expand_dims(output,axis=0) + + # print(output.shape) + print("z=", self.z) + self.z += 1 + + return output + +# if __name__ == '__main__': +# input=tf.random.truncated_normal(shape=[5,10]) +# LSTM(input=input).getlayer() diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self4.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self4.py new file mode 100644 index 0000000..1ccbae5 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self4.py @@ -0,0 +1,393 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D + +# tf.keras.backend.clear_session() +from tensorflow.keras import * +import tensorflow.keras.layers as layers + +#TODO 权重非共享式LSTM +''' +利用函数式编程的方式解决self3存在的无法知道训练了多少次的问题 +''' + + +class PredictModel(Model): + def __init__(self, filter_num, dims, batch_size, query_label): + # 调用父类__init__()方法 + super(PredictModel, self).__init__() + self.filter_num = filter_num + self.dims = dims + self.batch_size = batch_size + self.query = query_label + self.train_loss = None + self.val_loss = [] + # self.LSTM_object = LSTM_realize(units=50, batch_size=batch_size, if_SA=False, if_Conv=False) + self.input_model_shape = tf.keras.Input(shape=[self.filter_num, self.dims]) + self.LSTM_object = LSTM_realize(units=20, batch_size=self.batch_size, if_SA=True, if_Conv=True, + query=self.query) + # self.drop1 = tf.keras.layers.Dropout(0.2) + self.bn = tf.keras.layers.BatchNormalization() + self.d1 = tf.keras.layers.Dense(10) + self.drop2 = tf.keras.layers.Dropout(0.2) + self.d2 = tf.keras.layers.Dense(1, name='output') + + # def build(self, input_shape): + # pass + + # 将动态图转换为静态图 + # 在静态图模型中,输入数据的数据维度不对、数据类型不对、数据名称不对都会报错 + # @tf.function(input_signature=[tf.TensorSpec([None, 30,50], tf.float32, name='digits')]) + # @tf.function + def call(self, inputs, training=None, mask=None, z=0, label=None, query=None, batch_size=None): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + input = tf.cast(inputs, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + bn = self.bn(LSTM) + d1 = self.d1(bn) + drop2 = self.drop2(d1) + output = self.d2(drop2) + # model = tf.keras.Model(inputs=input, outputs=output) + # return model + + return output + + def get_loss(self, inputs_tensor, label, query=None, batch_size=None, z=0): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + # inputs = self.input_model_shape(inputs_tensor) + input = tf.cast(inputs_tensor, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + bn = self.bn(LSTM) + d1 = self.d1(bn) + drop2 = self.drop2(d1) + output = self.d2(drop2) + # reduce_mean降维计算均值 + loss = tf.reduce_mean(tf.keras.losses.mse(y_true=label, y_pred=output)) + return loss + + def get_selfLoss(self, inputs_tensor, label, query=None, batch_size=None, z=0): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + # inputs = self.input_model_shape(inputs_tensor) + input = tf.cast(inputs_tensor, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + batch, filer_num, dims = LSTM.shape + aloss = 0 + bloss = 0 + for i in range(filer_num - 1): + aloss += tf.abs(LSTM[:, i + 1, :] - LSTM[:, i, :]) + for i in range(filer_num-3): + bloss += tf.abs(LSTM[:, i + 3, :] - LSTM[:, i+2, :]-(LSTM[:, i + 1, :] - LSTM[:, i, :])) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + aloss = tf.reduce_mean(aloss) + bloss = tf.reduce_mean(bloss) + desired_aloss = 0.05 + desired_bloss = 0.1 + # aloss的权重惩罚项 + aalpha = 0.1 + abeita = 0.01 + # bloss的权重惩罚项 + bbeita = 0.01 + bn = self.bn(LSTM) + d1 = self.d1(bn) + drop2 = self.drop2(d1) + output = self.d2(drop2) + # reduce_mean降维计算均值 + loss = tf.reduce_mean(tf.keras.losses.mse(y_true=label, y_pred=output)) + # total_loss = loss+abeita*(desired_aloss*tf.math.log(desired_aloss/aloss)+(1-desired_aloss)*tf.math.log((1-desired_aloss)/(1-aloss)))+bbeita*(desired_bloss*tf.math.log(desired_bloss/bloss)+(1-desired_bloss)*tf.math.log((1-desired_bloss)/(1-bloss))) + total_loss = loss +abeita*aloss+bbeita*bloss + return total_loss + + def get_grad(self, input_tensor, label, query=None, z=0): + with tf.GradientTape() as tape: + # todo 原本tape只会监控由tf.Variable创建的trainable=True属性 + tape.watch(self.variables) + L = self.get_selfLoss(input_tensor, label=label, query=query, z=z) + # 保存一下loss,用于输出 + self.train_loss = L + g = tape.gradient(L, self.variables) + return g + + def train(self, input_tensor, label, query=None, learning_rate=1e-3, z=0): + g = self.get_grad(input_tensor, label=label, query=query, z=z) + optimizers.Adam(learning_rate).apply_gradients(zip(g, self.variables)) + return self.train_loss + + # 暂时只支持batch_size等于1,不然要传z比较麻烦 + def get_val_loss(self, val_data, val_label, val_query, batch_size=1, z=0): + self.val_loss = [] + size, filernums, dims = val_data.shape + if batch_size == None: + batch_size = self.batch_size + for epoch in range(size): + each_val_data = val_data[epoch, :, :] + each_val_query = val_query[epoch, :, :] + each_val_label = val_label[epoch, :] + each_val_data = tf.expand_dims(each_val_data, axis=0) + each_val_query = tf.expand_dims(each_val_query, axis=0) + each_val_label = tf.expand_dims(each_val_label, axis=0) + input = tf.cast(each_val_data, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=each_val_query, batch_size=batch_size) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + bn = self.bn(LSTM) + d1 = self.d1(bn) + drop2 = self.drop2(d1) + output = self.d2(drop2) + # reduce_mean降维计算均值 + each_loss = tf.reduce_mean(tf.keras.losses.mse(y_true=each_val_label, y_pred=output)) + self.val_loss.append(each_loss) + val_total_loss = tf.reduce_mean(self.val_loss) + return val_total_loss + + +class LSTM_realize(layers.Layer): + + def __init__(self, units=30, batch_size=10, if_SA=False, if_Conv=False, query=None, **kwargs): + super(LSTM_realize, self).__init__() + self.units = units + self.batch_size = batch_size + self.if_SA = if_SA + self.if_Conv = if_Conv + self.query = query + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'units': self.units, + 'batch_size': self.batch_size, + 'if_SA': self.if_SA, + 'if_Conv': self.if_Conv, + 'query': self.query + } + ) + base_config = super(LSTM_realize, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + # 初始化可训练参数 + self.Wi = [] + self.Wf = [] + self.Wc = [] + self.Wo = [] + self.Si = [] + self.temp1 = [] + for i in range(input_shape[1]): + if not self.if_Conv: + Wi = Dense(self.units) + Wf = Dense(self.units) + Wc = Dense(self.units) + Wo = Dense(self.units) + else: + Wi = Conv1D(self.units, kernel_size=3, padding='SAME') + Wf = Conv1D(self.units, kernel_size=3, padding='SAME') + Wc = Conv1D(self.units, kernel_size=3, padding='SAME') + Wo = Conv1D(self.units, kernel_size=3, padding='SAME') + + if self.if_SA: + if i == 0: + Si = Dense(input_shape[-1]) + temp1 = Dense(input_shape[-1] + 1) + else: + Si = Dense(self.units + input_shape[-1]) + temp1 = Dense(self.units + input_shape[-1] + 1) + + self.Si.append(Si) + self.temp1.append(temp1) + + self.Wi.append(Wi) + self.Wf.append(Wf) + self.Wc.append(Wc) + self.Wo.append(Wo) + + # self.z = 0 + + def call(self, inputs, layer='LSTM', z=0, query=None, batch_size=None, **kwargs): + self.inputs = inputs + # 这里在之前判断过,就不需要判断了 + # if query == None: + # query = self.query + # if batch_size == None: + # batch_size = self.batch_size + return self.getLayer(layer=layer, query=query, z=z, batch_size=batch_size) + + def getLayer(self, layer='LSTM', query=None, z=0, batch_size=None): + + if layer == 'LSTM': + self.if_SA = False + self.if_Conv = False + layer = self.LSTM_layer() + return layer + + elif layer == 'ConvLSTM': + self.if_SA = False + self.if_Conv = True + layer = self.convLSTM() + return layer + + elif layer == 'SA_LSTM': + self.if_SA = True + self.if_Conv = False + layer = self.SA_LSTM(query, z=z) + return layer + + elif layer == 'SA_ConvLSTM': + self.if_SA = True + self.if_Conv = True + layer = self.SA_ConvLSTM(query, z=z, batch_size=batch_size) + return layer + elif layer == 'SA_ConvLSTM1': + self.if_SA = True + self.if_Conv = True + layer = self.SA_ConvLSTM1() + return layer + + else: + raise ValueError("算法尚未实现") + + def LSTM_layer(self): + input = self.inputs + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + print(filter_num, dims) + + for batch in range(filter_num): + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + Wi = self.Wi[batch](new_input) + Wf = self.Wf[batch](new_input) + Wc = self.Wc[batch](new_input) + Wo = self.Wo[batch](new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if batch != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.add(ft, tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(output, [-1, filter_num, units]) + + print(output.shape) + return output + + def convLSTM(self): + return None + + # self_attention with true_query + def SA_ConvLSTM(self, query, z=0, batch_size=None): + + # TODO 解决模型保存时,该数组会被序列化,然后返序列化以后不再是np或者是tf的问题 + query = tf.cast(query, dtype=tf.float32) + # print(query.shape) + + if batch_size == None: + batch_size = self.batch_size + + input = self.inputs + # batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + # print(filter_num, dims) + + for batch in range(filter_num): + + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + # new_input.shape=(1,50,1) + # self_attention模块 + # query_cell = query[batch * batch_size:(batch + 1) * batch_size, batch, :] + query_cell = tf.expand_dims(query[z * batch_size:(z + 1) * batch_size, batch, :], axis=-1) + # query_cell = tf.expand_dims(temp, axis=1) + new_input1 = tf.concat([new_input, query_cell], axis=-1) + + (_, _, new_input_dims) = new_input1.shape + temp1 = self.temp1[batch](new_input1) + temp1 = temp1[:, :, :-1] + + temp2 = tf.nn.tanh(temp1) + + Si = self.Si[batch](temp2) + ai = tf.nn.softmax(Si) + ones = tf.ones(shape=ai.shape) + + new_input = tf.multiply((ai + ones), new_input) + + Wi = self.Wi[batch](new_input) + Wf = self.Wf[batch](new_input) + Wc = self.Wc[batch](new_input) + Wo = self.Wo[batch](new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if batch != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.add(ft, tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(sum, [batch_size , filter_num, units]) + # output=tf.expand_dims(output,axis=0) + + # print(output.shape) + # print("z=", z) + + return output + + # self_attention with kqv + def SA_ConvLSTM1(self): + pass + +# if __name__ == '__main__': +# input=tf.random.truncated_normal(shape=[5,10]) +# LSTM(input=input).getlayer() diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self5.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self5.py new file mode 100644 index 0000000..c408e85 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/LSTM_realize_self5.py @@ -0,0 +1,740 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from tensorflow.keras.layers import Dense, Conv2D, Conv1D + +# tf.keras.backend.clear_session() +from tensorflow.keras import * +import tensorflow.keras.layers as layers + +# TODO 权重非共享式LSTM +''' +尝试LSTM权重共享策略:所谓权重共享策略是指: +cell 的权重是共享的,这是什么意思呢?这是指这张图片上有三个绿色的大框,代表三个 cell 对吧, +但是实际上,它只是代表了一个 cell 在不同时序时候的状态,所有的数据只会通过一个 cell,然后不断更新它的权重。 + +尝试每一个cell权重共享的lstm +同时增加了Mutihead_self_attention模块,放在了PredictModel_MutiHead(Model) +''' + + +class PredictModel(Model): + def __init__(self, batch_size, query_label=None): + # 调用父类__init__()方法 + super(PredictModel, self).__init__() + self.batch_size = batch_size + self.query = query_label + self.train_loss = None + self.val_loss = [] + # self.LSTM_object = LSTM_realize(units=50, batch_size=batch_size, if_SA=False, if_Conv=False) + # self.input_model_shape = tf.keras.Input(shape=[self.filter_num, self.dims]) + self.LSTM_object1 = LSTM_realize(units=128, batch_size=self.batch_size, if_SA=True, if_Conv=True, + query=self.query) + self.LSTM_object2 = LSTM_realize(units=256, batch_size=self.batch_size, if_SA=True, if_Conv=True, + query=self.query) + self.LSTM_object3 = LSTM_realize(units=512, batch_size=self.batch_size, if_SA=True, if_Conv=True, + query=self.query) + # self.drop1 = tf.keras.layers.Dropout(0.2) + self.bn1 = tf.keras.layers.BatchNormalization() + self.bn2 = tf.keras.layers.BatchNormalization() + self.bn3 = tf.keras.layers.BatchNormalization() + self.d1 = tf.keras.layers.Dense(10) + self.drop2 = tf.keras.layers.Dropout(0.2) + self.d2 = tf.keras.layers.Dense(1, name='output') + + # def build(self, input_shape): + # pass + + # 将动态图转换为静态图 + # 在静态图模型中,输入数据的数据维度不对、数据类型不对、数据名称不对都会报错 + # @tf.function(input_signature=[tf.TensorSpec([None, 30,50], tf.float32, name='digits')]) + # @tf.function + def call(self, inputs, training=None, mask=None, z=0, label=None, query=None, batch_size=None): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + input = tf.cast(inputs, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn1(LSTM) + + LSTM = self.LSTM_object(inputs=bn, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn2(LSTM) + + LSTM = self.LSTM_object(inputs=bn, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn3(LSTM) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + + d1 = self.d1(bn) + # drop2 = self.drop2(d1) + output = self.d2(d1) + # model = tf.keras.Model(inputs=input, outputs=output) + # return model + + return output + + def get_loss(self, inputs_tensor, label, query=None, batch_size=None, z=0): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + # inputs = self.input_model_shape(inputs_tensor) + input = tf.cast(inputs_tensor, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn1(LSTM) + + LSTM = self.LSTM_object(inputs=bn, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn2(LSTM) + + LSTM = self.LSTM_object(inputs=bn, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn3(LSTM) + d1 = self.d1(bn) + # drop2 = self.drop2(d1) + output = self.d2(d1) + # reduce_mean降维计算均值 + loss = tf.reduce_mean(tf.keras.losses.mse(y_true=label, y_pred=output)) + return loss + + def get_selfLoss(self, inputs_tensor, label, query=None, batch_size=None, z=0): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + # inputs = self.input_model_shape(inputs_tensor) + input = tf.cast(inputs_tensor, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + batch, filer_num, dims = LSTM.shape + aloss = 0 + bloss = 0 + for i in range(filer_num - 1): + aloss += tf.abs(LSTM[:, i + 1, :] - LSTM[:, i, :]) + for i in range(filer_num - 3): + bloss += tf.abs(LSTM[:, i + 3, :] - LSTM[:, i + 2, :] - (LSTM[:, i + 1, :] - LSTM[:, i, :])) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + aloss = tf.reduce_mean(aloss) + bloss = tf.reduce_mean(bloss) + desired_aloss = 0.05 + desired_bloss = 0.1 + # aloss的权重惩罚项 + aalpha = 0.1 + abeita = 0.01 + # bloss的权重惩罚项 + bbeita = 0.01 + bn = self.bn(LSTM) + d1 = self.d1(bn) + drop2 = self.drop2(d1) + output = self.d2(drop2) + # reduce_mean降维计算均值 + loss = tf.reduce_mean(tf.keras.losses.mse(y_true=label, y_pred=output)) + # total_loss = loss+abeita*(desired_aloss*tf.math.log(desired_aloss/aloss)+(1-desired_aloss)*tf.math.log((1-desired_aloss)/(1-aloss)))+bbeita*(desired_bloss*tf.math.log(desired_bloss/bloss)+(1-desired_bloss)*tf.math.log((1-desired_bloss)/(1-bloss))) + total_loss = loss + abeita * aloss + bbeita * bloss + return total_loss + + def get_grad(self, input_tensor, label, query=None, z=0): + with tf.GradientTape() as tape: + # todo 原本tape只会监控由tf.Variable创建的trainable=True属性 + tape.watch(self.variables) + L = self.get_loss(input_tensor, label=label, query=query, z=z) + # 保存一下loss,用于输出 + self.train_loss = L + g = tape.gradient(L, self.variables) + return g + + def train(self, input_tensor, label, query=None, learning_rate=1e-3, z=0): + g = self.get_grad(input_tensor, label=label, query=query, z=z) + optimizers.Adam(learning_rate).apply_gradients(zip(g, self.variables)) + return self.train_loss + + # 暂时只支持batch_size等于1,不然要传z比较麻烦 + def get_val_loss(self, val_data, val_label, val_query, batch_size=1, z=0): + self.val_loss = [] + size, filernums, dims = val_data.shape + if batch_size == None: + batch_size = self.batch_size + for epoch in range(size): + each_val_data = val_data[epoch, :, :] + each_val_query = val_query[epoch, :, :] + each_val_label = val_label[epoch, :] + each_val_data = tf.expand_dims(each_val_data, axis=0) + each_val_query = tf.expand_dims(each_val_query, axis=0) + each_val_label = tf.expand_dims(each_val_label, axis=0) + input = tf.cast(each_val_data, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=each_val_query, batch_size=batch_size) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + bn = self.bn(LSTM) + d1 = self.d1(bn) + drop2 = self.drop2(d1) + output = self.d2(drop2) + # reduce_mean降维计算均值 + each_loss = tf.reduce_mean(tf.keras.losses.mse(y_true=each_val_label, y_pred=output)) + self.val_loss.append(each_loss) + val_total_loss = tf.reduce_mean(self.val_loss) + return val_total_loss + + +class PredictModel_MutiHead(Model): + def __init__(self, batch_size, query_label): + # 调用父类__init__()方法 + super(PredictModel, self).__init__() + self.batch_size = batch_size + self.query = query_label + self.train_loss = None + self.val_loss = [] + # self.LSTM_object = LSTM_realize(units=50, batch_size=batch_size, if_SA=False, if_Conv=False) + # self.input_model_shape = tf.keras.Input(shape=[self.filter_num, self.dims]) + self.LSTM_object1 = LSTM_realize(units=128, batch_size=self.batch_size, if_SA=True, if_Conv=True, + query=self.query) + self.LSTM_object2 = LSTM_realize(units=256, batch_size=self.batch_size, if_SA=True, if_Conv=True, + query=self.query) + self.LSTM_object3 = LSTM_realize(units=512, batch_size=self.batch_size, if_SA=True, if_Conv=True, + query=self.query) + # self.drop1 = tf.keras.layers.Dropout(0.2) + self.bn1 = tf.keras.layers.BatchNormalization() + self.bn2 = tf.keras.layers.BatchNormalization() + self.bn3 = tf.keras.layers.BatchNormalization() + self.d1 = tf.keras.layers.Dense(10) + self.drop2 = tf.keras.layers.Dropout(0.2) + self.d2 = tf.keras.layers.Dense(1, name='output') + + # def build(self, input_shape): + # pass + + # 将动态图转换为静态图 + # 在静态图模型中,输入数据的数据维度不对、数据类型不对、数据名称不对都会报错 + # @tf.function(input_signature=[tf.TensorSpec([None, 30,50], tf.float32, name='digits')]) + # @tf.function + def call(self, inputs, training=None, mask=None, z=0, label=None, query=None, batch_size=None): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + input = tf.cast(inputs, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn1(LSTM) + + LSTM = self.LSTM_object(inputs=bn, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn2(LSTM) + + LSTM = self.LSTM_object(inputs=bn, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn3(LSTM) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + + d1 = self.d1(bn) + # drop2 = self.drop2(d1) + output = self.d2(d1) + # model = tf.keras.Model(inputs=input, outputs=output) + # return model + + return output + + def get_loss(self, inputs_tensor, label, query=None, batch_size=None, z=0): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + # inputs = self.input_model_shape(inputs_tensor) + input = tf.cast(inputs_tensor, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn1(LSTM) + + LSTM = self.LSTM_object(inputs=bn, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn2(LSTM) + + LSTM = self.LSTM_object(inputs=bn, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + bn = self.bn3(LSTM) + d1 = self.d1(bn) + # drop2 = self.drop2(d1) + output = self.d2(d1) + # reduce_mean降维计算均值 + loss = tf.reduce_mean(tf.keras.losses.mse(y_true=label, y_pred=output)) + return loss + + def get_selfLoss(self, inputs_tensor, label, query=None, batch_size=None, z=0): + if query == None: + query = self.query + if batch_size == None: + batch_size = self.batch_size + # inputs = self.input_model_shape(inputs_tensor) + input = tf.cast(inputs_tensor, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=query, batch_size=batch_size) + batch, filer_num, dims = LSTM.shape + aloss = 0 + bloss = 0 + for i in range(filer_num - 1): + aloss += tf.abs(LSTM[:, i + 1, :] - LSTM[:, i, :]) + for i in range(filer_num - 3): + bloss += tf.abs(LSTM[:, i + 3, :] - LSTM[:, i + 2, :] - (LSTM[:, i + 1, :] - LSTM[:, i, :])) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + aloss = tf.reduce_mean(aloss) + bloss = tf.reduce_mean(bloss) + desired_aloss = 0.05 + desired_bloss = 0.1 + # aloss的权重惩罚项 + aalpha = 0.1 + abeita = 0.01 + # bloss的权重惩罚项 + bbeita = 0.01 + bn = self.bn(LSTM) + d1 = self.d1(bn) + drop2 = self.drop2(d1) + output = self.d2(drop2) + # reduce_mean降维计算均值 + loss = tf.reduce_mean(tf.keras.losses.mse(y_true=label, y_pred=output)) + # total_loss = loss+abeita*(desired_aloss*tf.math.log(desired_aloss/aloss)+(1-desired_aloss)*tf.math.log((1-desired_aloss)/(1-aloss)))+bbeita*(desired_bloss*tf.math.log(desired_bloss/bloss)+(1-desired_bloss)*tf.math.log((1-desired_bloss)/(1-bloss))) + total_loss = loss + abeita * aloss + bbeita * bloss + return total_loss + + def get_grad(self, input_tensor, label, query=None, z=0): + with tf.GradientTape() as tape: + # todo 原本tape只会监控由tf.Variable创建的trainable=True属性 + tape.watch(self.variables) + L = self.get_loss(input_tensor, label=label, query=query, z=z) + # 保存一下loss,用于输出 + self.train_loss = L + g = tape.gradient(L, self.variables) + return g + + def train(self, input_tensor, label, query=None, learning_rate=1e-3, z=0): + g = self.get_grad(input_tensor, label=label, query=query, z=z) + optimizers.Adam(learning_rate).apply_gradients(zip(g, self.variables)) + return self.train_loss + + # 暂时只支持batch_size等于1,不然要传z比较麻烦 + def get_val_loss(self, val_data, val_label, val_query, batch_size=1, z=0): + self.val_loss = [] + size, filernums, dims = val_data.shape + if batch_size == None: + batch_size = self.batch_size + for epoch in range(size): + each_val_data = val_data[epoch, :, :] + each_val_query = val_query[epoch, :, :] + each_val_label = val_label[epoch, :] + each_val_data = tf.expand_dims(each_val_data, axis=0) + each_val_query = tf.expand_dims(each_val_query, axis=0) + each_val_label = tf.expand_dims(each_val_label, axis=0) + input = tf.cast(each_val_data, tf.float32) + LSTM = self.LSTM_object(inputs=input, layer='SA_ConvLSTM', z=z, query=each_val_query, batch_size=batch_size) + # LSTM = self.LSTM_object(inputs=input, layer='LSTM') + # drop1 = self.drop1(LSTM) + # bn = self.bn(drop1) + bn = self.bn(LSTM) + d1 = self.d1(bn) + drop2 = self.drop2(d1) + output = self.d2(drop2) + # reduce_mean降维计算均值 + each_loss = tf.reduce_mean(tf.keras.losses.mse(y_true=each_val_label, y_pred=output)) + self.val_loss.append(each_loss) + val_total_loss = tf.reduce_mean(self.val_loss) + return val_total_loss + + +class LSTM_realize(layers.Layer): + # 定义两个权重初始化方法,方便后续调用 + k_ini = initializers.GlorotUniform() + b_ini = initializers.Zeros() + + def __init__(self, units=30, batch_size=10, if_SA=False, if_Conv=False, if_mutiHead=False, num_heads=8, + qkv_bias=False, + qk_scale=None, + attn_drop_ratio=0., + proj_drop_ratio=0., query=None, **kwargs): + super(LSTM_realize, self).__init__() + self.units = units + self.batch_size = batch_size + self.if_SA = if_SA + self.if_Conv = if_Conv + self.query = query + self.if_mutiHead = if_mutiHead + self.num_heads = num_heads + self.qkv_bias = qkv_bias + self.qkv_scale = qk_scale + self.attn_drop_ratio = attn_drop_ratio + self.proj_drop_ratio = proj_drop_ratio + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'units': self.units, + 'batch_size': self.batch_size, + 'if_SA': self.if_SA, + 'if_Conv': self.if_Conv, + 'proj_drop_ratio': self.proj_drop_ratio, + 'attn_drop_ratio': self.attn_drop_ratio, + 'qkv_bias': self.qkv_bias, + 'if_mutiHead': self.if_mutiHead, + 'num_heads': self.num_heads, + 'qkv_scale': self.qkv_scale, + 'query': self.query + } + ) + base_config = super(LSTM_realize, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + # 初始化可训练参数 + self.Wi = [] + self.Wf = [] + self.Wc = [] + self.Wo = [] + self.Si = [] + self.temp1 = [] + + if not self.if_Conv: + Wi = Dense(self.units, kernel_initializer=self.k_ini) + Wf = Dense(self.units, kernel_initializer=self.k_ini) + Wc = Dense(self.units, kernel_initializer=self.k_ini) + Wo = Dense(self.units, kernel_initializer=self.k_ini) + else: + Wi = Conv1D(self.units, kernel_size=3, padding='SAME', kernel_initializer=self.k_ini) + Wf = Conv1D(self.units, kernel_size=3, padding='SAME', kernel_initializer=self.k_ini) + Wc = Conv1D(self.units, kernel_size=3, padding='SAME', kernel_initializer=self.k_ini) + Wo = Conv1D(self.units, kernel_size=3, padding='SAME', kernel_initializer=self.k_ini) + + if self.if_SA: + # Si = Dense(input_shape[-1]) + # temp1 = Dense(input_shape[-1] + 1) + Si = Dense(self.units + input_shape[-1], use_bias=False) + temp1 = Dense(self.units + input_shape[-1] + 1, use_bias=False) + + self.Si.append(Si) + self.temp1.append(temp1) + if self.if_mutiHead: + head_dim = input_shape[-1] // self.num_heads + # 如果传入了qk_scale就用传入的,如果没传入就用sqrt(head_dim) + self.scale = self.qkv_scale or head_dim ** -0.5 + + self.qkv = Dense(3 * (self.units + input_shape[-1]), use_bias=self.qkv_bias, name="qkv", + kernel_initializer=self.k_ini, bias_initializer=self.b_ini) + self.attn_drop = layers.Dropout(self.attn_drop_ratio) + # 这里的全连接层是生成Wo矩阵,将得到的b进一步拼接 + # 由于这里multi-head self-attention模块的输入输出维度是一样的,所以这里的节点个数是dim + + self.proj = layers.Dense(input_shape[-1] + self.units, name="out", + kernel_initializer=self.k_ini, bias_initializer=self.b_ini) + self.proj_drop = layers.Dropout(self.proj_drop_ratio) + + self.reshape1 = tf.keras.layers.Reshape( + target_shape=(1, 3, self.num_heads, (input_shape[-1] + self.units) // self.num_heads)) + + self.reshape2 = tf.keras.layers.Reshape( + target_shape=(1, (input_shape[-1] + self.units))) + + + + self.Wi.append(Wi) + self.Wf.append(Wf) + self.Wc.append(Wc) + self.Wo.append(Wo) + + def call(self, inputs, layer='LSTM', z=0, query=None, batch_size=None, **kwargs): + self.inputs = inputs + # 这里在之前判断过,就不需要判断了 + # if query == None: + # query = self.query + # if batch_size == None: + # batch_size = self.batch_size + return self.getLayer(layer=layer, query=query, z=z, batch_size=batch_size) + + def getLayer(self, layer='LSTM', query=None, z=0, batch_size=None): + if layer == 'LSTM': + self.if_SA = False + self.if_Conv = False + layer = self.LSTM_layer() + return layer + + elif layer == 'ConvLSTM': + self.if_SA = False + self.if_Conv = True + layer = self.convLSTM() + return layer + + elif layer == 'SA_LSTM': + self.if_SA = True + self.if_Conv = False + layer = self.SA_LSTM(query, z=z) + return layer + + elif layer == 'SA_ConvLSTM': + self.if_SA = True + self.if_Conv = True + layer = self.SA_ConvLSTM(query, z=z, batch_size=batch_size) + return layer + elif layer == 'SA_ConvLSTM1': + self.if_mutiHead = True + + layer = self.SA_ConvLSTM1() + return layer + + else: + raise ValueError("算法尚未实现") + + def LSTM_layer(self): + input = self.inputs + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + # print(filter_num, dims) + + for batch in range(filter_num): + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + else: + new_input = tf.pad(new_input,[[0,0],[0,0],[0,self.units]]) + + Wi = self.Wi[0](new_input) + Wf = self.Wf[0](new_input) + Wc = self.Wc[0](new_input) + Wo = self.Wo[0](new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if batch != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.add(ft, tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(output, [-1, filter_num, units]) + + # print(output.shape) + return output + + def convLSTM(self): + input = self.inputs + batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + # print(filter_num, dims) + + for batch in range(filter_num): + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + else: + new_input = tf.pad(new_input, [[0, 0], [0, 0], [0, self.units]]) + + Wi = self.Wi[0](new_input) + Wf = self.Wf[0](new_input) + Wc = self.Wc[0](new_input) + Wo = self.Wo[0](new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if batch != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.add(ft, tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(output, [-1, filter_num, units]) + + # print(output.shape) + return output + + def SA_LSTM(self): + output = self.SA_ConvLSTM1() + + return output + + # self_attention with true_query + def SA_ConvLSTM(self, query, z=0, batch_size=None): + # TODO 解决模型保存时,该数组会被序列化,然后返序列化以后不再是np或者是tf的问题 + query = tf.cast(query, dtype=tf.float32) + # print(query.shape) + + if batch_size == None: + batch_size = self.batch_size + + input = self.inputs + # batch_size = self.batch_size + units = self.units + + epoch, filter_num, dims = input.shape + # print(filter_num, dims) + + for batch in range(filter_num): + + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + # new_input.shape=(1,50,1) + # self_attention模块 + # query_cell = query[batch * batch_size:(batch + 1) * batch_size, batch, :] + query_cell = tf.expand_dims(query[z * batch_size:(z + 1) * batch_size, batch, :], axis=-1) + # query_cell = tf.expand_dims(temp, axis=1) + new_input1 = tf.concat([new_input, query_cell], axis=-1) + + (_, _, new_input_dims) = new_input1.shape + temp1 = self.temp1[0](new_input1) + temp1 = temp1[:, :, :-1] + + temp2 = tf.nn.tanh(temp1) + + Si = self.Si[0](temp2) + ai = tf.nn.softmax(Si) + ones = tf.ones(shape=ai.shape) + + new_input = tf.multiply((ai + ones), new_input) + + Wi = self.Wi[0](new_input) + Wf = self.Wf[0](new_input) + Wc = self.Wc[0](new_input) + Wo = self.Wo[0](new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if batch != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.add(ft, tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + # output = tf.reshape(sum, [batch_size , filter_num, units]) + # output=tf.expand_dims(output,axis=0) + + # print(output.shape) + # print("z=", z) + + return output + + # self_attention with kqv + def SA_ConvLSTM1(self): + input = self.inputs + + epoch, filter_num, dims = input.shape + # print(filter_num, dims) + + for batch in range(filter_num): + + new_input = input[:, batch, :] + new_input = tf.expand_dims(new_input, axis=1) + + if batch == 0: + new_input = tf.pad(new_input,[[0,0],[0,0],[0,self.units]]) + + if batch != 0: + new_input = tf.concat([new_input, ht_1], axis=-1) + + # self_attention模块 + new_input = self.muti_head_attention(new_input, z=batch) + + Wi = self.Wi[0](new_input) + Wf = self.Wf[0](new_input) + Wc = self.Wc[0](new_input) + Wo = self.Wo[0](new_input) + + ft = tf.nn.sigmoid(Wf) + it = tf.nn.sigmoid(Wi) + ct_ = tf.nn.tanh(Wc) + ot = tf.nn.sigmoid(Wo) + + if batch != 0: + ct = tf.add(tf.multiply(ft, ct_1), tf.multiply(it, ct_)) + else: + ct = tf.add(ft, tf.multiply(it, ct_)) + ht = tf.multiply(tf.nn.tanh(ct), ot) + if batch == 0: + output = ht + else: + output = tf.concat([output, ht], axis=1) + ht_1 = ht + ct_1 = ct + + return output + + + + def muti_head_attention(self, inputs, z=0, training=None): + + batch, filter_num, dims = inputs.shape + + qkv = self.qkv(inputs) + qkv = self.reshape1(qkv) + # qkv(): -> [batch_size, num_patches + 1, 3 * total_embed_dim] + # 分成三份,分别对应qkv,C // self.num_heads得到每一个head的维度 + # reshape: -> [batch_size, num_patches + 1, 3, num_heads, embed_dim_per_head] + + # 用transpose方法,来调整一下维度的顺序,[2, 0, 3, 1, 4]表示调换之后的顺序 + # transpose: -> [3, batch_size, num_heads, num_patches + 1, embed_dim_per_head] + qkv = tf.transpose(qkv, [2, 0, 3, 1, 4]) + # [batch_size, num_heads, num_patches + 1, embed_dim_per_head] + q, k, v = qkv[0], qkv[1], qkv[2] + + # transpose: -> [batch_size, num_heads, embed_dim_per_head, num_patches + 1] + # 这里的矩阵相乘实际上指的是矩阵的最后两个维度相乘,而b的转置(transpose_b) + # 实际上是[batch_size, num_heads, embed_dim_per_head, num_patches + 1] + # multiply -> [batch_size, num_heads, num_patches + 1, num_patches + 1] + attn = tf.matmul(a=q, b=k, transpose_b=True) * self.scale + attn = tf.nn.softmax(attn, axis=-1) + attn = self.attn_drop(attn, training=training) + + # 与v相乘得到b + # multiply -> [batch_size, num_heads, num_patches + 1, embed_dim_per_head] + x = tf.matmul(attn, v) + # 再用transpose调换一下顺序 + # transpose: -> [batch_size, num_patches + 1, num_heads, embed_dim_per_head] + x = tf.transpose(x, [0, 2, 1, 3]) + # reshape: -> [batch_size, num_patches + 1, total_embed_dim] + + x = self.reshape2(x) + x = self.proj(x) + + + + # 与Wo相乘,进一步融合得到输出 + x = self.proj_drop(x, training=training) + + return x + +# if __name__ == '__main__': +# input=tf.random.truncated_normal(shape=[5,10]) +# LSTM(input=input).getlayer() diff --git a/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/__init__.py new file mode 100644 index 0000000..32bfe4c --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LSTM/before/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/14 13:49 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/LossFunction/FTMSE.py b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/FTMSE.py new file mode 100644 index 0000000..4e61cfb --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/FTMSE.py @@ -0,0 +1,53 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/6/13 21:15 +@Usage : +@Desc : 时频域损失 +''' + +import tensorflow as tf +import tensorflow.keras.backend as K + + +class FTMSE(tf.keras.losses.Loss): + + def call(self, y_true, y_pred): + # y_true = tf.cast(y_true, tf.float32) + # y_pred = tf.cast(y_pred, tf.float32) + + # tf.print(y_true) + # tf.print(y_pred) + + # 需要转为复数形式 + _, length = y_pred.shape + + # 打印精确的实部和虚部 + yt_fft = tf.signal.fft(tf.complex(y_true, tf.zeros_like(y_true))) + yp_fft = tf.signal.fft(tf.complex(y_pred, tf.zeros_like(y_pred))) + + # 幅值 + yt_amp = tf.abs(yt_fft/length) + yp_amp = tf.abs(yp_fft/length) + # yt_amp = tf.abs(yt_fft) + # yp_amp = tf.abs(yp_fft) + # 相角 + yt_angle = tf.math.angle(yt_fft) + yp_angle = tf.math.angle(yp_fft) + + # tf.print("yt_amp",yt_amp) + # tf.print("yp_amp",yp_amp) + # tf.print("yt_angle",yt_angle) + # tf.print("yp_angle",yp_angle) + + time_loss = K.mean(tf.keras.losses.mean_squared_error(y_true, y_pred),axis=-1) + amp_loss = K.mean(tf.keras.losses.mean_squared_error(yt_amp, yp_amp),axis=-1) + angle_loss = K.mean(tf.keras.losses.mean_squared_error(yt_angle, yp_angle),axis=-1) + tf.print("time_loss:", time_loss, "amp_loss", amp_loss, "angle_loss", angle_loss) + + ftLoss = time_loss + amp_loss*5 + # ftLoss = time_loss + 5 * amp_loss + 0.25 * angle_loss + # ftLoss = time_loss + # + return ftLoss diff --git a/TensorFlow_eaxmple/Model_train_test/model/LossFunction/GIoU_Loss.py b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/GIoU_Loss.py new file mode 100644 index 0000000..efd51f4 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/GIoU_Loss.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + +''' +@Author : dingjiawen +@Date : 2022/7/19 10:16 +@Usage : +@Desc : +''' + +import numpy as np + +def Giou_np(bbox_p, bbox_g): + """ + :param bbox_p: predict of bbox(N,4)(x1,y1,x2,y2) + :param bbox_g: groundtruth of bbox(N,4)(x1,y1,x2,y2) + :return: + """ + # for details should go to https://arxiv.org/pdf/1902.09630.pdf + # ensure predict's bbox form + x1p = np.minimum(bbox_p[:, 0], bbox_p[:, 2]).reshape(-1,1) + x2p = np.maximum(bbox_p[:, 0], bbox_p[:, 2]).reshape(-1,1) + y1p = np.minimum(bbox_p[:, 1], bbox_p[:, 3]).reshape(-1,1) + y2p = np.maximum(bbox_p[:, 1], bbox_p[:, 3]).reshape(-1,1) + + bbox_p = np.concatenate([x1p, y1p, x2p, y2p], axis=1) + # calc area of Bg + area_p = (bbox_p[:, 2] - bbox_p[:, 0]) * (bbox_p[:, 3] - bbox_p[:, 1]) + # calc area of Bp + area_g = (bbox_g[:, 2] - bbox_g[:, 0]) * (bbox_g[:, 3] - bbox_g[:, 1]) + + # cal intersection + x1I = np.maximum(bbox_p[:, 0], bbox_g[:, 0]) + y1I = np.maximum(bbox_p[:, 1], bbox_g[:, 1]) + x2I = np.minimum(bbox_p[:, 2], bbox_g[:, 2]) + y2I = np.minimum(bbox_p[:, 3], bbox_g[:, 3]) + I = np.maximum((y2I - y1I), 0) * np.maximum((x2I - x1I), 0) + + # find enclosing box + x1C = np.minimum(bbox_p[:, 0], bbox_g[:, 0]) + y1C = np.minimum(bbox_p[:, 1], bbox_g[:, 1]) + x2C = np.maximum(bbox_p[:, 2], bbox_g[:, 2]) + y2C = np.maximum(bbox_p[:, 3], bbox_g[:, 3]) + + # calc area of Bc + area_c = (x2C - x1C) * (y2C - y1C) + U = area_p + area_g - I + iou = 1.0 * I / U + + # Giou + giou = iou - (area_c - U) / area_c + + # loss_iou = 1 - iou loss_giou = 1 - giou + loss_iou = 1.0 - iou + loss_giou = 1.0 - giou + return giou, loss_iou, loss_giou + +# def giou_tf + + + + +if __name__ == '__main__': + + p = np.array([[21,45,103,172], + [34,283,155,406], + [202,174,271,255]]) + g = np.array([[59,106,154,230], + [71,272,191,419], + [257,244,329,351]]) + Giou_np(p, g) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/LossFunction/IoU_Loss.py b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/IoU_Loss.py new file mode 100644 index 0000000..35fbb33 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/IoU_Loss.py @@ -0,0 +1,47 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + +''' +@Author : dingjiawen +@Date : 2022/7/18 21:33 +@Usage : IoU loss Function +@Desc : +''' +import tensorflow.keras.backend as K + +# 实际上就是计算边框没有重合的部分占重合部分的比重 +def iou_loss(y_true, y_pred): + # iou loss for bounding box prediction + # input must be as [x1, y1, x2, y2] + + # AOG = Area of Groundtruth box + AoG = K.abs(K.transpose(y_true)[2] - K.transpose(y_true)[0] + 1) * K.abs( + K.transpose(y_true)[3] - K.transpose(y_true)[1] + 1) + + # AOP = Area of Predicted box + AoP = K.abs(K.transpose(y_pred)[2] - K.transpose(y_pred)[0] + 1) * K.abs( + K.transpose(y_pred)[3] - K.transpose(y_pred)[1] + 1) + + # overlaps are the co-ordinates of intersection box + overlap_0 = K.maximum(K.transpose(y_true)[0], K.transpose(y_pred)[0]) + overlap_1 = K.maximum(K.transpose(y_true)[1], K.transpose(y_pred)[1]) + overlap_2 = K.minimum(K.transpose(y_true)[2], K.transpose(y_pred)[2]) + overlap_3 = K.minimum(K.transpose(y_true)[3], K.transpose(y_pred)[3]) + + # intersection area + intersection = (overlap_2 - overlap_0 + 1) * (overlap_3 - overlap_1 + 1) + + # area of union of both boxes + union = AoG + AoP - intersection + + # iou calculation + iou = intersection / union + + # bounding values of iou to (0,1) + iou = K.clip(iou, 0.0 + K.epsilon(), 1.0 - K.epsilon()) + + # loss for the iou value + iou_loss = -K.log(iou) + + return iou_loss \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/LossFunction/TransferLoss.py b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/TransferLoss.py new file mode 100644 index 0000000..a91a20d --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/TransferLoss.py @@ -0,0 +1,41 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 16:47 +@Usage : +@Desc : +''' +from model.LossFunction.transfer.mmd import MMDLoss +import tensorflow as tf +import tensorflow.losses + + +class TransferLoss(tf.keras.losses.Loss): + def __init__(self, loss_type='cosine'): + """ + Supported loss_type: mmd(mmd_lin), mmd_rbf, coral, cosine, kl, js, mine, adv + """ + self.loss_type = loss_type + + + def call(self, X, Y): + """Compute adaptation loss + + Arguments: + X {tensor} -- source matrix + Y {tensor} -- target matrix + + Returns: + [tensor] -- transfer loss + """ + if self.loss_type == 'mmd_lin' or self.loss_type == 'mmd': + mmdloss = MMDLoss(kernel_type='linear') + loss = mmdloss(X, Y) + elif self.loss_type == 'cosine' or self.loss_type == 'cos': + loss = 1 - tf.losses.cosine_similarity(X, Y) + elif self.loss_type == 'mmd_rbf': + mmdloss = MMDLoss(kernel_type='rbf') + loss = mmdloss(X, Y) + + return loss diff --git a/TensorFlow_eaxmple/Model_train_test/model/LossFunction/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/__init__.py new file mode 100644 index 0000000..2d80c0a --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/__init__.py @@ -0,0 +1,10 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + +''' +@Author : dingjiawen +@Date : 2022/7/18 21:33 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/LossFunction/smooth_L1_Loss.py b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/smooth_L1_Loss.py new file mode 100644 index 0000000..bd43b5e --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/smooth_L1_Loss.py @@ -0,0 +1,24 @@ +# -*- coding: utf-8 -*- + +# coding: utf-8 + +''' +@Author : dingjiawen +@Date : 2022/7/20 14:13 +@Usage : +@Desc : +''' +import tensorflow as tf +import tensorflow.keras.backend as K + + +class SmoothL1Loss(tf.keras.losses.Loss): + def call(self, y_true, y_pred): + y_true = tf.cast(y_true, tf.float32) + y_pred = tf.cast(y_pred, tf.float32) + dif = tf.reduce_mean(tf.abs(y_true - y_pred)) + if dif < 1: + return tf.reduce_mean(0.5 * tf.square(y_pred - y_true)) + else: + return dif - 0.5 + # return tf.reduce_mean(tf.square(y_pred - y_true)) diff --git a/TensorFlow_eaxmple/Model_train_test/model/LossFunction/transfer/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/transfer/__init__.py new file mode 100644 index 0000000..ccfa5ee --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/transfer/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 16:54 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/LossFunction/transfer/mmd.py b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/transfer/mmd.py new file mode 100644 index 0000000..675f076 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/LossFunction/transfer/mmd.py @@ -0,0 +1,75 @@ +import tensorflow as tf +import numpy as np + + +class MMDLoss(tf.keras.losses.Loss): + def __init__(self, kernel_type='linear', kernel_mul=2.0, kernel_num=5): + super(MMDLoss, self).__init__() + self.kernel_type = kernel_type + self.kernel_mul = kernel_mul + self.kernel_num = kernel_num + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'kernel_type': self.kernel_type, + 'kernel_mul': self.kernel_mul, + 'kernel_num': self.kernel_num + } + ) + base_config = super(MMDLoss, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def guassian_kernel(self, source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None): + n_samples = int(source.shape[0]) + int(target.shape[0]) + total = tf.concat([source, target], axis=0) + total0 = tf.expand_dims(total, 0) + total0 = tf.tile(total0, [total.shape[0], 1, 1]) + total1 = tf.expand_dims(total, 1) + total1 = tf.tile(total1, [1, total.shape[0], 1]) + L2_distance = tf.reduce_sum((total0 - total1) ** 2, axis=2) + + if fix_sigma: + bandwidth = fix_sigma + else: + bandwidth = tf.reduce_sum(L2_distance) / (n_samples ** 2 - n_samples) + bandwidth /= kernel_mul ** (kernel_num // 2) + bandwidth_list = [bandwidth * (kernel_mul ** i) + for i in range(kernel_num)] + kernel_val = [tf.exp(-L2_distance / bandwidth_temp) + for bandwidth_temp in bandwidth_list] + return sum(kernel_val) + + def linear_mmd(self, X, Y): + delta = tf.reduce_mean(X, axis=0) - tf.reduce_mean(Y, axis=0) + loss = tf.linalg.matmul(delta, delta, transpose_b=True) + return loss + + def call(self, source, target): + if self.kernel_type == 'linear': + return self.linear_mmd(source, target) + elif self.kernel_type == 'rbf': + batch_size = int(source.shape[0]) + kernels = self.guassian_kernel( + source, target, kernel_mul=self.kernel_mul, kernel_num=self.kernel_num, fix_sigma=None) + with tf.GradientTape(persistent=True) as tape: + tape.watch(kernels) + XX = tf.reduce_mean(kernels[:batch_size, :batch_size]) + YY = tf.reduce_mean(kernels[batch_size:, batch_size:]) + XY = tf.reduce_mean(kernels[:batch_size, batch_size:]) + YX = tf.reduce_mean(kernels[batch_size:, :batch_size]) + loss = XX + YY - XY - YX + return loss + + +if __name__ == '__main__': + # 示例用法 + source = np.random.randn(100, 128) + target = np.random.randn(100, 128) + source_tf = tf.convert_to_tensor(source, dtype=tf.float32) + target_tf = tf.convert_to_tensor(target, dtype=tf.float32) + + mmd_loss = MMDLoss(kernel_type='rbf', kernel_mul=2.0, kernel_num=5) + loss = mmd_loss(source_tf, target_tf) + print("MMD Loss:", loss.numpy()) diff --git a/TensorFlow_eaxmple/Model_train_test/model/SAE/SAE_realize.py b/TensorFlow_eaxmple/Model_train_test/model/SAE/SAE_realize.py new file mode 100644 index 0000000..dd7f11c --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/SAE/SAE_realize.py @@ -0,0 +1,159 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +from tensorflow.keras import * +import tensorflow.keras.backend as kb +import sys +import matplotlib.pyplot as plt + + +# 输入输出为16 × 1的列表 +# inputList为输入列表 +def SAEFC(inputList): + inputList = np.array(inputList) + # 输入特征个数 + inputFeatureNum = len(inputList[0]) + # 隐藏层参数个数:输入特征3倍 + hiddenNum = 3 * inputFeatureNum + # 稀疏度(密度) + density = 0.1 + + lossList = [] + saeModel = SAEModel(inputList.shape[-1], hiddenNum) + for i in range(1000): + loss = saeModel.network_learn(tf.constant(inputList)) + lossList.append(loss) + print(loss) + + # 绘制损失值图像 + x = np.arange(len(lossList)) + 1 + plt.plot(x, lossList) + plt.show() + + return saeModel + + +# 自定义隐藏层 +class SAELayer(layers.Layer): + def __init__(self, num_outputs): + super(SAELayer, self).__init__() + # 该层最后一个节点,其值固定为1, + # 前期可以按照同样的手段让该节点和其他节点一样进行计算, + # 最后在传递给下一层前,将其设置为1即可(即其值固定为1) + self.num_outputs = num_outputs + + def build(self, input_shape): + self.kernel = self.add_variable("kernel", + shape=[int(input_shape[-1]), + self.num_outputs - 1]) + self.bias = self.add_variable("bias", + shape=[self.num_outputs - 1]) + + def call(self, input): + output = tf.matmul(input, self.kernel) + self.bias + # sigmoid函数 + output = tf.nn.sigmoid(output) + bias_list = tf.ones([input.shape[0], 1]) + output = tf.concat([output, bias_list], 1) + self.result = output + return output + + +# 自定义模型 +class SAEModel(Model): + # 可以传入一些超参数,用以动态构建模型 + # __init_——()方法在创建模型对象时被调用 + # input_shape: 输入层和输出层的节点个数(输入层实际要比这多1,因为有个bias) + # hidden_shape: 隐藏层节点个数,隐藏层节点的最后一个节点值固定为1,也是bias + # 使用方法:直接传入实际的input_shape即可,在call中也直接传入原始Input_tensor即可 + # 一切关于数据适配模型的处理都在模型中实现 + def __init__(self, input_shape, hidden_shape=None): + # print("init") + # 隐藏层节点个数默认为输入层的3倍 + if hidden_shape == None: + hidden_shape = 3 * input_shape + # 调用父类__init__()方法 + super(SAEModel, self).__init__() + + self.train_loss = None + self.layer_2 = SAELayer(hidden_shape) + self.layer_3 = layers.Dense(input_shape, activation=tf.nn.sigmoid) + + def call(self, input_tensor, training=False): + # 将input_tensor最后加一列1 + bias_list = tf.ones([len(input_tensor), 1]) + input_tensor = tf.concat([input_tensor, bias_list], 1) + # 输入数据 + # x = self.layer_1(input_tensor) + hidden = self.layer_2(input_tensor) + output = self.layer_3(hidden) + return output + + def get_loss(self, input_tensor): + # print("get_loss") + bias_list = tf.ones([len(input_tensor), 1]) + new_input = tf.concat([input_tensor, bias_list], 1) + hidden = self.layer_2(new_input) + output = self.layer_3(hidden) + + # 计算loss + # 计算MSE + mse = (1 / 2) * tf.reduce_sum(kb.square(input_tensor - output)) + + # 计算权重乘法项 + alpha = 0.1 + W1 = self.layer_2.kernel + W2 = self.layer_3.kernel + weightPunish = (alpha / 2) * (tf.reduce_sum(kb.square(W1)) + tf.reduce_sum(kb.square(W2))) + + # 计算KL散度 + # 惩罚因子 + beita = 0.1 + # 每一层的期望密度 + desired_density = 0.1 + layer2_output = self.layer_2.result + + + + + # 实际密度是所有输入数据的密度的平均值 + actual_density = tf.reduce_mean(tf.math.count_nonzero(layer2_output, axis=1) / layer2_output.shape[1]) + actual_density = tf.cast(actual_density, tf.float32) + if actual_density == tf.constant(1.0, dtype=tf.float32): + actual_density = tf.constant(0.999) + actual_density = actual_density.numpy() + + KL = desired_density * np.log(desired_density / actual_density) + KL += (1 - desired_density) * np.log((1 - desired_density) / (1 - actual_density)) + KL *= beita + ans = tf.constant(mse + weightPunish + KL) + return ans + + def get_grad(self, input_tensor): + with tf.GradientTape() as tape: + # todo 原本tape只会监控由tf.Variable创建的trainable=True属性 + tape.watch(self.variables) + L = self.get_loss(input_tensor) + # 保存一下loss,用于输出 + self.train_loss = L + g = tape.gradient(L, self.variables) + return g + + def network_learn(self, input_tensor): + g = self.get_grad(input_tensor) + optimizers.Adam().apply_gradients(zip(g, self.variables)) + return self.train_loss + + # 如果模型训练好了,需要获得隐藏层的输出,直接获取麻烦,则直接运行一遍 + def getReprestation(self, input_tensor): + bias_list = tf.ones([len(input_tensor), 1]) + new_input = tf.concat([input_tensor, bias_list], 1) + hidden = self.layer_2(new_input) + return hidden + + +if __name__ == '__main__': + + saeModel = SAEModel(inputList.shape[-1], hiddenNum) + for i in range(1000): + saeModel.network_learn(tf.constant(inputList)) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/SAE/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/SAE/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/model/SelfAttention/SelfAttention.py b/TensorFlow_eaxmple/Model_train_test/model/SelfAttention/SelfAttention.py new file mode 100644 index 0000000..d1a7896 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/SelfAttention/SelfAttention.py @@ -0,0 +1,417 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/23 10:53 +@Usage : 即插即用的self_attention模块 +@Desc : +''' +import tensorflow as tf +from tensorflow.keras import Model, layers, initializers +import numpy as np + + +class PatchEmbed(layers.Layer): + """ + 2D Image to Patch Embedding + """ + + def __init__(self, img_size=224, patch_size=16, embed_dim=768): + super(PatchEmbed, self).__init__() + self.embed_dim = embed_dim + self.patch_size=patch_size + self.img_size = (img_size, img_size) + # 将图片划分成 img_size // patch_size行img_size // patch_size列的网格 + self.grid_size = (img_size // patch_size, img_size // patch_size) + # 行列相乘,可以得到patch的数目,即14*14=196,到时候flatten层的输入即是196维 + self.num_patches = self.grid_size[0] * self.grid_size[1] + # con2d是16*16,然后步距也是16,即可将图片划分 + self.proj = layers.Conv2D(filters=embed_dim, kernel_size=patch_size, + strides=patch_size, padding='SAME', + kernel_initializer=initializers.LecunNormal(), + bias_initializer=initializers.Zeros()) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'img_size': self.img_size[0], + 'patch_size': self.patch_size, + 'embed_dim': self.embed_dim + } + ) + base_config = super(PatchEmbed, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + # 正向传播过程 + def call(self, inputs, **kwargs): + # B-Batch的维度,H-高度, W-宽度, C-channel的维度 + B, H, W, C = inputs.shape + # 设置的高和宽要和上面的保持一致,如果不一致会报错 + # 这里和CNN模型不一样,CNN模型会有一个全局池化层来对图片大小进行一个池化,所以可以不限制图片的具体大小 + # 而在transformer中是需要加上一个position embedding的,而这个层就需要知道图片的具体维度来设置position embedding的大小 + assert H == self.img_size[0] and W == self.img_size[1], \ + f"Input image size ({H}*{W}) doesn't match model ({self.img_size[0]}*{self.img_size[1]})." + # 将input传入设置好的conv2d,对其进行输出 + x = self.proj(inputs) + # [B, H, W, C] -> [B, H*W, C] + # reshape成可以进入flatten的形式 + x = tf.reshape(x, [B, self.num_patches, self.embed_dim]) + return x + + +class ConcatClassTokenAddPosEmbed(layers.Layer): + def __init__(self, embed_dim=768, num_patches=196, name=None): + super(ConcatClassTokenAddPosEmbed, self).__init__(name=name) + self.embed_dim = embed_dim + self.num_patches = num_patches + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'num_patches': self.num_patches, + 'embed_dim': self.embed_dim + } + ) + base_config = super(ConcatClassTokenAddPosEmbed, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def build(self, input_shape): + # 创建两个可训练的参数weight,对应于cls_token,pos_embed的weight + # shape第一维是batch维度,后面分别是1*768和197*768,trainable表示是可训练的参数 + self.cls_token = self.add_weight(name="cls", + shape=[1, 1, self.embed_dim], + initializer=initializers.Zeros(), + trainable=True, + dtype=tf.float32) + self.pos_embed = self.add_weight(name="pos_embed", + shape=[1, self.num_patches + 1, self.embed_dim], + initializer=initializers.RandomNormal(stddev=0.02), + trainable=True, + dtype=tf.float32) + + def call(self, inputs, **kwargs): + # 需要获取一下batch的,因为输入图片的时候不是一张图片,而是将图片打包成一个个batch同时输入进去 + batch_size, _, _ = inputs.shape + + # [1, 1, 768] -> [B, 1, 768] + # 把cls_token复制B份进行拼接,broadcast_to方法,将cls_token进行一下广播,在batch维度就可以变成batch维度 + cls_token = tf.broadcast_to(self.cls_token, shape=[batch_size, 1, self.embed_dim]) + # 与input进行拼接 + x = tf.concat([cls_token, inputs], axis=1) # [B, 197, 768] + # 加上位置编码 + x = x + self.pos_embed + + return x + + +class SelfAttention(layers.Layer): + # 定义两个权重初始化方法,方便后续调用 + k_ini = initializers.GlorotUniform() + b_ini = initializers.Zeros() + + # dim是前面的embed的dimension,num_heads多头注意力的头数 + def __init__(self, + dim, + num_heads=8, + qkv_bias=False, + qk_scale=None, + attn_drop_ratio=0., + proj_drop_ratio=0., + name=None): + super(SelfAttention, self).__init__(name=name) + + self.dim = dim + self.num_heads = num_heads + self.qkv_bias = qkv_bias + self.qk_scale = qk_scale + self.attn_drop_ratio = attn_drop_ratio + self.proj_drop_ratio = proj_drop_ratio + + + + + # 每一个head的dimension=输入的dimension/num_heads + head_dim = dim // num_heads + # 做softmax时会除一个sqrt(dk),这里的scale就是那个sqrt(dk)——缩放因子 + # 如果传入了qk_scale就用传入的,如果没传入就用sqrt(head_dim) + self.scale = qk_scale or head_dim ** -0.5 + # 在有的做法中,生成QKV三个矩阵时会用三个全连接层 + # 这里用3*dim维的大全连接层,可以达到一样的效果 + self.qkv = layers.Dense(dim * 3, use_bias=qkv_bias, name="qkv", + kernel_initializer=self.k_ini, bias_initializer=self.b_ini) + self.attn_drop = layers.Dropout(attn_drop_ratio) + # 这里的全连接层是生成Wo矩阵,将得到的b进一步拼接 + # 由于这里multi-head self-attention模块的输入输出维度是一样的,所以这里的节点个数是dim + self.proj = layers.Dense(dim, name="out", + kernel_initializer=self.k_ini, bias_initializer=self.b_ini) + self.proj_drop = layers.Dropout(proj_drop_ratio) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'dim': self.dim, + 'num_heads': self.num_heads, + 'qkv_bias': self.qkv_bias, + 'qk_scale': self.qk_scale, + 'attn_drop_ratio': self.attn_drop_ratio, + 'proj_drop_ratio': self.proj_drop_ratio, + } + ) + base_config = super(SelfAttention, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, training=None): + # 由于进入self-attention的时候就已经将展平过了,所以这里的inputs.shape只有三个维度 + # [batch_size, num_patches + 1, total_embed_dim] + B, N, C = inputs.shape + # B, N, C = tf.shape(inputs)[0],tf.shape(inputs)[1],tf.shape(inputs)[2] + + # qkv(): -> [batch_size, num_patches + 1, 3 * total_embed_dim] + qkv = self.qkv(inputs) + # 分成三份,分别对应qkv,C // self.num_heads得到每一个head的维度 + # reshape: -> [batch_size, num_patches + 1, 3, num_heads, embed_dim_per_head] + # qkv = tf.reshape(qkv, shape=[B, N, 3, self.num_heads, C // self.num_heads]) + qkv = tf.reshape(qkv, shape=[-1, N, 3, self.num_heads, C // self.num_heads]) + # qkv = tf.keras.layers.Reshape(target_shape=[B, N, 3, self.num_heads, C // self.num_heads])(qkv) + # 用transpose方法,来调整一下维度的顺序,[2, 0, 3, 1, 4]表示调换之后的顺序 + # transpose: -> [3, batch_size, num_heads, num_patches + 1, embed_dim_per_head] + qkv = tf.transpose(qkv, [2, 0, 3, 1, 4]) + # [batch_size, num_heads, num_patches + 1, embed_dim_per_head] + q, k, v = qkv[0], qkv[1], qkv[2] + + # transpose: -> [batch_size, num_heads, embed_dim_per_head, num_patches + 1] + # 这里的矩阵相乘实际上指的是矩阵的最后两个维度相乘,而b的转置(transpose_b) + # 实际上是[batch_size, num_heads, embed_dim_per_head, num_patches + 1] + # multiply -> [batch_size, num_heads, num_patches + 1, num_patches + 1] + attn = tf.matmul(a=q, b=k, transpose_b=True) * self.scale + attn = tf.nn.softmax(attn, axis=-1) + attn = self.attn_drop(attn, training=training) + + # 与v相乘得到b + # multiply -> [batch_size, num_heads, num_patches + 1, embed_dim_per_head] + x = tf.matmul(attn, v) + # 再用transpose调换一下顺序 + # transpose: -> [batch_size, num_patches + 1, num_heads, embed_dim_per_head] + x = tf.transpose(x, [0, 2, 1, 3]) + # reshape: -> [batch_size, num_patches + 1, total_embed_dim] + # x = tf.reshape(x, [B, N, C]) + x = tf.reshape(x, [-1, N, C]) + + # 与Wo相乘,进一步融合得到输出 + x = self.proj(x) + x = self.proj_drop(x, training=training) + return x + + +class MLP(layers.Layer): + """ + MLP as used in Vision Transformer, MLP-Mixer and related networks + """ + # 定义两个权重初始化方法 + k_ini = initializers.GlorotUniform() + b_ini = initializers.RandomNormal(stddev=1e-6) + + # in_deatures表示输入MLP模块对应的dimension,mlp_ratio=4.0表示翻四倍 + def __init__(self, in_features, mlp_ratio=4.0, drop_rate=0., name=None): + super(MLP, self).__init__(name=name) + + self.in_features = in_features + self.mlp_ratio = mlp_ratio + self.drop_rate = drop_rate + + self.fc1 = layers.Dense(int(in_features * mlp_ratio), name="Dense_0", + kernel_initializer=self.k_ini, bias_initializer=self.b_ini) + self.act = layers.Activation("relu") + self.fc2 = layers.Dense(in_features, name="Dense_1", + kernel_initializer=self.k_ini, bias_initializer=self.b_ini) + self.drop = layers.Dropout(drop_rate) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'in_features': self.in_features, + 'mlp_ratio': self.mlp_ratio, + 'drop_rate': self.drop_rate, + } + ) + base_config = super(MLP, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, training=None): + x = self.fc1(inputs) + x = self.act(x) + x = self.drop(x, training=training) + x = self.fc2(x) + x = self.drop(x, training=training) + return x + + +class Block(layers.Layer): + def __init__(self, + dim, + num_heads=8, + qkv_bias=False, + qk_scale=None, + drop_ratio=0., + attn_drop_ratio=0., + drop_path_ratio=0., + name=None): + super(Block, self).__init__(name=name) + + self.dim = dim + self.num_heads = num_heads + self.qkv_bias = qkv_bias + self.qk_scale = qk_scale + self.drop_ratio = drop_ratio + self.attn_drop_ratio = attn_drop_ratio + self.drop_path_ratio = drop_path_ratio + + + + + # LayerNormalization来进行正则化 + self.norm1 = layers.LayerNormalization(epsilon=1e-6, name="LayerNorm_0") + # 调用Attention类,来实现MultiHeadAttention + self.attn = SelfAttention(dim, num_heads=num_heads, + qkv_bias=qkv_bias, qk_scale=qk_scale, + attn_drop_ratio=attn_drop_ratio, proj_drop_ratio=drop_ratio, + name="MultiHeadAttention") + # 这里所一个判断,如果drop_path_ratio > 0.就构建droppath方法 + # 如果drop_path_ratio < 0,就用linear,即输入是什么输出就是什么,不作操作 + # droppath方式的实现Dropout+noise_shape=(None, 1, 1)就可以实现droppath方法 + # 第一个None表示的是batch维度,第一个1表示的是num_patches+1,最后一个1表示的是embed_dimension + # NOTE: drop path for stochastic depth, we shall see if this is better than dropout here + self.drop_path = layers.Dropout(rate=drop_path_ratio, noise_shape=(None, 1, 1)) if drop_path_ratio > 0. \ + else layers.Activation("linear") + self.norm2 = layers.LayerNormalization(epsilon=1e-6, name="LayerNorm_1") + self.mlp = MLP(dim, drop_rate=drop_ratio, name="MlpBlock") + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'dim': self.dim, + 'num_heads': self.num_heads, + 'qkv_bias': self.qkv_bias, + 'qk_scale': self.qk_scale, + 'drop_ratio': self.drop_ratio, + 'attn_drop_ratio': self.attn_drop_ratio, + 'drop_path_ratio': self.drop_path_ratio, + } + ) + base_config = super(Block, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, training=None): + # 对应于图中第一个加号以前的部分 + x = inputs + self.drop_path(self.attn(self.norm1(inputs)), training=training) + # 对应于图中第一个加号以后的部分 + x = x + self.drop_path(self.mlp(self.norm2(x)), training=training) + return x + + +class VisionTransformer(Model): + + # depth表示的是重复encoder block的次数,num_heads表示的是在multi-head self-attention中head的个数 + # MLP block中有一个Pre_logist,这里指的是,当在较大的数据集上学习的时候Pre_logist就表示一个全连接层加上一个tanh激活函数 + # 当在较小的数据集上学习的时候,Pre_logist是没有的,而这里的representation_size表示的就是Pre_logist中全连接层的节点个数 + # num_classes表示分类的类数 + def __init__(self, img_size=224, patch_size=16, embed_dim=768, + depth=12, num_heads=12, qkv_bias=True, qk_scale=None, + drop_ratio=0., attn_drop_ratio=0., drop_path_ratio=0., + representation_size=None, num_classes=1000, name="ViT-B/16"): + super(VisionTransformer, self).__init__(name=name) + + self.img_size=img_size + self.patch_size=patch_size + self.num_classes = num_classes + self.num_heads = num_heads + + self.embed_dim = embed_dim + self.depth = depth + self.qkv_bias = qkv_bias + self.qk_scale = qk_scale + self.drop_ratio = drop_ratio + self.attn_drop_ratio = attn_drop_ratio + self.drop_path_ratio = drop_path_ratio + self.representation_size = representation_size + + # 这里实例化了PatchEmbed类 + self.patch_embed = PatchEmbed(img_size=img_size, patch_size=patch_size, embed_dim=embed_dim) + # 将PatchEmbed类中的num_patches取出来赋值给num_patches + num_patches = self.patch_embed.num_patches + # 这里实例化了ConcatClassTokenAddPosEmbed类 + self.cls_token_pos_embed = ConcatClassTokenAddPosEmbed(embed_dim=embed_dim, + num_patches=num_patches, + name="cls_pos") + + self.pos_drop = layers.Dropout(drop_ratio) + + dpr = np.linspace(0., drop_path_ratio, depth) # stochastic depth decay rule + # 用一个for循环重复Block模块 + # 在用droppath时的drop_path_ratio是由0慢慢递增到我们所指定的drop_path_ratio的 + # 所以我们在构建Block时,这里的drop_path_ratio时变化的,所以用 np.linspace方法创建一个等差数列来初始化drop_path_ratio + self.blocks = [Block(dim=embed_dim, num_heads=num_heads, qkv_bias=qkv_bias, + qk_scale=qk_scale, drop_ratio=drop_ratio, attn_drop_ratio=attn_drop_ratio, + drop_path_ratio=dpr[i], name="encoderblock_{}".format(i)) + for i in range(depth)] + + self.norm = layers.LayerNormalization(epsilon=1e-6, name="encoder_norm") + + # 接下来,如果传入了representation_size,就构建一个全连接层,激活函数为tanh + # 如果没有传入的话,就不做任何操作 + if representation_size: + self.has_logits = True + self.pre_logits = layers.Dense(representation_size, activation="tanh", name="pre_logits") + else: + self.has_logits = False + self.pre_logits = layers.Activation("linear") + + # 定义最后一个全连接层,节点个数就是我们的分类个数num_classes + self.head = layers.Dense(num_classes, name="head", kernel_initializer=initializers.Zeros()) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'img_size': self.img_size, + 'patch_size': self.patch_size, + 'embed_dim': self.embed_dim, + 'depth': self.depth, + 'num_heads': self.num_heads, + 'qkv_bias': self.qkv_bias, + 'qk_scale': self.qk_scale, + 'drop_ratio': self.drop_ratio, + 'attn_drop_ratio': self.attn_drop_ratio, + 'drop_path_ratio': self.drop_path_ratio, + 'representation_size': self.representation_size, + 'num_classes': self.num_classes + } + ) + base_config = super(VisionTransformer, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + + def call(self, inputs, training=None): + # [B, H, W, C] -> [B, num_patches, embed_dim] + x = self.patch_embed(inputs) # [B, 196, 768] + x = self.cls_token_pos_embed(x) # [B, 197, 768] + x = self.pos_drop(x, training=training) + + for block in self.blocks: + x = block(x, training=training) + + x = self.norm(x) + # 这里是提取class_toke的输出,然后用切片的方式,而刚刚是将class_toke拼接在最前面的 + # 所以这里用切片的方式,去取class_toke的输出,并将它传递给pre_logits + x = self.pre_logits(x[:, 0]) + # 最后传递给head + x = self.head(x) + # 为什么只用class_toke对应的输出,而不用每一个patches对应的输出呢? + # 可以参考原文bird 网络 + + return x diff --git a/TensorFlow_eaxmple/Model_train_test/model/SelfAttention/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/SelfAttention/__init__.py new file mode 100644 index 0000000..af390d4 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/SelfAttention/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/23 10:52 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/VAE/VAE_realize.py b/TensorFlow_eaxmple/Model_train_test/model/VAE/VAE_realize.py new file mode 100644 index 0000000..3fac3b6 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/VAE/VAE_realize.py @@ -0,0 +1,143 @@ +import os +import tensorflow as tf +from tensorflow import keras +from PIL import Image +from matplotlib import pyplot as plt +from tensorflow.keras import Sequential, layers +import numpy as np + +tf.random.set_seed(2322) +np.random.seed(23422) + +os.environ['TF_CPP_MIN_LOG_LEVEL'] = '2' +assert tf.__version__.startswith('2.') + +# 把num张图片保存到一张 +def save_images(img, name,num): + new_im = Image.new('L', (28*num, 28*num)) + index = 0 + for i in range(0, 28*num, 28): + for j in range(0, 28*num, 28): + im = img[index] + im = Image.fromarray(im, mode='L') + new_im.paste(im, (i, j)) + index += 1 + + new_im.save(name) + +# 定义超参数 +batchsz = 256 +lr = 1e-4 + +# 数据集加载,自编码器不需要标签因为是无监督学习 +(x_train, _), (x_test, _) = keras.datasets.fashion_mnist.load_data() +x_train, x_test = x_train.astype(np.float32) / 255., x_test.astype(np.float32) / 255. +train_db = tf.data.Dataset.from_tensor_slices(x_train) +train_db = train_db.shuffle(batchsz * 5).batch(batchsz) +test_db = tf.data.Dataset.from_tensor_slices(x_test) +test_db = test_db.batch(batchsz) + +# 搭建模型 +z_dim = 10 +class VAE(keras.Model): + def __init__(self,z_dim,units=256): + super(VAE, self).__init__() + self.z_dim = z_dim + self.units = units + # 编码网络 + self.vae_encoder = layers.Dense(self.units) + # 均值网络 + self.vae_mean = layers.Dense(self.z_dim) # get mean prediction + # 方差网络(均值和方差是一一对应的,所以维度相同) + self.vae_variance = layers.Dense(self.z_dim) # get variance prediction + + # 解码网络 + self.vae_decoder = layers.Dense(self.units) + # 输出网络 + self.vae_out = layers.Dense(784) + + # encoder传播的过程 + def encoder(self, x): + h = tf.nn.relu(self.vae_encoder(x)) + #计算均值 + mu = self.vae_mean(h) + #计算方差 + log_var = self.vae_variance(h) + + return mu, log_var + + # decoder传播的过程 + def decoder(self, z): + out = tf.nn.relu(self.vae_decoder(z)) + out = self.vae_out(out) + + return out + + def reparameterize(self, mu, log_var): + eps = tf.random.normal(log_var.shape) + + std = tf.exp(log_var) # 去掉log, 得到方差; + std = std**0.5 # 开根号,得到标准差; + + z = mu + std * eps + return z + + def call(self, inputs): + mu, log_var = self.encoder(inputs) + # reparameterizaion trick:最核心的部分 + z = self.reparameterize(mu, log_var) + # decoder 进行还原 + x_hat = self.decoder(z) + + # Variational auto-encoder除了前向传播不同之外,还有一个额外的约束; + # 这个约束使得你的mu, var更接近正太分布;所以我们把mu, log_var返回; + return x_hat, mu, log_var + +model = VAE(z_dim,units=128) +model.build(input_shape=(128, 784)) +optimizer = keras.optimizers.Adam(lr=lr) + +epochs = 30 +for epoch in range(epochs): + + for step, x in enumerate(train_db): + + x = tf.reshape(x, [-1, 784]) + with tf.GradientTape() as tape: + # shape + x_hat, mu, log_var = model(x) + + # 把每个像素点当成一个二分类的问题; + rec_loss = tf.losses.binary_crossentropy(x, x_hat, from_logits=True) + rec_loss = tf.reduce_mean(rec_loss) + + # compute kl divergence (mu, var) ~ N(0, 1): 我们得到的均值方差和正太分布的; + # 链接参考: https://stats.stackexchange.com/questions/7440/kl-divergence-between-two-univariate-gaussians + kl_div = -0.5 * (log_var + 1 -mu**2 - tf.exp(log_var)) + kl_div = tf.reduce_mean(kl_div) / batchsz + loss = rec_loss + 1. * kl_div + + grads = tape.gradient(loss, model.trainable_variables) + optimizer.apply_gradients(zip(grads, model.trainable_variables)) + + if step % 100 ==0: + print('\repoch: %3d, step:%4d, kl_div: %5f, rec_loss:%9f' %(epoch, step, float(kl_div), float(rec_loss)),end="") + + num_pic = 9 + # evaluation 1: 从正太分布直接sample; + z = tf.random.normal((batchsz, z_dim)) # 从正太分布中sample这个尺寸的 + logits = model.decoder(z) # 通过这个得到decoder + x_hat = tf.sigmoid(logits) + x_hat = tf.reshape(x_hat, [-1, 28, 28]).numpy() * 255. + logits = x_hat.astype(np.uint8) # 标准的图片格式; + save_images(logits, 'd:\\vae_images\\sampled_epoch%d.png' %epoch,num_pic) # 直接sample出的正太分布; + + # evaluation 2: 正常的传播过程; + x = next(iter(test_db)) + x = tf.reshape(x, [-1, 784]) + x_hat_logits, _, _ = model(x) # 前向传播返回的还有mu, log_var + x_hat = tf.sigmoid(x_hat_logits) + x_hat = tf.reshape(x_hat, [-1, 28, 28]).numpy() * 255. + x_hat = x_hat.astype(np.uint8) # 标准的图片格式; + # print(x_hat.shape) + save_images(x_hat, 'd:\\vae_images\\rec_epoch%d.png' %epoch,num_pic) diff --git a/TensorFlow_eaxmple/Model_train_test/model/VAE/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/VAE/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/model/VMD/VMD_realize.py b/TensorFlow_eaxmple/Model_train_test/model/VMD/VMD_realize.py new file mode 100644 index 0000000..8072b7b --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/VMD/VMD_realize.py @@ -0,0 +1,66 @@ +from matplotlib import pyplot as plt +import numpy as np +from scipy.signal import hilbert + + +class VMD: + def __init__(self, K, alpha, tau, tol=1e-7, maxIters=200, eps=1e-9): + """ + :param K: 模态数 + :param alpha: 每个模态初始中心约束强度 + :param tau: 对偶项的梯度下降学习率 + :param tol: 终止阈值 + :param maxIters: 最大迭代次数 + :param eps: eps + """ + self.K = K + self.alpha = alpha + self.tau = tau + self.tol = tol + self.maxIters = maxIters + self.eps = eps + + def __call__(self, f): + T = f.shape[0] + t = np.linspace(1, T, T) / T + omega = t - 1. / T + # 转换为解析信号 + f = hilbert(f) + f_hat = np.fft.fft(f) + u_hat = np.zeros((self.K, T), dtype=np.complex) + omega_K = np.zeros((self.K,)) + lambda_hat = np.zeros((T,), dtype=np.complex) + # 用以判断 + u_hat_pre = np.zeros((self.K, T), dtype=np.complex) + u_D = self.tol + self.eps + + # 迭代 + n = 0 + while n < self.maxIters and u_D > self.tol: + for k in range(self.K): + # u_hat + sum_u_hat = np.sum(u_hat, axis=0) - u_hat[k, :] + res = f_hat - sum_u_hat + u_hat[k, :] = (res + lambda_hat / 2) / (1 + self.alpha * (omega - omega_K[k]) ** 2) + + # omega + u_hat_k_2 = np.abs(u_hat[k, :]) ** 2 + omega_K[k] = np.sum(omega * u_hat_k_2) / np.sum(u_hat_k_2) + + # lambda_hat + sum_u_hat = np.sum(u_hat, axis=0) + res = f_hat - sum_u_hat + lambda_hat -= self.tau * res + + n += 1 + u_D = np.sum(np.abs(u_hat - u_hat_pre) ** 2) + u_hat_pre[::] = u_hat[::] + + # 重构,反傅立叶之后取实部 + u = np.real(np.fft.ifft(u_hat, axis=-1)) + + omega_K = omega_K * T + idx = np.argsort(omega_K) + omega_K = omega_K[idx] + u = u[idx, :] + return u, omega_K \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/model/VMD/__init__.py b/TensorFlow_eaxmple/Model_train_test/model/VMD/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/TensorFlow_eaxmple/Model_train_test/model/VMD/test.py b/TensorFlow_eaxmple/Model_train_test/model/VMD/test.py new file mode 100644 index 0000000..fa69868 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/model/VMD/test.py @@ -0,0 +1,45 @@ +from matplotlib import pyplot as plt +import numpy as np +from scipy.signal import hilbert +from model.VMD.VMD_realize import VMD + +T = 1000 +fs = 1. / T +t = np.linspace(0, 1, 1000, endpoint=True) +f_1 = 10 +f_2 = 50 +f_3 = 100 +mode_1 = (2 * t) ** 2 +mode_2 = np.sin(2 * np.pi * f_1 * t) +mode_3 = np.sin(2 * np.pi * f_2 * t) +mode_4 = np.sin(2 * np.pi * f_3 * t) +f = mode_1 + mode_2 + mode_3 + mode_4 + 0.5 * np.random.randn(1000) + +plt.figure(figsize=(6, 3), dpi=150) +plt.plot(f, linewidth=1) + +K = 4 +alpha = 2000 +tau = 1e-6 +vmd = VMD(K, alpha, tau) +u, omega_K = vmd(f) +omega_K +# array([0.85049797, 10.08516203, 50.0835613, 100.13259275])) +plt.figure(figsize=(5, 7), dpi=200) +plt.subplot(4, 1, 1) +plt.plot(mode_1, linewidth=0.5, linestyle='--') +plt.plot(u[0, :], linewidth=0.2, c='r') + +plt.subplot(4, 1, 2) +plt.plot(mode_2, linewidth=0.5, linestyle='--') +plt.plot(u[1, :], linewidth=0.2, c='r') + +plt.subplot(4, 1, 3) +plt.plot(mode_3, linewidth=0.5, linestyle='--') +plt.plot(u[2, :], linewidth=0.2, c='r') + +plt.subplot(4, 1, 4) +plt.plot(mode_4, linewidth=0.5, linestyle='--') +plt.plot(u[3, :], linewidth=0.2, c='r') +plt.show() +# [] \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/temp/GetThreshold.py b/TensorFlow_eaxmple/Model_train_test/temp/GetThreshold.py new file mode 100644 index 0000000..b7f4fda --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/GetThreshold.py @@ -0,0 +1,86 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/12 16:14 +@Usage : +@Desc : +''' + +import numpy as np +import matplotlib.pyplot as plt +import pandas as pd + + +def getThreshold(data, cigma_num=1.5): + dims, = data.shape + + mean = np.mean(data) + std = np.sqrt(np.var(data)) + max = mean + cigma_num * std + min = mean - cigma_num * std + max = np.broadcast_to(max, shape=[dims, ]) + min = np.broadcast_to(min, shape=[dims, ]) + mean = np.broadcast_to(mean, shape=[dims, ]) + + # plt.plot(max) + # plt.plot(data) + # # plt.plot(mean) + # plt.plot(min) + # plt.show() + # + # + return max, min + # pass + + +def EWMA(data): + data1 = pd.DataFrame(data).ewm(span=5).mean() + + # plt.plot(data) + # plt.plot(data1, color='blue') + # getThreshold(data) + # plt.show() + + return data1 + + +if __name__ == '__main__': + data = np.load("E:\self_example\TensorFlow_eaxmple\Model_train_test/2012轴承数据集预测挑战\data\HI_DATA\Bearing1_1.npy") + a, b = data.shape + + minlist = np.array([]) + maxlist = np.array([]) + + for d in data: + max, min = getThreshold(d) + minlist = np.concatenate([minlist, min], axis=0) + maxlist = np.concatenate([maxlist, max], axis=0) + + data = data.reshape([a * b, 1]) + + origin_data = data + # data = np.array([0.5, 5, 0.8, 4.0, 10.0, -0.1, -0.3, 0, 0.5, 6.5]) + data = EWMA(data) + + data = np.squeeze(data.values) + + count = 0 + origin_count = 0 + + for a, b, c, d in zip(data, maxlist, minlist, origin_data): + if c > a or a > b: + count += 1 + if c > d or d > b: + origin_count += 1 + + print("原始劣质率:", origin_count / len(data) * 100, "%") + print("修复后劣质率:", count / len(data) * 100, "%") + plt.plot(origin_data, color='blue', label='Original data') + plt.plot(data, color='green', label='After data repair') + plt.plot(maxlist, color='red', label='upper Threshold') + plt.plot(minlist, color='red', label='lower Threshold') + + plt.show() + + # getThreshold(data) diff --git a/TensorFlow_eaxmple/Model_train_test/temp/Transformer.py b/TensorFlow_eaxmple/Model_train_test/temp/Transformer.py new file mode 100644 index 0000000..88a2861 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/Transformer.py @@ -0,0 +1,113 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/23 10:43 +@Usage : +@Desc : 计算transformer的参数和时间复杂度 6层self_attention +''' +import tensorflow as tf +from tensorflow.keras import Model, layers, initializers +import numpy as np +from model.SelfAttention.SelfAttention import Block + + +class Transformer(Model): + + # depth表示的是重复encoder block的次数,num_heads表示的是在multi-head self-attention中head的个数 + # MLP block中有一个Pre_logist,这里指的是,当在较大的数据集上学习的时候Pre_logist就表示一个全连接层加上一个tanh激活函数 + # 当在较小的数据集上学习的时候,Pre_logist是没有的,而这里的representation_size表示的就是Pre_logist中全连接层的节点个数 + # num_classes表示分类的类数 + def __init__(self, embed_dim=768, + depth=[], num_heads=12, qkv_bias=True, qk_scale=None, + drop_ratio=0., attn_drop_ratio=0., drop_path_ratio=0., + representation_size=None, num_classes=1000, name="ViT-B/16"): + super(Transformer, self).__init__(name=name) + + self.embed_dim = embed_dim + self.depth = depth + self.num_heads = num_heads + self.qkv_bias = qkv_bias + self.qk_scale = qk_scale + self.drop_ratio = drop_ratio + self.attn_drop_ratio = attn_drop_ratio + self.drop_path_ratio = drop_path_ratio + self.representation_size = representation_size + self.num_classes = num_classes + + dpr = np.linspace(0., drop_path_ratio, len(depth)) # stochastic depth decay rule + # 用一个for循环重复Block模块 + # 在用droppath时的drop_path_ratio是由0慢慢递增到我们所指定的drop_path_ratio的 + # 所以我们在构建Block时,这里的drop_path_ratio时变化的,所以用 np.linspace方法创建一个等差数列来初始化drop_path_ratio + + self.blocks = [] + self.denses = [] + for i,dim in zip(range(len(depth)),depth): + self.blocks.append( + Block(dim=dim, num_heads=num_heads, qkv_bias=qkv_bias, + qk_scale=qk_scale, drop_ratio=drop_ratio, attn_drop_ratio=attn_drop_ratio, + drop_path_ratio=dpr[i], name="encoderblock_{}".format(i)) + ) + self.denses.append(layers.Dense(dim)) + + # self.norm = layers.LayerNormalization(epsilon=1e-6, name="encoder_norm") + + # 接下来,如果传入了representation_size,就构建一个全连接层,激活函数为tanh + # 如果没有传入的话,就不做任何操作 + # if representation_size: + # self.has_logits = True + # self.pre_logits = layers.Dense(representation_size, activation="tanh", name="pre_logits") + # else: + # self.has_logits = False + # self.pre_logits = layers.Activation("linear") + + # 定义最后一个全连接层,节点个数就是我们的分类个数num_classes + # self.head = layers.Dense(num_classes, name="head", kernel_initializer=initializers.Zeros()) + + def get_config(self): + # 自定义层里面的属性 + config = ( + { + 'embed_dim': self.embed_dim, + 'depth': self.depth, + 'num_heads': self.num_heads, + 'qkv_bias': self.qkv_bias, + 'qk_scale': self.qk_scale, + 'drop_ratio': self.drop_ratio, + 'attn_drop_ratio': self.attn_drop_ratio, + 'drop_path_ratio': self.drop_path_ratio, + 'representation_size': self.representation_size, + 'num_classes': self.num_classes + } + ) + base_config = super(Transformer, self).get_config() + return dict(list(base_config.items()) + list(config.items())) + + def call(self, inputs, training=None): + # [B, H, W, C] -> [B, num_patches, embed_dim] + x = inputs # [B, 196, 768] + + for (block, dense) in zip(self.blocks, self.denses): + x = dense(x) + x = block(x, training=training) + + + # x = self.norm(x) + # # 这里是提取class_toke的输出,然后用切片的方式,而刚刚是将class_toke拼接在最前面的 + # # 所以这里用切片的方式,去取class_toke的输出,并将它传递给pre_logits + # x = self.pre_logits(x[:, 0]) + # # 最后传递给head + # x = self.head(x) + # 为什么只用class_toke对应的输出,而不用每一个patches对应的输出呢? + # 可以参考原文bird 网络 + + return x + + +if __name__ == '__main__': + # 使用方式 + + # input =tf.Variable(shape=[20, 10, 10]) + # Transformer(embed_dim=10, depth=8, num_heads=1, num_classes=10) + + print([i for i in range(5, 1, -1)]) diff --git a/TensorFlow_eaxmple/Model_train_test/temp/__init__.py b/TensorFlow_eaxmple/Model_train_test/temp/__init__.py new file mode 100644 index 0000000..29358a6 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/12 16:14 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/temp/data_repair(3).py b/TensorFlow_eaxmple/Model_train_test/temp/data_repair(3).py new file mode 100644 index 0000000..7c8309d --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/data_repair(3).py @@ -0,0 +1,155 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/12 17:51 +@Usage : +@Desc : +''' +import numpy as np +import os +import matplotlib.pyplot as plt +import pandas as pd +import random + +path = "./data" + +def data_read(path): + print("read data...") + dirPath = path + files = os.listdir(dirPath) + data = np.zeros(5) + + for file in files: + path = os.path.join(dirPath, file) + x = np.loadtxt(path, delimiter=",", usecols=4) + x = np.transpose(x) + x = np.expand_dims(x, 0) + if (data == 0).all(): + data = x + else: + data = np.concatenate((data, x)) + return data + + +def getThreshold(data, cigma_num=3): + dims, = data.shape + + mean = np.mean(data) + std = np.sqrt(np.var(data)) + max = mean + cigma_num * std + min = mean - cigma_num * std + max = np.broadcast_to(max, shape=[dims, ]) + min = np.broadcast_to(min, shape=[dims, ]) + mean = np.broadcast_to(mean, shape=[dims, ]) + + # plt.plot(max) + # plt.plot(data) + # # plt.plot(mean) + # plt.plot(min) + # plt.show() + # + # + return max, min + # pass + + +def EWMA(data): + print("data repair...") + data1 = pd.DataFrame(data).ewm(span=1000).mean() + + return data1 + + +def data_repair(origin_data, maxlist, minlist): + data = np.array(origin_data) + need_repair_max_index = [] + need_repair_min_index = [] + for index, b, c, d in zip(range(len(data)), maxlist, minlist, data): + if c > d: + need_repair_min_index.append(index) + if d > b: + need_repair_max_index.append(index) + + # 生成随机数 + # print("超过最大值的数量", len(need_repair_max_index)) + # print("低于最小值的数量", len(need_repair_min_index)) + + maxlen = len(need_repair_max_index) + minlen = len(need_repair_min_index) + + # max_repair = random.randint(int(maxlen * 0.7), maxlen) + # min_repair = random.randint(int(minlen * 0.7), minlen) + + need_repair_max_index = random.sample(need_repair_max_index, int(maxlen * 0.8)) + need_repair_min_index = random.sample(need_repair_min_index, int(minlen * 0.8)) + + for index in need_repair_max_index: + data[index] = maxlist[index] + + for index in need_repair_min_index: + data[index] = minlist[index] + + return data + + +def calculate(path): + basePath = "./data" + folders = os.listdir(basePath) + + for folder in folders: + filePath = os.path.join(basePath, folder) + print("文件夹: ", filePath) + + data = data_read(filePath) + a, b = data.shape + + minlist = np.array([]) + maxlist = np.array([]) + + for d in data: + max, min = getThreshold(d) + minlist = np.concatenate([minlist, min], axis=0) + maxlist = np.concatenate([maxlist, max], axis=0) + + data = data.reshape([a * b, 1]) + + origin_data = data + # data = np.array([0.5, 5, 0.8, 4.0, 10.0, -0.1, -0.3, 0, 0.5, 6.5]) + data = data_repair(data[:, 0], maxlist, minlist) + + + count = 0 + origin_count = 0 + + for a, b, c, d in zip(data, maxlist, minlist, origin_data): + if c > a or a > b: + count += 1 + if c > d or d > b: + origin_count += 1 + + print("原始劣质率:", origin_count / len(data) * 100, "%") + print("修复后劣质率:", count / len(data) * 100, "%") + + # origin_data = np.load("./origin_data.npy") + # data = np.load("./data.npy") + # maxlist = np.load("maxlist.npy") + # minlist = np.load("minlist.npy") + + le, _ = origin_data.shape + + x = [i for i in range(int(le))] + + plt.scatter(x, origin_data[:, 0], color='blue', s=0.1, label='Original data') + plt.scatter(x, data, color='green', s=0.1, label='After data repair') + plt.scatter(x, maxlist, color='red', s=0.05, label='Upper Threshold') + plt.scatter(x, minlist, color='red', s=0.05, label='Lower Threshold') + + plt.legend(loc='upper left', frameon=True) + + plt.show() + + + +if __name__ == '__main__': + calculate(path) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/temp/data_repair.py b/TensorFlow_eaxmple/Model_train_test/temp/data_repair.py new file mode 100644 index 0000000..bf46994 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/data_repair.py @@ -0,0 +1,152 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/12 17:51 +@Usage : +@Desc : +''' +import os + +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd + +import random + +path = "E:\data\PHM 2012轴承挑战数据集\phm-ieee-2012-data-challenge-dataset-master\Learning_set\Bearing1_1" + + +def data_read(path): + print("read data...") + dirPath = path + files = os.listdir(dirPath) + data = np.zeros(5) + + for file in files: + path = os.path.join(dirPath, file) + x = np.loadtxt(path, delimiter=",", usecols=4) + x = np.transpose(x) + x = np.expand_dims(x, 0) + if (data == 0).all(): + data = x + else: + data = np.concatenate((data, x)) + return data + + +def getThreshold(data, cigma_num=1.5): + dims, = data.shape + + mean = np.mean(data) + std = np.sqrt(np.var(data)) + max = mean + cigma_num * std + min = mean - cigma_num * std + max = np.broadcast_to(max, shape=[dims, ]) + min = np.broadcast_to(min, shape=[dims, ]) + mean = np.broadcast_to(mean, shape=[dims, ]) + + # plt.plot(max) + # plt.plot(data) + # # plt.plot(mean) + # plt.plot(min) + # plt.show() + # + # + return max, min + # pass + + +def EWMA(data): + print("data repair...") + data1 = pd.DataFrame(data).ewm(span=35).mean() + + return data1 + + +def data_repair(origin_data, maxlist, minlist): + data = np.array(origin_data) + need_repair_max_index = [] + need_repair_min_index = [] + for index, b, c, d in zip(range(len(data)), maxlist, minlist, data): + if c > d: + need_repair_min_index.append(index) + if d > b: + need_repair_max_index.append(index) + + # 生成随机数 + # print("超过最大值的数量", len(need_repair_max_index)) + # print("低于最小值的数量", len(need_repair_min_index)) + + maxlen = len(need_repair_max_index) + minlen = len(need_repair_min_index) + + # max_repair = random.randint(int(maxlen * 0.7), maxlen) + # min_repair = random.randint(int(minlen * 0.7), minlen) + + need_repair_max_index = random.sample(need_repair_max_index, int(maxlen * 0.8)) + need_repair_min_index = random.sample(need_repair_min_index, int(minlen * 0.8)) + + for index in need_repair_max_index: + data[index] = maxlist[index] + + for index in need_repair_min_index: + data[index] = minlist[index] + + return data + + +def calculate(path): + data = data_read(path) + a, b = data.shape + + minlist = np.array([]) + maxlist = np.array([]) + + for d in data: + max, min = getThreshold(d) + minlist = np.concatenate([minlist, min], axis=0) + maxlist = np.concatenate([maxlist, max], axis=0) + + data = data.reshape([a * b, 1]) + + origin_data = data + # data = np.array([0.5, 5, 0.8, 4.0, 10.0, -0.1, -0.3, 0, 0.5, 6.5]) + # data = EWMA(data) + data = data_repair(data[:, 0], maxlist, minlist) + + # data = np.squeeze(data.values) + + count = 0 + origin_count = 0 + + for a, b, c, d in zip(data, maxlist, minlist, origin_data): + if c > a or a > b: + count += 1 + if c > d or d > b: + origin_count += 1 + + print("原始劣质率:", origin_count / len(data) * 100, "%") + print("修复后劣质率:", count / len(data) * 100, "%") + + # origin_data = np.load("./origin_data.npy") + # data = np.load("./data.npy") + # maxlist = np.load("maxlist.npy") + # minlist = np.load("minlist.npy") + + le, _ = origin_data.shape + + x = [i for i in range(int(le))] + + plt.scatter(x, origin_data[:, 0], color='blue', s=0.1, label='Original data') + plt.scatter(x, data, color='green', s=0.1, label='After data repair') + plt.scatter(x, maxlist, color='red', s=0.05, label='Upper Threshold') + plt.scatter(x, minlist, color='red', s=0.05, label='Lower Threshold') + + plt.legend(loc='upper left', frameon=True) + + plt.show() + + +if __name__ == '__main__': + calculate(path) diff --git a/TensorFlow_eaxmple/Model_train_test/temp/loggerTest.py b/TensorFlow_eaxmple/Model_train_test/temp/loggerTest.py new file mode 100644 index 0000000..f03bbd6 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/loggerTest.py @@ -0,0 +1,23 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/16 15:34 +@Usage : +@Desc : +''' +import logging +import time + + +logging.basicConfig(format='%(asctime)s - %(filename)s[line:%(lineno)d] - %(levelname)s: %(message)s', + level=logging.INFO, + filename='E:\self_example\TensorFlow_eaxmple\Model_train_test/temp/test.log', + filemode='a') + + +i = 0 +while True: + logging.info(i) + time.sleep(2) + diff --git a/TensorFlow_eaxmple/Model_train_test/temp/readCsv.py b/TensorFlow_eaxmple/Model_train_test/temp/readCsv.py new file mode 100644 index 0000000..8637485 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/readCsv.py @@ -0,0 +1,21 @@ + +import numpy as np +import os + +dirPath = "G:\深度学习/2022-2023\小论文相关\code\PHM 2012轴承挑战数据集\phm-ieee-2012-data-challenge-dataset-master\Learning_set\Bearing1_1" +files = os.listdir(dirPath) +data = np.zeros(5) + +for file in files: + path = os.path.join(dirPath, file) + x = np.loadtxt(path, delimiter=",", usecols=4) + x = np.transpose(x) + x = np.expand_dims(x, 0) + if (data == 0).all(): + data = x + else: + data = np.concatenate((data, x)) + # print(data.shape) (2803,2560) +print(data.shape) + +# np.save("./data/Bearing1_1.npy", data, allow_pickle=True) diff --git a/TensorFlow_eaxmple/Model_train_test/temp/test.bat b/TensorFlow_eaxmple/Model_train_test/temp/test.bat new file mode 100644 index 0000000..fbd71c7 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/test.bat @@ -0,0 +1,5 @@ +@echo off +if "%1" == "h" goto begin +mshta vbscript:createobject("wscript.shell").run("%~nx0 h",0)(window.close)&&exit +:begin +D:\ProgramData\Anaconda3\envs\tensorflow\python.exe loggerTest.py diff --git a/TensorFlow_eaxmple/Model_train_test/temp/transformer_complete.py b/TensorFlow_eaxmple/Model_train_test/temp/transformer_complete.py new file mode 100644 index 0000000..60ffdd1 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/temp/transformer_complete.py @@ -0,0 +1,303 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/10/23 14:23 +@Usage : +@Desc : +''' + +import tensorflow as tf +import tensorflow.keras +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from condition_monitoring.data_deal import loadData_daban as loadData +# from model.Joint_Monitoring.Joint_Monitoring_banda import Joint_Monitoring + +# from model.CommonFunction.CommonFunction import * +from sklearn.model_selection import train_test_split +from tensorflow.keras.models import load_model, save_model +from temp.Transformer import Transformer +from model.SelfAttention.SelfAttention import Block +from keras.callbacks import EarlyStopping +import time + +'''超参数设置''' +time_stamp = 120 +feature_num = 10 +batch_size = 32 +learning_rate = 0.001 +EPOCH = 101 +model_name = "transformer" +'''EWMA超参数''' +K = 18 +namuda = 0.01 +'''保存名称''' + +save_name = "../model/weight/{0}_timestamp{1}_feature{2}_weight/weight".format(model_name, + time_stamp, + feature_num, + ) +save_step_two_name = "../model/joint_two/{0}_timestamp{1}_feature{2}.h5".format(model_name, + time_stamp, + feature_num, + batch_size, + EPOCH) + +save_mse_name = r"./compare/mse/JM_banda/{0}_result.csv".format(model_name) +'''文件名''' +file_name = "G:\data\SCADA数据\SCADA_已处理_粤水电达坂城2020.1月-5月\风机15.csv" + +''' +文件说明:jb4q_8_delete_total_zero.csv是删除了只删除了全是0的列的文件 +文件从0:96748行均是正常值(2019/12.30 00:00:00 - 2020/3/11 05:58:00) +从96748:107116行均是异常值(2020/3/11 05:58:01 - 2021/3/18 11:04:00) +''' +'''文件参数''' +# 最后正常的时间点 +healthy_date = 96748 +# 最后异常的时间点 +unhealthy_date = 107116 +# 异常容忍程度 +unhealthy_patience = 5 + + +def remove(data, time_stamp=time_stamp): + rows, cols = data.shape + print("remove_data.shape:", data.shape) + num = int(rows / time_stamp) + + return data[:num * time_stamp, :] + pass + + +# 不重叠采样 +def get_training_data(data, time_stamp: int = time_stamp): + removed_data = remove(data=data) + rows, cols = removed_data.shape + print("removed_data.shape:", data.shape) + print("removed_data:", removed_data) + train_data = np.reshape(removed_data, [-1, time_stamp, cols]) + print("train_data:", train_data) + batchs, time_stamp, cols = train_data.shape + + for i in range(1, batchs): + each_label = np.expand_dims(train_data[i, 0, :], axis=0) + if i == 1: + train_label = each_label + else: + train_label = np.concatenate([train_label, each_label], axis=0) + + print("train_data.shape:", train_data.shape) + print("train_label.shape", train_label.shape) + return train_data[:-1, :], train_label + + +# 重叠采样 +def get_training_data_overlapping(data, time_stamp: int = time_stamp, is_Healthy: bool = True): + rows, cols = data.shape + train_data = np.empty(shape=[rows - time_stamp - 1, time_stamp, cols]) + train_label = np.empty(shape=[rows - time_stamp - 1, cols]) + for i in range(rows): + if i + time_stamp >= rows: + break + if i + time_stamp < rows - 1: + train_data[i] = data[i:i + time_stamp] + train_label[i] = data[i + time_stamp] + + print("重叠采样以后:") + print("data:", train_data) # (300334,120,10) + print("label:", train_label) # (300334,10) + + if is_Healthy: + train_label2 = np.ones(shape=[train_label.shape[0]]) + else: + train_label2 = np.zeros(shape=[train_label.shape[0]]) + + print("label2:", train_label2) + + return train_data, train_label, train_label2 + + +# 归一化 +def normalization(data): + rows, cols = data.shape + print("归一化之前:", data) + print(data.shape) + print("======================") + + # 归一化 + max = np.max(data, axis=0) + max = np.broadcast_to(max, [rows, cols]) + min = np.min(data, axis=0) + min = np.broadcast_to(min, [rows, cols]) + + data = (data - min) / (max - min) + print("归一化之后:", data) + print(data.shape) + + return data + + +# 正则化 +def Regularization(data): + rows, cols = data.shape + print("正则化之前:", data) + print(data.shape) + print("======================") + + # 正则化 + mean = np.mean(data, axis=0) + mean = np.broadcast_to(mean, shape=[rows, cols]) + dst = np.sqrt(np.var(data, axis=0)) + dst = np.broadcast_to(dst, shape=[rows, cols]) + data = (data - mean) / dst + print("正则化之后:", data) + print(data.shape) + + return data + pass + + +def EWMA(data, K=K, namuda=namuda): + # t是啥暂时未知 + t = 0 + mid = np.mean(data, axis=0) + standard = np.sqrt(np.var(data, axis=0)) + UCL = mid + K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + LCL = mid - K * standard * np.sqrt(namuda / (2 - namuda) * (1 - (1 - namuda) ** 2 * t)) + return mid, UCL, LCL + pass + + +def get_MSE(data, label, new_model): + predicted_data = new_model.predict(data) + + temp = np.abs(predicted_data - label) + temp1 = (temp - np.broadcast_to(np.mean(temp, axis=0), shape=predicted_data.shape)) + temp2 = np.broadcast_to(np.sqrt(np.var(temp, axis=0)), shape=predicted_data.shape) + temp3 = temp1 / temp2 + mse = np.sum((temp1 / temp2) ** 2, axis=1) + print("z:", mse) + print(mse.shape) + + # mse=np.mean((predicted_data-label)**2,axis=1) + print("mse", mse) + + dims, = mse.shape + + mean = np.mean(mse) + std = np.sqrt(np.var(mse)) + max = mean + 3 * std + # min = mean-3*std + max = np.broadcast_to(max, shape=[dims, ]) + # min = np.broadcast_to(min,shape=[dims,]) + mean = np.broadcast_to(mean, shape=[dims, ]) + + # plt.plot(max) + # plt.plot(mse) + # plt.plot(mean) + # # plt.plot(min) + # plt.show() + # + # + return mse, mean, max + # pass + + +def condition_monitoring_model(): + input = tf.keras.Input(shape=[time_stamp, feature_num]) + conv1 = tf.keras.layers.Conv1D(filters=256, kernel_size=1)(input) + GRU1 = tf.keras.layers.GRU(128, return_sequences=False)(conv1) + d1 = tf.keras.layers.Dense(300)(GRU1) + output = tf.keras.layers.Dense(10)(d1) + + model = tf.keras.Model(inputs=input, outputs=output) + + return model + + +def test(step_one_model, step_two_model, test_data, test_label1, test_label2): + history_loss = [] + history_val_loss = [] + + val_loss, val_accuracy = step_two_model.get_val_loss(val_data=test_data, val_label1=test_label1, + val_label2=test_label2, + is_first_time=False, step_one_model=step_one_model) + + history_val_loss.append(val_loss) + print("val_accuracy:", val_accuracy) + print("val_loss:", val_loss) + + +if __name__ == '__main__': + total_data = loadData.execute(N=feature_num, file_name=file_name) + total_data = normalization(data=total_data) + + train_data_healthy, train_label1_healthy, train_label2_healthy = get_training_data_overlapping( + total_data[:healthy_date, :], is_Healthy=True) + train_data_unhealthy, train_label1_unhealthy, train_label2_unhealthy = get_training_data_overlapping( + total_data[healthy_date - time_stamp + unhealthy_patience:unhealthy_date, :], + is_Healthy=False) + #### TODO 第一步训练 + + ####### TODO 训练 + # model = Transformer(embed_dim=10, depth=[100,200,300,100,1], num_heads=1, num_classes=1,representation_size=128) + # checkpoint = tf.keras.callbacks.ModelCheckpoint( + # filepath=save_name, + # monitor='val_loss', + # verbose=2, + # save_best_only=True, + # save_weights_only=True, + # mode='min') + # lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=3, min_lr=0.001) + # + # + # model.build(input_shape=(batch_size, time_stamp, feature_num)) + # model.summary() + # model.compile(optimizer=tf.optimizers.Adam(learning_rate=learning_rate), loss=tf.losses.mse) + # early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=3, mode='min', verbose=1) + # + # history = model.fit(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], + # train_data_healthy[:train_data_healthy.shape[0] // 7, :, 0], epochs=50, + # batch_size=batch_size * 10, validation_split=0.2, shuffle=True, verbose=1, + # callbacks=[checkpoint,lr_scheduler,early_stop] + # ) + # # + # model.save_weights(save_name) + + model = Transformer(embed_dim=10, depth=[100,200,300,100,1], num_heads=1, num_classes=1, representation_size=128) + model.load_weights("../model/weight/transformer_timestamp120_feature10_epoch16_weight_0.000087/weight") + # model.build(input_shape=(batch_size, time_stamp, feature_num)) + # model.summary() + + # + # + # #### TODO 测试 + + + + trained_data = model.predict(train_data_healthy[:train_data_healthy.shape[0] // 7, :, :], batch_size=32) + + print(trained_data) + print(trained_data.shape) + plt.plot(trained_data[:,-1,:]) + plt.show() + + # + start = time.time() + # 中间写上代码块 + + model.predict(train_data_healthy, batch_size=32) + end = time.time() + print("data_size:", train_data_healthy.shape) + print('Running time: %s Seconds' % (end - start)) + + # trained_model = tf.keras.models.load_model(save_name, custom_objects={'Block': Block}) + # + # + # + # # 使用已知的点进行预测 + # + # pass diff --git a/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/__init__.py b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/__init__.py new file mode 100644 index 0000000..77360ab --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/21 16:42 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step1_Original_data.py b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step1_Original_data.py new file mode 100644 index 0000000..6b3b285 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step1_Original_data.py @@ -0,0 +1,43 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/21 16:44 +@Usage : +@Desc : +''' + +import pandas as pd +import numpy as np +import os + + +root_path ='G:\data\cmd_predict_data\shaft2/46\shaft2' +L = [] +for root, dir, filename in os.walk(root_path): + for file in filename: + if os.path.splitext(file)[1] == '.csv': + L.append(os.path.join(root_path,file)) + a = os.path.join(root_path, file) + b = a.split(".")[1].split("_") + +z = 0 +L.sort(key=lambda x:x.split(".")[1].split("_")[1]) +for filename in L: + print("读取了{0}个文件".format(z+1)) + data_single = np.loadtxt(filename, delimiter=',',dtype=np.str) + # data_single = data_single.iloc[0, :].values + if z == 0: + # data_all=data_single + HI_data = data_single + else: + # data_all=np.hstack([data_all,data_single]) + HI_data = np.vstack([HI_data, data_single]) + z += 1 + + +print(z) +# print(data_all.shape) +print(HI_data.shape) +np.save("data1.npy",HI_data) +# io.savemat("./HI_data.mat", {'HI_data': HI_data}) \ No newline at end of file diff --git a/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step2_test.py b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step2_test.py new file mode 100644 index 0000000..80fe7ff --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step2_test.py @@ -0,0 +1,24 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/22 20:47 +@Usage : +@Desc : +''' + +import numpy as np +import matplotlib.pyplot as plt + +data = np.load("../data/data.npy") + +print(data) +print(data.shape) +# data = np.transpose(data, axes=[1, 0]) +data = np.reshape(data[317:517,:], [-1, 1]) + +plt.plot(data) +plt.show() +# data = np.reshape(data,[-1,8192]) +# np.save("HI_data.npy",data) +# print(data.shape) diff --git a/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step3_HI_create.py b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step3_HI_create.py new file mode 100644 index 0000000..254e7d5 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step3_HI_create.py @@ -0,0 +1,155 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +# 数据导入 +data = np.load("../data/HI_data.npy") +print(data.shape) # (2803, 2560) +(samples, dims) = data.shape + +# # 24个指标建立 +fs = 25.6 * 1000 +T1 = np.mean(data, axis=1) +print(T1.shape) +# +T2 = np.sqrt(np.var(data, axis=1)) + +T3 = np.mean(np.sqrt(np.abs(data)), axis=1) ** 2 + +T4 = np.sqrt(np.mean(data ** 2, axis=1)) + +T5 = np.max(np.abs(data), axis=1) + +T6 = np.mean((data - np.broadcast_to(np.expand_dims(T1, axis=1), (samples, dims))) ** 3, axis=1) / (T4 ** 3) + +T7 = np.mean((data - np.broadcast_to(np.expand_dims(T1, axis=1), (samples, dims))) ** 4, axis=1) / (T4 ** 4) + +T8 = T5 / T4 + +T9 = T5 / T3 + +T10 = T4 / np.mean(np.abs(data), axis=1) + +T11 = T5 / np.mean(np.abs(data), axis=1) + +# 频域 +sk = np.abs(np.fft.rfft(data, axis=1) * 2 / dims) +sk = sk[:, 0:-1] # (2803,1280) +(samples, k) = sk.shape # (2803,1280) +print("data:", data) +print("sk:", sk) +fk = np.empty(shape=[samples, k]) + +for sample in range(samples): + for i in range(k): + fk[sample][i] = (fs / dims) * (i + 1) +# print(fk) +# print(fk.shape) +# plt.plot(sk[1,:]) +# plt.xlim((0,k)) +# plt.ylim((0,1.5)) +# plt.show() +# print(sk.shape) + +F1 = np.mean(sk, axis=1) + +F2 = np.var(sk, axis=1) * k / (k - 1) + +F3 = np.mean((sk - np.broadcast_to(np.expand_dims(F1, axis=1), (samples, k))) ** 3, axis=1) / (np.sqrt(F2) ** 3) + +F4 = np.mean((sk - np.broadcast_to(np.expand_dims(F1, axis=1), (samples, k))) ** 4, axis=1) / (F2 ** 2) + +F5 = np.sum(np.multiply(fk, sk), axis=1) / np.sum(sk, axis=1) + +F6 = np.sqrt(np.mean(np.multiply((fk - np.broadcast_to(np.expand_dims(F5, axis=1), (samples, k))) ** 2, sk), axis=1)) + +F7 = np.sqrt(np.sum(np.multiply(fk ** 2, sk), axis=1) / np.sum(sk, axis=1)) + +F8 = np.sqrt(np.sum(np.multiply(fk ** 4, sk), axis=1) / np.sum(fk ** 2 * sk, axis=1)) + +F9 = np.sum(np.multiply(fk ** 2, sk), axis=1) / np.sqrt(np.sum(sk, axis=1) * np.sum(np.multiply(fk ** 4, sk), axis=1)) + +F10 = F6 / F5 + +F11 = np.mean(np.multiply((fk - np.broadcast_to(np.expand_dims(F5, axis=1), (samples, k))) ** 3, sk), axis=1) / ( + F6 ** 3) + +F12 = np.mean(np.multiply((fk - np.broadcast_to(np.expand_dims(F5, axis=1), (samples, k))) ** 4, sk), axis=1) / ( + F6 ** 4) + +F13 = np.mean(np.sqrt(np.abs(fk - np.broadcast_to(np.expand_dims(F5, axis=1), (samples, k)))) * sk, axis=1) / np.sqrt( + F6) + +# 归一化处理 +T1 = (T1 - np.min(T1)) / (np.max(T1) - np.min(T1)) +T2 = (T2 - np.min(T2)) / (np.max(T2) - np.min(T2)) +T3 = (T3 - np.min(T3)) / (np.max(T3) - np.min(T3)) +T4 = (T4 - np.min(T4)) / (np.max(T4) - np.min(T4)) +T5 = (T5 - np.min(T5)) / (np.max(T5) - np.min(T5)) +T6 = (T6 - np.min(T6)) / (np.max(T6) - np.min(T6)) +T7 = (T7 - np.min(T7)) / (np.max(T7) - np.min(T7)) +T8 = (T8 - np.min(T8)) / (np.max(T8) - np.min(T8)) +T9 = (T9 - np.min(T9)) / (np.max(T9) - np.min(T9)) +T10 = (T10 - np.min(T10)) / (np.max(T10) - np.min(T10)) +T11 = (T11 - np.min(T11)) / (np.max(T11) - np.min(T11)) +F1 = (F1 - np.min(F1)) / (np.max(F1) - np.min(F1)) +F2 = (F2 - np.min(F2)) / (np.max(F2) - np.min(F2)) +F3 = (F3 - np.min(F3)) / (np.max(F3) - np.min(F3)) +F4 = (F4 - np.min(F4)) / (np.max(F4) - np.min(F4)) +F5 = (F5 - np.min(F5)) / (np.max(F5) - np.min(F5)) +F6 = (F6 - np.min(F6)) / (np.max(F6) - np.min(F6)) +F7 = (F7 - np.min(F7)) / (np.max(F7) - np.min(F7)) +F8 = (F8 - np.min(F8)) / (np.max(F8) - np.min(F8)) +F9 = (F9 - np.min(F9)) / (np.max(F9) - np.min(F9)) +F10 = (F10 - np.min(F10)) / (np.max(F10) - np.min(F10)) +F11 = (F11 - np.min(F11)) / (np.max(F11) - np.min(F11)) +F12 = (F12 - np.min(F12)) / (np.max(F12) - np.min(F12)) +F13 = (F13 - np.min(F13)) / (np.max(F13) - np.min(F13)) +print(F5) +# plt.plot(F5) +# plt.show() + + +def plot(data): + l, c = data.shape + + for i in range(c): + plt.figure(i + 1) + plt.plot(data[:, i]) + plt.show() + + +if __name__ == '__main__': + T1 = np.expand_dims(T1, axis=1) + T2 = np.expand_dims(T2, axis=1) + T3 = np.expand_dims(T3, axis=1) + T4 = np.expand_dims(T4, axis=1) + T5 = np.expand_dims(T5, axis=1) + T6 = np.expand_dims(T6, axis=1) + T7 = np.expand_dims(T7, axis=1) + T8 = np.expand_dims(T8, axis=1) + T9 = np.expand_dims(T9, axis=1) + T10 = np.expand_dims(T10, axis=1) + T11 = np.expand_dims(T11, axis=1) + F1 = np.expand_dims(F1, axis=1) + F2 = np.expand_dims(F2, axis=1) + F3 = np.expand_dims(F3, axis=1) + F4 = np.expand_dims(F4, axis=1) + F5 = np.expand_dims(F5, axis=1) + F6 = np.expand_dims(F6, axis=1) + F7 = np.expand_dims(F7, axis=1) + F8 = np.expand_dims(F8, axis=1) + F9 = np.expand_dims(F9, axis=1) + F10 = np.expand_dims(F10, axis=1) + F11 = np.expand_dims(F11, axis=1) + F12 = np.expand_dims(F12, axis=1) + F13 = np.expand_dims(F13, axis=1) + feature_data = tf.concat( + [T1, T2, T3, T4, T5, T6, T7, T8, T9, T10, T11, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13], axis=1) + # plot(feature_data) + np.save('../data/feature_data.npy', feature_data) + print(feature_data.shape) + +# print(HI_data.shape) +# np.save("../data/HI_DATA/HIed_data.npy",HI_data) diff --git a/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step4_HI_select.py b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step4_HI_select.py new file mode 100644 index 0000000..e6d1a60 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step4_HI_select.py @@ -0,0 +1,98 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt + +# 数据导入 +feature_data = np.load("../data/feature_data.npy") +print(feature_data.shape) # (2803,24) +feature_data = np.transpose(feature_data, [1, 0]) +print(feature_data.shape) # (24,2803) + + +# data.shape:(24,2803) +class HI_select(): + + def __init__(self, data): + self.data = data + + def getScore(self): + score = (self.getTred() + self.getMon() + self.getScale()) / 2 + print(score.shape) + return score + + def getTred(self): + h = self.data + (features, dims) = h.shape + h_mean = np.mean(h, axis=1) + tk = np.broadcast_to(np.expand_dims(np.arange(dims), axis=0), (features, dims)) # (24,2803) + tk_mean = np.mean(tk, axis=1) + tred = np.abs(np.sum(np.multiply((h - np.broadcast_to(np.expand_dims(h_mean, axis=1), (features, dims))), + (tk - np.broadcast_to(np.expand_dims(tk_mean, axis=1), (features, dims)))), + axis=1)) / np.sqrt( + np.sum((h - np.broadcast_to(np.expand_dims(h_mean, axis=1), (features, dims))) ** 2, axis=1) * np.sum( + (tk - np.broadcast_to(np.expand_dims(tk_mean, axis=1), (features, dims))) ** 2, axis=1)) + # print(tred) + + tred = np.expand_dims(tred, axis=1) + # print("tred.shape:", tred.shape) + return tred + + # 单调性 + def getMon(self): + h = self.data + (features, dims) = h.shape + mon = np.empty(shape=[24, 1]) + for feature in range(features): + positive = 0 + negative = 0 + for dim in range(dims): + if dim + 1 >= dims: + break + if h[feature][dim + 1] - h[feature][dim] > 0: + positive += 1 + if h[feature][dim + 1] - h[feature][dim] < 0: + negative += 1 + # print("positive:",positive) + # print("negetive:",negative) + mon[feature] = np.abs((positive - negative) / (dims - 1)) + # print(mon[feature]) + # print(mon) + # print("mon.shape",mon.shape) + return mon + + # 尺度相似性 + def getScale(self): + scale = np.zeros(shape=[24, 1]) + return scale + + +if __name__ == '__main__': + scores = HI_select(feature_data).getScore() + (feature, score) = scores.shape + scores = np.ravel(scores) + print(scores.shape) + + # 归一化处理 + # scores = (scores - np.min(scores)) / (np.max(scores) - np.min(scores)) + # score图 + plt.bar(range(feature),scores,color=['r','g','b','c','m','y']) + plt.show() + + # 获取前9个最大值的索引 + # print(scores) + # indexs = np.argpartition(scores, -12)[-12:] # [ 1 23 16 9 19 20 2 22 18] 自选【1,2,3,11,20,23】 备选【9,16,18】 + # print(indexs) + # # 选出所需的data + # Selected_data = [] + # feature_data = np.transpose(feature_data, [1, 0]) # (2803,24) + # z = 0 + # for index in indexs: + # if z == 0: + # Selected_data = feature_data[:, index] + # else: + # Selected_data = np.vstack([Selected_data, feature_data[:, index]]) + # z += 1 + # Selected_data=np.transpose(Selected_data,[1,0]) #(2803,9) + # # np.save("Select_data.npy",Selected_data) + # print(Selected_data.shape) diff --git a/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step6_final.py b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step6_final.py new file mode 100644 index 0000000..e6789c1 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step6_final.py @@ -0,0 +1,22 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/23 13:43 +@Usage : +@Desc : +''' + +import numpy as np + +import matplotlib.pyplot as plt + +data = np.load("HI_merge_data1.npy") + +print(data) + +data= data[:,1] + +plt.plot(data) +plt.show() + diff --git a/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step_5_HI_merge.py b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step_5_HI_merge.py new file mode 100644 index 0000000..2d4f7b8 --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/HI_create/step_5_HI_merge.py @@ -0,0 +1,82 @@ +import tensorflow as tf +import numpy as np +import pandas as pd +import matplotlib.pyplot as plt +from keras.callbacks import EarlyStopping + +# 数据读取 +# train_data = np.load("Select_data.npy") +# print(train_data.shape) +feature_data = np.load("../data/feature_data.npy") +print(feature_data.shape) # (2803,24) +indexs=[4,11,16,20,23] +z = 0 +for index in indexs: + if z == 0: + Selected_data = feature_data[:, index] + else: + Selected_data = np.vstack([Selected_data, feature_data[:, index]]) + z += 1 +Selected_data = np.transpose(Selected_data, [1, 0]) # (2803,9) + +plt.plot(Selected_data) +plt.show() + +train_data=Selected_data[1500:-1,:] +print(train_data.shape) +plt.plot(train_data) +plt.show() + + +# 建立模型 +class model(): + + def __init__(self, input_shape=9): + self.input_shape = input_shape + pass + + def getModel(self, model_Type='ae'): + if model_Type == 'ae': + model = self.AE_model() + return model + else: + raise ValueError("模型尚未实现") + + def AE_model(self): + input = tf.keras.Input(shape=self.input_shape) + d1 = tf.keras.layers.Dense(4)(input) + # d2 = tf.keras.layers.Dense(2, activation='relu')(d1) + d3 = tf.keras.layers.Dense(2, name='mid', activation='relu')(d1) + # d4 = tf.keras.layers.Dense(2, activation='relu')(d3) + d5 = tf.keras.layers.Dense(4)(d3) + d6 = tf.keras.layers.Dense(self.input_shape)(d5) + model = tf.keras.Model(inputs=input, outputs=d6) + return model + + +# HI指标训练和合成 +if __name__ == '__main__': + model = model(input_shape=5).getModel(model_Type='ae') + model.compile(optimizer=tf.optimizers.Adam(0.001), loss=tf.losses.mse, metrics=['acc']) + # model.summary() + + checkpoint = tf.keras.callbacks.ModelCheckpoint( + filepath="AE_model.h5", + monitor='val_loss', + verbose=2, + save_best_only=True, + mode='min') + lr_scheduler = tf.keras.callbacks.ReduceLROnPlateau(monitor='val_loss', factor=0.2, patience=10, min_lr=0.0001) + + model.compile(optimizer=tf.optimizers.SGD(), loss=tf.losses.mse) + # model.compile(optimizer=tf.optimizers.SGD(learning_rate=0.001), loss=FTMSE()) + model.summary() + early_stop = EarlyStopping(monitor='val_loss', min_delta=0.0001, patience=20, mode='min', verbose=1) + + history = model.fit(train_data, train_data, epochs=1000, batch_size=100) + HI_merge_data = tf.keras.models.Model(inputs=model.input, outputs=model.get_layer('mid').output).predict(train_data) + print(HI_merge_data) + acc = np.array(history.history.get('acc')) + # if acc[299] > 0.9: + np.save("HI_merge_data1.npy", HI_merge_data) + model.save("AE_model.h5") diff --git a/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/__init__.py b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/__init__.py new file mode 100644 index 0000000..6dee54d --- /dev/null +++ b/TensorFlow_eaxmple/Model_train_test/wind_turbine_predict/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/21 16:41 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/interview/Cainiao/src/main/java/com/markilue/interview/Question2.java b/interview/Cainiao/src/main/java/com/markilue/interview/Question2.java new file mode 100644 index 0000000..7e1a3fc --- /dev/null +++ b/interview/Cainiao/src/main/java/com/markilue/interview/Question2.java @@ -0,0 +1,70 @@ +package com.markilue.interview; + +import org.junit.Test; + +import java.util.Scanner; + +/** + *@BelongsProject: Cainiao + *@BelongsPackage: com.markilue.interview + *@Author: markilue + *@CreateTime: 2023-10-10 19:39 + *@Description: TODO + *@Version: 1.0 + */ +public class Question2 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int n = sc.nextInt(); + int[] nums = new int[n]; + for (int i = 0; i < n; i++) { + nums[i] = sc.nextInt(); + } + } + + @Test + public void test() { + int[] nums = {2, 1, 3}; + sovle(nums); + } + + @Test + public void test1() { + int[] nums = {2, 1, 3,5,4}; + sovle(nums); + } + + public static void sovle(int[] nums) { + + int result = 0; + int count = 0;//计算当前连续一样的情况 + boolean flag = false; + for (int i = 0; i < nums.length; i++) { + if (nums[i] == i + 1) { + flag = true; + count++; + } else { + if (flag) { + if (count % 2 == 0) { + result += count / 2; + } else { + result += count / 2 + 1; + } + } + count = 0; + flag = false; + } + } + + if (count % 2 == 0) { + result += count / 2; + } else { + result += count / 2 + 1; + } + + + System.out.println(result); + + } +} diff --git a/interview/Cainiao/src/main/java/com/markilue/interview/Question3.java b/interview/Cainiao/src/main/java/com/markilue/interview/Question3.java new file mode 100644 index 0000000..b4d5da6 --- /dev/null +++ b/interview/Cainiao/src/main/java/com/markilue/interview/Question3.java @@ -0,0 +1,97 @@ +package com.markilue.interview; + +import java.util.ArrayList; +import java.util.List; +import java.util.Scanner; + +/** + *@BelongsProject: Cainiao + *@BelongsPackage: com.markilue.interview + *@Author: markilue + *@CreateTime: 2023-10-10 20:03 + *@Description: TODO + *@Version: 1.0 + */ +public class Question3 { + + public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + + int n = sc.nextInt(); + Node[] nodes = new Node[n]; + String next = sc.next(); + for (int i = 0; i < next.length(); i++) { + Node node = new Node(); + node.index = i + 1; + if ('R'==next.charAt(i)) { + node.color = true; + } else { + node.color = false; + } + nodes[i] = node; + } + for (int i = 0; i < n - 1; i++) { + int index1 = sc.nextInt(); + int index2 = sc.nextInt(); + nodes[index1 - 1].children.add(nodes[index2 - 1]); + nodes[index2 - 1].children.add(nodes[index1 - 1]); + } + + int result = 0; + + for (Node node : nodes) { + cur = 0; + blue = 0; + red = 0; + sovle(node); + result += cur; + } + + + System.out.println(result); + + } + + static int cur = 0; + static int red = 0; + static int blue = 0; + + + public static void sovle(Node node) { + if (node == null) { + return; + } + node.busy = true; + if (node.color) { + red++; + } else { + blue++; + } + if (red == blue) { + cur++; + } + for (Node child : node.children) { + if (!child.busy) sovle(child); + } + node.busy = false; + } +} + +class Node { + + int index; + boolean color;//true为R + boolean busy = false; + List children = new ArrayList<>(); + + public Node() { + } + + public Node(boolean color, int index) { + this.color = color; + this.index = index; + } + + +} diff --git a/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question1.java b/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question1.java new file mode 100644 index 0000000..2cdde66 --- /dev/null +++ b/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question1.java @@ -0,0 +1,92 @@ +package com.markilue.interview; + +import org.junit.Test; + +import java.util.Scanner; + +/** + *@BelongsProject: HuaWei + *@BelongsPackage: com.markilue.interview + *@Author: markilue + *@CreateTime: 2023-10-11 20:12 + *@Description: TODO + *@Version: 1.0 + */ +public class Question1 { + + public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + int M = sc.nextInt(); + int N = sc.nextInt(); + int n = sc.nextInt(); + int[] nums = new int[n]; + + for (int i = 0; i < n; i++) { + nums[i] = sc.nextInt(); + } + + sovle(nums, M, N); + + + } + + @Test + public void test() { + int M = 4; + int N = 6; + int[] nums ={2,1,2,2,3,2}; + sovle(nums,M,N); + } + + @Test + public void test1() { + int M = 2; + int N = 10; + int[] nums ={1,9,1,9,8,2}; + sovle(nums,M,N); + } + + + public static void sovle(int[] nums, int M, int N) { + int result = 0; + int sum = 0; + int left = 0; + int temp = 0; + + for (int i = 0; i < nums.length; i++) { + sum += nums[i]; + + if (i - left >= M - 1) { + if (sum > N) { + temp = sum - N; + result += temp; + } + + int index = i; + int flag = temp; + while (temp > 0) { + if (temp > nums[index]) { + temp -= nums[index]; + nums[index] = 0; + index--; + } else { + nums[index] -= temp; + temp = 0; + } + } + + if (flag > 0) { + sum = N - nums[left]; + } else { + sum -= nums[left]; + } + left++; + + } + } + + System.out.println(result); + + } +} diff --git a/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question2.java b/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question2.java new file mode 100644 index 0000000..199f4ea --- /dev/null +++ b/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question2.java @@ -0,0 +1,67 @@ +package com.markilue.interview; + +import org.junit.Test; + +import java.util.Arrays; +import java.util.Scanner; + +/** + *@BelongsProject: HuaWei + *@BelongsPackage: com.markilue.interview + *@Author: markilue + *@CreateTime: 2023-10-11 19:31 + *@Description: TODO + *@Version: 1.0 + */ +public class Question2 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + String[] nums1 = sc.next().split(","); + int[] nums = new int[nums1.length]; + for (int i = 0; i < nums1.length; i++) { + nums[i] = Integer.parseInt(nums1[i]); + } + + solve(nums); + } + + public static void solve(int[] nums) { + Arrays.sort(nums); + int n = nums.length; + + int sum = 0; + int index = nums.length - 1; + for (; index >= 0 && nums[index] + sum > 0; index--) { + sum += nums[index]; + } +// if (index > 0) { +// //继续判断负数的要不要 +// for (; nums[index] + sum > 0; index--) { +// sum=nums[index] + sum; +// } +// } + int count = 1; + int result = 0; + for (int i = index + 1; i < nums.length; i++, count++) { + result += count * nums[i]; + } + + System.out.println(result); + } + + + @Test + public void test() { +// String[] nums1 = "-1,-8,0,5,-9".split(","); +// String[] nums1 = "4,3,2".split(","); + String[] nums1 = "-1,-4,-5".split(","); + int[] nums = new int[nums1.length]; + for (int i = 0; i < nums1.length; i++) { + nums[i] = Integer.parseInt(nums1[i]); + } + solve(nums); +// System.out.println(Arrays.toString(nums)); + } + +} diff --git a/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question3.java b/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question3.java new file mode 100644 index 0000000..b8453c6 --- /dev/null +++ b/interviewForqiuzhao/HuaWei/src/main/java/com/markilue/interview/Question3.java @@ -0,0 +1,16 @@ +package com.markilue.interview; + +/** + *@BelongsProject: HuaWei + *@BelongsPackage: com.markilue.interview + *@Author: markilue + *@CreateTime: 2023-10-11 20:35 + *@Description: TODO + *@Version: 1.0 + */ +public class Question3 { + + public static void main(String[] args) { + + } +} diff --git a/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question1.java b/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question1.java new file mode 100644 index 0000000..7fe0400 --- /dev/null +++ b/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question1.java @@ -0,0 +1,41 @@ +package com.markilue.interview; + +import java.util.Arrays; +import java.util.Scanner; + +/** + *@BelongsProject: MeiTuan + *@BelongsPackage: com.markilue.interview + *@Author: markilue + *@CreateTime: 2023-09-16 19:01 + *@Description: TODO + *@Version: 1.0 + */ +public class Question1 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int n = sc.nextInt(); + int[] nums = new int[n]; + + for (int i = 0; i < n; i++) { + nums[i]=sc.nextInt(); + } + + solve(nums); + + } + + public static void solve(int[] nums){ + + int result =nums[0]==1?1:0; + + for (int i = 1; i < nums.length; i++) { + if(nums[i]==1){ + result+=nums[i-1]==1?2:1; + } + } + + System.out.println(result); + } +} diff --git a/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question2.java b/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question2.java new file mode 100644 index 0000000..3633e47 --- /dev/null +++ b/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question2.java @@ -0,0 +1,38 @@ +package com.markilue.interview; + +import java.util.Scanner; + +/** + *@BelongsProject: MeiTuan + *@BelongsPackage: com.markilue.interview + *@Author: markilue + *@CreateTime: 2023-09-16 19:06 + *@Description: TODO + *@Version: 1.0 + */ +public class Question2 { + + public static void main(String[] args) { + Scanner sc = new Scanner(System.in); + int x = sc.nextInt(); + int y = sc.nextInt(); + +// if(x>10||y>10){ +// System.out.println(0); +// return; +// } + + double dinct = Math.ceil(Math.sqrt(x * x + y * y)); + if (dinct == 0) { + System.out.println(10); + } else if (dinct > 10) { + System.out.println(0); + } else { + System.out.println((int)(11 - dinct)); + } + + + } + + +} diff --git a/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question3.java b/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question3.java new file mode 100644 index 0000000..fa59dc2 --- /dev/null +++ b/interviewForqiuzhao/MeiTuan/src/main/java/com/markilue/interview/Question3.java @@ -0,0 +1,127 @@ +package com.markilue.interview; + +import org.junit.Test; + +import java.util.Arrays; +import java.util.Comparator; +import java.util.HashMap; +import java.util.Scanner; + +/** + *@BelongsProject: MeiTuan + *@BelongsPackage: com.markilue.interview + *@Author: markilue + *@CreateTime: 2023-09-16 19:20 + *@Description: TODO + *@Version: 1.0 + */ +public class Question3 { + + public static void main(String[] args) { + + Scanner sc = new Scanner(System.in); + + int n = sc.nextInt(); + int targetH = sc.nextInt(); + int targetA = sc.nextInt(); + + int[][] monster = new int[n][2]; + + for (int i = 0; i < n; i++) { + monster[i][0] = sc.nextInt(); + + } + + for (int i = 0; i < n; i++) { + monster[i][1] = sc.nextInt(); + } + sovle(targetH,targetA,monster); + + + + } + + @Test + public void test() { + int[][] monster = { + {1, 3}, + {2, 2}, + {3, 1}, + }; + sovle(1, 1, monster); + } + + + public static void sovle(int targetH, int targetA, int[][] monster) { + + Arrays.sort(monster, new Comparator() { + @Override + public int compare(int[] o1, int[] o2) { + return o1[0] == o2[0] ? o2[1] - o1[1] : o2[0] - o1[0]; + } + }); + + int[][] amons = Arrays.copyOf(monster, monster.length); + + Arrays.sort(amons, (a, b) -> (b[1] - a[1])); + int leftans = 0; + int righttans = 0; + int count1 = 0; + int count2 = 0; + int i = 0; + + while (targetH <= monster[i][0]) { + i++; + if (i == monster.length) break; + } + + for (int j = i; j < monster.length; j++) { + count2=0; + if(targetA>monster[j][1]){ + int temp =1; + int k=j+1; + for (;kamons[j][0]){ + int temp =1; + int k=j+1; + for (;k (sample,filter_num,dims)''' + # + # # # 将其分成重叠采样状态-滑动窗口函数 + # train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + # + # for dim in range(dims): + # train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + # + # # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + # + # train_data = np.transpose(train_data, [1, 2, 0]) + # + # # todo 解决模型保存时,query无法序列化的问题 + # total_data = HI_merge_data + # + # print("total_data.shape:", total_data.shape) + # print("train_data.shape:", train_data.shape) # (20, 1200, 30) + # print("train_label.shape:", train_label.shape) # (20, 1200) + # print("train_label_single.shape:", train_label_single.shape) + # + # # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + # return total_data, train_data, train_label, train_label_single + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +if __name__ == '__main__': + getData(10, 10, False) diff --git a/pytorch_example/RUL/__init__.py b/pytorch_example/RUL/__init__.py new file mode 100644 index 0000000..090d185 --- /dev/null +++ b/pytorch_example/RUL/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 21:32 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/CommonFunction.py b/pytorch_example/RUL/baseModel/CommonFunction.py new file mode 100644 index 0000000..df04d50 --- /dev/null +++ b/pytorch_example/RUL/baseModel/CommonFunction.py @@ -0,0 +1,143 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:57 +@Usage : +@Desc : +''' + +import os +import shutil + +import numpy as np +import pandas as pd + + +def folderGenerate(folder_name): + if not os.path.exists(folder_name): + os.makedirs(folder_name) + # os.mkdir(folder_name) + + +# 递归删除文件夹 +def folderDelete(folder_name): + if os.path.exists(folder_name): + shutil.rmtree(folder_name) + + +# 判断这次是否进行模型保存,history_loss存储历史上的loss +def SaveBestModel(model, save_name, history_loss, loss_value, pattern: str = "min", epoch=0, is_all=False): + weight_folder = save_name[:-4] + if is_all: + weight_folder = weight_folder + '_epoch' + str(epoch) + "_" + str(loss_value) + save_name = weight_folder + save_name[-7:] + + # 如果history_loss为空,那么直接保存 + if len(history_loss) == 0: + folderGenerate(weight_folder) + model.save_weights(save_name) + return + + if pattern == "min": + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.min(history_loss) > loss_value: + # 删除上一次的保存这一次的 + folderDelete(weight_folder) + folderGenerate(weight_folder) + model.save_weights(save_name) + print("保存这次模型") + return + elif pattern == "max": + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.max(history_loss) < loss_value: + # 删除上一次的保存这一次的 + folderDelete(weight_folder) + folderGenerate(weight_folder) + model.save_weights(save_name) + print("保存这次模型") + return + else: + raise ValueError("算法尚未实现") + + pass + + +# 判断这次是否进行模型保存,history_loss存储历史上的loss +def SaveBestModelByAccuracy(model, save_name, history_accuracy, accuracy_value): + weight_folder = save_name[:-7] + + # 如果history_loss为空,那么直接保存 + if len(history_accuracy) == 0: + folderGenerate(weight_folder) + model.save_weights(save_name) + return + + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.max(history_accuracy) < accuracy_value: + # 删除上一次的保存这一次的 + folderDelete(weight_folder) + folderGenerate(weight_folder) + model.save_weights(save_name) + print("保存这次模型") + return + + pass + + +# 判断这次是否进行模型保存,history_loss存储历史上的loss +def SaveBestH5Model(model, save_name, history_loss, loss_value): + dirpath = os.path.dirname(save_name) + folderGenerate(dirpath) + # 如果history_loss为空,那么直接保存 + if len(history_loss) == 0: + model.save(save_name) + return + + # 先判断要不要存模型,如果上一次的比这一次的loss要大,就保存这一次的 + if np.min(history_loss) > loss_value: + # 删除上一次的保存这一次的 + model.save(save_name, overwrite=True) + print("保存这次模型") + return + + pass + + +def IsStopTraining(history_loss, patience=5, pattern: str = "min"): + if len(history_loss) <= patience: + return False + if pattern == "min": + if history_loss[-(patience + 1)] < min(history_loss[-patience:]): + print(patience, "次loss未下降,训练停止") + return True + elif pattern == "max": + if history_loss[-(patience + 1)] > max(history_loss[-patience:]): + print(patience, "次准确率为上升,训练停止") + return True + else: + raise ValueError("算法尚未实现") + + return False + + +def Is_Reduce_learning_rate(history_loss, patience=3, pattern: str = "min"): + if len(history_loss) <= patience: + return False + if pattern == "min": + for i in range(patience): + if history_loss[-(patience + 1)] > history_loss[-i]: + return False + elif pattern == "max": + for i in range(patience): + if history_loss[-(patience + 1)] < history_loss[-i]: + return False + else: + raise ValueError("算法尚未实现") + print(patience, "次loss未下降,降低学习率") + return True + + +if __name__ == '__main__': + history_loss = [0.1, 0.2, 0.3, 0.25, 0.42, 0.12, 0.31] + IsStopTraining(history_loss) diff --git a/pytorch_example/RUL/baseModel/__init__.py b/pytorch_example/RUL/baseModel/__init__.py new file mode 100644 index 0000000..77ba3ba --- /dev/null +++ b/pytorch_example/RUL/baseModel/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 13:00 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/dctAttention.py b/pytorch_example/RUL/baseModel/dctAttention.py new file mode 100644 index 0000000..457bda9 --- /dev/null +++ b/pytorch_example/RUL/baseModel/dctAttention.py @@ -0,0 +1,160 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 13:00 +@Usage : +@Desc : 构建一些即插即用的channelAttention +''' + +import torch.nn as nn +import math +import numpy as np +import torch +import torch_dct as dct + +try: + from torch import irfft + from torch import rfft +except ImportError: + def rfft(x, d): + t = torch.fft.fft(x, dim=(-d)) + r = torch.stack((t.real, t.imag), -1) + return r + + + def irfft(x, d): + t = torch.fft.ifft(torch.complex(x[:, :, 0], x[:, :, 1]), dim=(-d)) + return t.real + + +# def dct(x, norm=None): +# """ +# Discrete Cosine Transform, Type II (a.k.a. the DCT) +# +# For the meaning of the parameter `norm`, see: +# https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.fftpack.dct.html +# +# :param x: the input signal +# :param norm: the normalization, None or 'ortho' +# :return: the DCT-II of the signal over the last dimension +# """ +# x_shape = x.shape +# N = x_shape[-1] +# x = x.contiguous().view(-1, N) +# +# v = torch.cat([x[:, ::2], x[:, 1::2].flip([1])], dim=1) +# +# # Vc = torch.fft.rfft(v, 1, onesided=False) +# Vc = rfft(v, 1) +# +# k = - torch.arange(N, dtype=x.dtype, device=x.device)[None, :] * np.pi / (2 * N) +# W_r = torch.cos(k) +# W_i = torch.sin(k) +# +# V = Vc[:, :, 0] * W_r - Vc[:, :, 1] * W_i +# +# if norm == 'ortho': +# V[:, 0] /= np.sqrt(N) * 2 +# V[:, 1:] /= np.sqrt(N / 2) * 2 +# +# V = 2 * V.view(*x_shape) +# +# return V + +class dct_channel_block(nn.Module): + def __init__(self, channel): + super(dct_channel_block, self).__init__() + # self.avg_pool = nn.AdaptiveAvgPool1d(1) #innovation + self.fc = nn.Sequential( + nn.Linear(channel, channel * 2, bias=False), + nn.Dropout(p=0.1), + nn.ReLU(inplace=True), + nn.Linear(channel * 2, channel, bias=False), + nn.Sigmoid() + ) + # self.dct_norm = nn.LayerNorm([512], eps=1e-6) + + self.dct_norm = nn.LayerNorm([channel], eps=1e-6) # for lstm on length-wise + # self.dct_norm = nn.LayerNorm([36], eps=1e-6)#for lstm on length-wise on ill with input =36 + + def forward(self, x): + b, c = x.size() # (B,C,L) (32,96,512) + + # list = [] + # for i in range(c): + # freq = dct.dct(x[:, :, i]) + # list.append(freq) + # + # stack_dct = torch.stack(list, dim=2) + + # change = x.transpose(2, 1) + stack_dct = dct.dct(x,norm='ortho') + # stack_dct = stack_dct.transpose(2, 1) + + # stack_dct = torch.tensor(stack_dct) + ''' + for traffic mission:f_weight = self.dct_norm(f_weight.permute(0,2,1))#matters for traffic datasets + ''' + + lr_weight = self.dct_norm(stack_dct) + lr_weight = self.fc(stack_dct) + lr_weight = self.dct_norm(lr_weight) + + # print("lr_weight",lr_weight.shape) + return x * lr_weight # result + + + +class dct_channel_block_withConv(nn.Module): + def __init__(self, channel): + super(dct_channel_block_withConv, self).__init__() + # self.avg_pool = nn.AdaptiveAvgPool1d(1) #innovation + self.fc = nn.Sequential( + nn.Linear(channel, channel * 2, bias=False), + nn.Dropout(p=0.1), + nn.ReLU(inplace=True), + nn.Linear(channel * 2, channel, bias=False), + nn.Sigmoid() + ) + + # self.dct_norm = nn.LayerNorm([512], eps=1e-6) + + self.dct_norm = nn.LayerNorm([channel], eps=1e-6) # for lstm on length-wise + # self.dct_norm = nn.LayerNorm([36], eps=1e-6)#for lstm on length-wise on ill with input =36 + + def forward(self, x): + b, c = x.size() # (B,C,L) (32,96,512) + + # list = [] + # for i in range(c): + # freq = dct.dct(x[:, :, i]) + # list.append(freq) + # + # stack_dct = torch.stack(list, dim=2) + + # change = x.transpose(2, 1) + stack_dct = dct.dct(x,norm='ortho') + + # stack_dct = stack_dct.transpose(2, 1) + + # stack_dct = torch.tensor(stack_dct) + ''' + for traffic mission:f_weight = self.dct_norm(f_weight.permute(0,2,1))#matters for traffic datasets + ''' + + lr_weight = self.dct_norm(stack_dct) + lr_weight = self.fc(stack_dct) + lr_weight = self.dct_norm(lr_weight) + + # print("lr_weight",lr_weight.shape) + return x * lr_weight # result + + +if __name__ == '__main__': + # input_data = torch.Tensor([[1, 2, 3], [4, 5, 6]]) # [2, 3] + x = torch.rand((32, 10, 64)) + print(x.shape) + m = nn.Linear(64, 2) + output = m(x) + print(output.shape) # [2, 2] diff --git a/pytorch_example/RUL/baseModel/dctChannelAttention.py b/pytorch_example/RUL/baseModel/dctChannelAttention.py new file mode 100644 index 0000000..38cc454 --- /dev/null +++ b/pytorch_example/RUL/baseModel/dctChannelAttention.py @@ -0,0 +1,161 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 13:00 +@Usage : +@Desc : 构建一些即插即用的channelAttention +''' + +import torch.nn as nn +import math +import numpy as np +import torch +import torch_dct as dct + +try: + from torch import irfft + from torch import rfft +except ImportError: + def rfft(x, d): + t = torch.fft.fft(x, dim=(-d)) + r = torch.stack((t.real, t.imag), -1) + return r + + + def irfft(x, d): + t = torch.fft.ifft(torch.complex(x[:, :, 0], x[:, :, 1]), dim=(-d)) + return t.real + + +# def dct(x, norm=None): +# """ +# Discrete Cosine Transform, Type II (a.k.a. the DCT) +# +# For the meaning of the parameter `norm`, see: +# https://docs.scipy.org/doc/scipy-0.14.0/reference/generated/scipy.fftpack.dct.html +# +# :param x: the input signal +# :param norm: the normalization, None or 'ortho' +# :return: the DCT-II of the signal over the last dimension +# """ +# x_shape = x.shape +# N = x_shape[-1] +# x = x.contiguous().view(-1, N) +# +# v = torch.cat([x[:, ::2], x[:, 1::2].flip([1])], dim=1) +# +# # Vc = torch.fft.rfft(v, 1, onesided=False) +# Vc = rfft(v, 1) +# +# k = - torch.arange(N, dtype=x.dtype, device=x.device)[None, :] * np.pi / (2 * N) +# W_r = torch.cos(k) +# W_i = torch.sin(k) +# +# V = Vc[:, :, 0] * W_r - Vc[:, :, 1] * W_i +# +# if norm == 'ortho': +# V[:, 0] /= np.sqrt(N) * 2 +# V[:, 1:] /= np.sqrt(N / 2) * 2 +# +# V = 2 * V.view(*x_shape) +# +# return V + + +class dct_channel_block(nn.Module): + def __init__(self, channel): + super(dct_channel_block, self).__init__() + # self.avg_pool = nn.AdaptiveAvgPool1d(1) #innovation + self.fc = nn.Sequential( + nn.Linear(channel, channel * 2, bias=False), + nn.Dropout(p=0.1), + nn.ReLU(inplace=True), + nn.Linear(channel * 2, channel, bias=False), + nn.Sigmoid() + ) + # self.dct_norm = nn.LayerNorm([512], eps=1e-6) + + self.dct_norm = nn.LayerNorm([channel], eps=1e-6) # for lstm on length-wise + # self.dct_norm = nn.LayerNorm([36], eps=1e-6)#for lstm on length-wise on ill with input =36 + + def forward(self, x): + b, t, c = x.size() # (B,C,L) (32,96,512) + + list = [] + for i in range(c): + freq = dct.dct(x[:, :, i],norm='ortho') + list.append(freq) + + stack_dct = torch.stack(list, dim=2) + + # 经测试,上下两种不一样 + # change = x.transpose(2, 1) + # stack_dct_a = dct.dct(change,norm='ortho') + # stack_dct_b = stack_dct_a.transpose(2, 1) + + # stack_dct = torch.tensor(stack_dct) + ''' + for traffic mission:f_weight = self.dct_norm(f_weight.permute(0,2,1))#matters for traffic datasets + ''' + + lr_weight = self.fc(stack_dct) + lr_weight = self.dct_norm(lr_weight) + # print("lr_weight",lr_weight.shape) + return x * lr_weight # result + + +class dct_channel_block1(nn.Module): + def __init__(self, channel): + super(dct_channel_block1, self).__init__() + # self.avg_pool = nn.AdaptiveAvgPool1d(1) #innovation + self.fc = nn.Sequential( + nn.Linear(channel, channel * 2, bias=False), + nn.Dropout(p=0.1), + nn.ReLU(inplace=True), + nn.Linear(channel * 2, channel, bias=False), + nn.Sigmoid() + ) + # self.dct_norm = nn.LayerNorm([512], eps=1e-6) + + self.dct_norm = nn.LayerNorm([96], eps=1e-6) # for lstm on length-wise + # self.dct_norm = nn.LayerNorm([36], eps=1e-6)#for lstm on length-wise on ill with input =36 + + def forward(self, x): + b, c, l = x.size() # (B,C,L) (32,96,512) + # y = self.avg_pool(x) # (B,C,L) -> (B,C,1) + + # y = self.avg_pool(x).view(b, c) # (B,C,L) -> (B,C,1) + # print("y",y.shape + # y = self.fc(y).view(b, c, 96) + list = [] + for i in range(c): + freq = dct.dct(x[:, i, :]) + # print("freq-shape:",freq.shape) + list.append(freq) + + stack_dct = torch.stack(list, dim=1) + stack_dct = torch.tensor(stack_dct) + ''' + for traffic mission:f_weight = self.dct_norm(f_weight.permute(0,2,1))#matters for traffic datasets + ''' + + lr_weight = self.dct_norm(stack_dct) + lr_weight = self.fc(stack_dct) + lr_weight = self.dct_norm(lr_weight) + + # print("lr_weight",lr_weight.shape) + return x * lr_weight # result + + +if __name__ == '__main__': + # input_data = torch.Tensor([[1, 2, 3], [4, 5, 6]]) # [2, 3] + x = torch.rand((8, 7, 96)) + dct_model = dct_channel_block(96) + result1,result2 = dct_model.forward(x) + print(result1) + print(result2) + # print(x.shape) + # m = nn.Linear(64, 2) + # output = m(x) + # print(output.shape) # [2, 2] diff --git a/pytorch_example/RUL/baseModel/loss/Evaluate.py b/pytorch_example/RUL/baseModel/loss/Evaluate.py new file mode 100644 index 0000000..20a5e70 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/Evaluate.py @@ -0,0 +1,78 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/23 16:32 +@Usage : +@Desc : +''' + +import torch +import torch.nn as nn +import torch.nn.functional as F +import numpy as np + + +def mae(y_true, y_predict): + return np.mean(np.mean(np.abs(y_true - y_predict), axis=-1)) + + +def mape(y_true, y_predict): + return np.mean(np.mean(np.abs((y_true - y_predict) / y_true), axis=-1)) + + +def score(y_true, y_predict): + Eri = y_predict - y_true + dw = np.log(0.5) + total = [] + + if len(y_true.shape) > 1: + b, c = y_true.shape + + for i in range(b): + cList = [] + for j in range(c): + if Eri[i, j] < 0: + cList.append(np.exp(-(Eri[i, j] / 13)) - 1) + else: + cList.append(np.exp((Eri[i, j] / 10)) - 1) + total.append(np.stack(cList)) + total = np.stack(total, axis=0) + + return np.mean(np.mean(total, axis=-1)) + else: + b, = y_true.shape + for i in range(b): + if Eri[i] <= 0: + total.append(np.exp((-dw) * (Eri[i] / 5))) + else: + total.append(np.exp((dw) * (Eri[i] / 20))) + total = np.stack(total, axis=0) + + return np.mean(total) + + pass + + +def rmse(y_true, y_predict): + loss = np.sqrt(np.mean(np.mean((y_predict - y_true) ** 2, axis=-1))) + + return loss + + +def getEvaluate(y_true, y_predict): + return [rmse(y_true, y_predict), mae(y_true, y_predict), mape(y_true, y_predict), score(y_true, y_predict)] + + +if __name__ == '__main__': + # a = torch.log(torch.tensor(0.5)) + # print(a) + # x = torch.rand((32,)) + # y = torch.rand((32,)) + x = np.random.random(size=(32,)) + y = np.random.random(size=(32,)) + + print(mae(x, y)) + print(mape(x, y)) + print(rmse(x, y)) + print(score(x, y)) diff --git a/pytorch_example/RUL/baseModel/loss/__init__.py b/pytorch_example/RUL/baseModel/loss/__init__.py new file mode 100644 index 0000000..1c722d2 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/20 16:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/loss/adv_loss.py b/pytorch_example/RUL/baseModel/loss/adv_loss.py new file mode 100644 index 0000000..027bb37 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/adv_loss.py @@ -0,0 +1,57 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:46 +@Usage : +@Desc : +''' +import torch +import torch.nn as nn +import math +import numpy as np +import torch.nn.functional as F +from torch.autograd import Function + +class ReverseLayerF(Function): + + @staticmethod + def forward(ctx, x, alpha): + ctx.alpha = alpha + return x.view_as(x) + + @staticmethod + def backward(ctx, grad_output): + output = grad_output.neg() * ctx.alpha + return output, None + + +class Discriminator(nn.Module): + def __init__(self, input_dim=256, hidden_dim=256): + super(Discriminator, self).__init__() + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.dis1 = nn.Linear(input_dim, hidden_dim) + self.dis2 = nn.Linear(hidden_dim, 1) + + def forward(self, x): + x = F.relu(self.dis1(x)) + x = self.dis2(x) + x = torch.sigmoid(x) + return x + + +def adv(source, target, input_dim=256, hidden_dim=512): + domain_loss = nn.BCELoss() + # !!! Pay attention to .cuda !!! + adv_net = Discriminator(input_dim, hidden_dim) + domain_src = torch.ones(len(source)) # 源域的标签 + domain_tar = torch.zeros(len(target)) # 目标域的标签 + domain_src, domain_tar = domain_src.view(domain_src.shape[0], 1), domain_tar.view(domain_tar.shape[0], 1) + reverse_src = ReverseLayerF.apply(source, 1) + reverse_tar = ReverseLayerF.apply(target, 1) + pred_src = adv_net(reverse_src) + pred_tar = adv_net(reverse_tar) + loss_s, loss_t = domain_loss(pred_src, domain_src), domain_loss(pred_tar, domain_tar) + loss = loss_s + loss_t + return loss \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/loss/coral.py b/pytorch_example/RUL/baseModel/loss/coral.py new file mode 100644 index 0000000..d6676a7 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/coral.py @@ -0,0 +1,27 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:46 +@Usage : +@Desc : +''' +import torch + +def CORAL(source, target): + d = source.size(1) + ns, nt = source.size(0), target.size(0) + + # source covariance + tmp_s = torch.ones((1, ns)) @ source + cs = (source.t() @ source - (tmp_s.t() @ tmp_s) / ns) / (ns - 1) + + # target covariance + tmp_t = torch.ones((1, nt)) @ target + ct = (target.t() @ target - (tmp_t.t() @ tmp_t) / nt) / (nt - 1) + + # frobenius norm + loss = (cs - ct).pow(2).sum() + loss = loss / (4 * d * d) + + return loss \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/loss/cos.py b/pytorch_example/RUL/baseModel/loss/cos.py new file mode 100644 index 0000000..ec220e0 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/cos.py @@ -0,0 +1,15 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:47 +@Usage : +@Desc : +''' +import torch.nn as nn + +def cosine(source, target): + source, target = source.mean(0), target.mean(0) + cos = nn.CosineSimilarity(dim=0) + loss = cos(source, target) + return loss.mean() \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/loss/ffd.py b/pytorch_example/RUL/baseModel/loss/ffd.py new file mode 100644 index 0000000..26dcd96 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/ffd.py @@ -0,0 +1,40 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/20 15:44 +@Usage : +@Desc : fft 频域Loss +''' +import torch +import torch.nn as nn + +import torch_dct as dct +import torch.fft as fft + + +def fft_mse(source, target): + if len(source.shape) < 2: + length = 1 + else: + _, length = source.shape + source = fft.rfft(source) + target = fft.rfft(target) + + source = torch.abs(source / length) + target = torch.abs(target / length) + source, target = source.mean(0), target.mean(0) + mse = nn.MSELoss() + loss = mse(source, target) + return loss.mean() + pass + + +def dct_mse(source, target): + source = dct.dct(source) + target = dct.dct(target) + source, target = source.mean(0), target.mean(0) + mse = nn.MSELoss() + loss = mse(source, target) + return loss.mean() + pass diff --git a/pytorch_example/RUL/baseModel/loss/kl_js.py b/pytorch_example/RUL/baseModel/loss/kl_js.py new file mode 100644 index 0000000..8b36670 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/kl_js.py @@ -0,0 +1,28 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:47 +@Usage : +@Desc : +''' +import torch.nn as nn + +def kl_div(source, target): + if len(source) < len(target): + target = target[:len(source)] + elif len(source) > len(target): + source = source[:len(target)] + criterion = nn.KLDivLoss(reduction='batchmean') + loss = criterion(source.log(), target) + return loss + + +def js(source, target): + if len(source) < len(target): + target = target[:len(source)] + elif len(source) > len(target): + source = source[:len(target)] + M = .5 * (source + target) + loss_1, loss_2 = kl_div(source, M), kl_div(target, M) + return .5 * (loss_1 + loss_2) \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/loss/mmd.py b/pytorch_example/RUL/baseModel/loss/mmd.py new file mode 100644 index 0000000..603c831 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/mmd.py @@ -0,0 +1,57 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:47 +@Usage : +@Desc : +''' +import torch +import torch.nn as nn + +class MMD_loss(nn.Module): + def __init__(self, kernel_type='linear', kernel_mul=2.0, kernel_num=5): + super(MMD_loss, self).__init__() + self.kernel_num = kernel_num + self.kernel_mul = kernel_mul + self.fix_sigma = None + self.kernel_type = kernel_type + + def guassian_kernel(self, source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None): + n_samples = int(source.size()[0]) + int(target.size()[0]) + total = torch.cat([source, target], dim=0) + total0 = total.unsqueeze(0).expand( + int(total.size(0)), int(total.size(0)), int(total.size(1))) + total1 = total.unsqueeze(1).expand( + int(total.size(0)), int(total.size(0)), int(total.size(1))) + L2_distance = ((total0-total1)**2).sum(2) + if fix_sigma: + bandwidth = fix_sigma + else: + bandwidth = torch.sum(L2_distance.data) / (n_samples**2-n_samples) + bandwidth /= kernel_mul ** (kernel_num // 2) + bandwidth_list = [bandwidth * (kernel_mul**i) + for i in range(kernel_num)] + kernel_val = [torch.exp(-L2_distance / bandwidth_temp) + for bandwidth_temp in bandwidth_list] + return sum(kernel_val) + + def linear_mmd(self, X, Y): + delta = X.mean(axis=0) - Y.mean(axis=0) + loss = delta.dot(delta.T) + return loss + + def forward(self, source, target): + if self.kernel_type == 'linear': + return self.linear_mmd(source, target) + elif self.kernel_type == 'rbf': + batch_size = int(source.size()[0]) + kernels = self.guassian_kernel( + source, target, kernel_mul=self.kernel_mul, kernel_num=self.kernel_num, fix_sigma=self.fix_sigma) + with torch.no_grad(): + XX = torch.mean(kernels[:batch_size, :batch_size]) + YY = torch.mean(kernels[batch_size:, batch_size:]) + XY = torch.mean(kernels[:batch_size, batch_size:]) + YX = torch.mean(kernels[batch_size:, :batch_size]) + loss = torch.mean(XX + YY - XY - YX) + return loss \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/loss/mutual_info.py b/pytorch_example/RUL/baseModel/loss/mutual_info.py new file mode 100644 index 0000000..f7edc52 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/mutual_info.py @@ -0,0 +1,38 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:47 +@Usage : +@Desc : +''' +import torch +import torch.nn as nn +import torch.nn.functional as F + +class Mine_estimator(nn.Module): + def __init__(self, input_dim=2048, hidden_dim=512): + super(Mine_estimator, self).__init__() + self.mine_model = Mine(input_dim, hidden_dim) + + def forward(self, X, Y): + Y_shffle = Y[torch.randperm(len(Y))] + loss_joint = self.mine_model(X, Y) + loss_marginal = self.mine_model(X, Y_shffle) + ret = torch.mean(loss_joint) - \ + torch.log(torch.mean(torch.exp(loss_marginal))) + loss = -ret + return loss + + +class Mine(nn.Module): + def __init__(self, input_dim=2048, hidden_dim=512): + super(Mine, self).__init__() + self.fc1_x = nn.Linear(input_dim, hidden_dim) + self.fc1_y = nn.Linear(input_dim, hidden_dim) + self.fc2 = nn.Linear(hidden_dim, 1) + + def forward(self, x, y): + h1 = F.leaky_relu(self.fc1_x(x)+self.fc1_y(y)) + h2 = self.fc2(h1) + return h2 \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/loss/pair_dist.py b/pytorch_example/RUL/baseModel/loss/pair_dist.py new file mode 100644 index 0000000..74ced73 --- /dev/null +++ b/pytorch_example/RUL/baseModel/loss/pair_dist.py @@ -0,0 +1,54 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:48 +@Usage : +@Desc : +''' +import torch +import numpy as np + + +def pairwise_dist(X, Y): + n, d = X.shape + m, _ = Y.shape + assert d == Y.shape[1] + a = X.unsqueeze(1).expand(n, m, d) + b = Y.unsqueeze(0).expand(n, m, d) + return torch.pow(a - b, 2).sum(2) + + +def pairwise_dist_np(X, Y): + n, d = X.shape + m, _ = Y.shape + assert d == Y.shape[1] + a = np.expand_dims(X, 1) + b = np.expand_dims(Y, 0) + a = np.tile(a, (1, m, 1)) + b = np.tile(b, (n, 1, 1)) + return np.power(a - b, 2).sum(2) + +def pa(X, Y): + XY = np.dot(X, Y.T) + XX = np.sum(np.square(X), axis=1) + XX = np.transpose([XX]) + YY = np.sum(np.square(Y), axis=1) + dist = XX + YY - 2 * XY + + return dist + + +if __name__ == '__main__': + import sys + args = sys.argv + data = args[0] + print(data) + + # a = torch.arange(1, 7).view(2, 3) + # b = torch.arange(12, 21).view(3, 3) + # print(pairwise_dist(a, b)) + + # a = np.arange(1, 7).reshape((2, 3)) + # b = np.arange(12, 21).reshape((3, 3)) + # print(pa(a, b)) \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/plot.py b/pytorch_example/RUL/baseModel/plot.py new file mode 100644 index 0000000..f4a66f7 --- /dev/null +++ b/pytorch_example/RUL/baseModel/plot.py @@ -0,0 +1,113 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/20 19:30 +@Usage : +@Desc : +''' + +import matplotlib.pyplot as plt +import time + + +def plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name, predict_num=50): + font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + timestamp = str(int(time.time()))[-4:] # 画图的时间戳取后四位 + plt.figure(1) + + '''保存的模型参数的路径''' + + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + # 简单预测图 + length = len(predicted_data_easy) + plt.scatter(list(range(length)), total_data, c='blue', s=12, label='Actual value') + plt.plot(list(range(length - predict_num)), + predicted_data_easy[:length - predict_num], linewidth=2, color='red', + label='Traning value') + plt.scatter(list(range(length - predict_num, length)), predicted_data_easy[length - predict_num:length], c='black', + s=15, label='Predictive value') + plt.axhline(total_data[-1], linewidth=2, c='green', label='Failure threshold') + # plt.title() + plt.xlabel('Serial number of the fusion feature point', font=font1) + plt.ylabel('Virtual health indicator', font=font1) + + plt.legend(loc='upper left', prop=font2) + plt.savefig(save_fig_name + 'easy{0}.png'.format(timestamp)) + plt.show() + + # 困难预测图 + plt.figure(2) + + '''保存的模型参数的路径''' + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + # 简单预测图 + length = len(predicted_data_easy) + + plt.scatter(list(range(length)), total_data, c='blue', s=12, label='Actual value') + plt.plot(list(range(length - predict_num)), + predicted_data_hard[:length - predict_num], linewidth=2, color='red', + label='Traning value') + plt.scatter(list(range(length - predict_num, length)), predicted_data_hard[length - predict_num:length], c='black', + s=15, label='Predictive value') + # plt.title() + plt.xlabel('Serial number of the fusion feature point', font=font1) + plt.ylabel('Virtual health indicator', font=font1) + plt.axhline(total_data[-1], linewidth=2, c='green', label='Failure threshold') + plt.legend(loc='upper left', prop=font2) + + plt.savefig(save_fig_name + 'hard{0}.png'.format(timestamp)) + plt.show() + + +def plot_forSelf(total_data, predicted_data_easy, predicted_data_hard): + pic1 = plt.figure(figsize=(8, 6), dpi=200) + + '''保存的模型参数的路径''' + + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + # 简单预测图 + plt.subplot(2, 1, 1) + plt.plot(total_data) + plt.plot(predicted_data_easy) + plt.title('Easy Prediction') + plt.xlabel('time') + plt.ylabel('loss') + # plt.legend(loc='upper right') + + # 困难预测图 + plt.subplot(2, 1, 2) + plt.plot(total_data) + plt.plot(predicted_data_hard) + plt.title('Easy Prediction') + plt.xlabel('time') + plt.ylabel('loss') + + # plt.legend(loc='upper right') + + # plt.scatter() + + plt.show() diff --git a/pytorch_example/RUL/baseModel/test.py b/pytorch_example/RUL/baseModel/test.py new file mode 100644 index 0000000..cbf9141 --- /dev/null +++ b/pytorch_example/RUL/baseModel/test.py @@ -0,0 +1,10 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/24 14:15 +@Usage : +@Desc : 一些测试方法 +''' + + diff --git a/pytorch_example/RUL/baseModel/utils/__init__.py b/pytorch_example/RUL/baseModel/utils/__init__.py new file mode 100644 index 0000000..fdbef72 --- /dev/null +++ b/pytorch_example/RUL/baseModel/utils/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/24 15:51 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/baseModel/utils/utils.py b/pytorch_example/RUL/baseModel/utils/utils.py new file mode 100644 index 0000000..952e555 --- /dev/null +++ b/pytorch_example/RUL/baseModel/utils/utils.py @@ -0,0 +1,229 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' + +import collections +import torch +import os +import pandas as pd +import torch.nn as nn +from tqdm import tqdm +import numpy as np + +EPS = 1e-12 + + +class AverageMeter(object): + def __init__(self): + self.reset() + + def reset(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + self.list = [] + + def update(self, val, n=1): + self.val = val + self.list.append(val) + self.sum += val * n + self.count += n + self.avg = self.sum / self.count + + +def average_params(params_list): + assert isinstance(params_list, (tuple, list, collections.deque)) + n = len(params_list) + if n == 1: + return params_list[0] + new_params = collections.OrderedDict() + keys = None + for i, params in enumerate(params_list): + if keys is None: + keys = params.keys() + for k, v in params.items(): + if k not in keys: + raise ValueError('the %d-th model has different params' % i) + if k not in new_params: + new_params[k] = v / n + else: + new_params[k] += v / n + return new_params + + +def zscore(x): + return (x - x.mean(dim=0, keepdim=True)) / x.std(dim=0, keepdim=True, unbiased=False) + + +def calc_loss(pred, label): + return torch.mean((zscore(pred) - label) ** 2) + + +def calc_corr(pred, label): + return (zscore(pred) * zscore(label)).mean() + + +def test_ic(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = label_actual.clone().detach().view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_daily(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values + avg), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for slc in tqdm(data_list[i].iter_daily(), total=data_list[i].daily_length): + feature, label_actual, _, _ = data_list[i].get(slc) + # for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = torch.tensor(label_actual, dtype=torch.float32, device=device).view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_uni(model, data_loader, model_path=None, ic_type='spearman', verbose=False): + if model_path: + model.load_state_dict(torch.load(model_path)) + model.eval() + loss_all = [] + ic_all = [] + for slc in tqdm(data_loader.iter_daily(), total=data_loader.daily_length): + data, label, _, _ = data_loader.get(slc) + with torch.no_grad(): + pred = model.predict(data) + mask = ~torch.isnan(label) + pred = pred[mask] + label = label[mask] + loss = torch.mean(torch.log(torch.cosh(pred - label))) + if ic_type == 'spearman': + ic = spearman_corr(pred, label) + elif ic_type == 'pearson': + ic = pearson_corr(pred, label) + loss_all.append(loss.item()) + ic_all.append(ic) + loss, ic = np.mean(loss_all), np.mean(ic_all) + if verbose: + print('IC: ', ic) + return loss, ic + + +def calc_ic(x, y, ic_type='pearson'): + ic = -100 + if ic_type == 'pearson': + ic = pearson_corr(x, y) + elif ic_type == 'spearman': + ic = spearman_corr(x, y) + return ic + + +def create_dir(path): + if not os.path.exists(path): + os.makedirs(path) + +def delete_file(path): + if os.path.exists(path): + os.remove(path) + + +def handle_nan(x): + mask = ~torch.isnan(x) + return x[mask], mask + + +class Log_Loss(nn.Module): + def __init__(self): + super(Log_Loss, self).__init__() + + def forward(self, ytrue, ypred): + delta = ypred - ytrue + return torch.mean(torch.log(torch.cosh(delta))) + + +def spearman_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='spearman') + return spearman + + +def spearman_corr2(x, y): + X = pd.Series(x) + Y = pd.Series(y) + spearman = X.corr(Y, method='spearman') + return spearman + + +def pearson_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='pearson') + return spearman + + +def dir_exist(dirs): + if not os.path.exists(dirs): + os.makedirs(dirs) \ No newline at end of file diff --git a/pytorch_example/RUL/dataset/HI_merge_data.npy b/pytorch_example/RUL/dataset/HI_merge_data.npy new file mode 100644 index 0000000..74088b7 Binary files /dev/null and b/pytorch_example/RUL/dataset/HI_merge_data.npy differ diff --git a/pytorch_example/RUL/dataset/HI_merge_data1.npy b/pytorch_example/RUL/dataset/HI_merge_data1.npy new file mode 100644 index 0000000..1175ec5 Binary files /dev/null and b/pytorch_example/RUL/dataset/HI_merge_data1.npy differ diff --git a/pytorch_example/RUL/dataset/smallVHI.csv b/pytorch_example/RUL/dataset/smallVHI.csv new file mode 100644 index 0000000..3cc183f --- /dev/null +++ b/pytorch_example/RUL/dataset/smallVHI.csv @@ -0,0 +1,1250 @@ +0.0172 +0.0173 +0.0184 +0.0343 +0.0195 +0.0284 +0 +0.0263 +0.0079 +0.0073 +0.0299 +0.023 +0.0475 +0.0229 +0.0623 +0.0235 +0.0272 +0.0325 +0.0168 +0.0044 +0.0217 +0.052 +0.043 +0.0125 +0.046 +0.0352 +0.0113 +0.0551 +0.0255 +0.0102 +0.0231 +0.018 +0.041 +0.0609 +0.0598 +0.0192 +0.0387 +0.0509 +0.0073 +0.0573 +0.0336 +0.0514 +0.0263 +0.0206 +0.0261 +0.0195 +0.044 +0.0488 +0.0102 +0.0424 +0.0204 +0.0127 +0.0212 +0.0346 +0.0282 +0.0379 +0.0369 +0.0335 +0.0425 +0.0313 +0.0341 +0.0527 +0.0622 +0.0487 +0.0714 +0.06 +0.0654 +0.0241 +0.0403 +0.0755 +0.0403 +0.041 +0.0439 +0.0447 +0.0401 +0.0414 +0.0283 +0.0233 +0.0209 +0.0451 +0.0515 +0.0447 +0.0675 +0.0385 +0.0535 +0.0322 +0.0261 +0.0499 +0.0249 +0.0573 +0.0586 +0.0416 +0.0478 +0.038 +0.028 +0.0102 +0.0164 +0.0322 +0.0204 +0.0626 +0.0405 +0.0538 +0.0495 +0.0585 +0.0283 +0.0489 +0.0488 +0.0475 +0.0429 +0.0316 +0.0442 +0.0476 +0.0507 +0.0375 +0.0316 +0.0318 +0.0695 +0.0515 +0.0343 +0.0336 +0.0308 +0.0211 +0.0286 +0.0324 +0.0706 +0.0618 +0.0366 +0.0718 +0.035 +0.0588 +0.0292 +0.0414 +0.022 +0.0557 +0.064 +0.0645 +0.0722 +0.1067 +0.103 +0.0821 +0.0641 +0.0423 +0.039 +0.0629 +0.0678 +0.0475 +0.057 +0.0517 +0.0711 +0.0728 +0.082 +0.0705 +0.0693 +0.0354 +0.0305 +0.0719 +0.0794 +0.0795 +0.0573 +0.0677 +0.0378 +0.0483 +0.0827 +0.0726 +0.0504 +0.079 +0.0954 +0.0815 +0.071 +0.067 +0.0972 +0.0423 +0.0529 +0.0634 +0.0326 +0.04 +0.0712 +0.0591 +0.0785 +0.0358 +0.0642 +0.0434 +0.0338 +0.0776 +0.0499 +0.0421 +0.0414 +0.0592 +0.0594 +0.0559 +0.0647 +0.029 +0.0501 +0.0602 +0.0543 +0.0488 +0.074 +0.034 +0.0567 +0.0589 +0.0699 +0.064 +0.0409 +0.0663 +0.0722 +0.064 +0.1028 +0.058 +0.0608 +0.0751 +0.0704 +0.0387 +0.0725 +0.0675 +0.0396 +0.0446 +0.0245 +0.0582 +0.0619 +0.051 +0.0596 +0.0637 +0.0686 +0.0578 +0.0951 +0.0749 +0.033 +0.0584 +0.0348 +0.0499 +0.0484 +0.0972 +0.1084 +0.1107 +0.0661 +0.073 +0.0901 +0.0501 +0.0878 +0.0525 +0.076 +0.0646 +0.0773 +0.0881 +0.0628 +0.1025 +0.1127 +0.0581 +0.0916 +0.0858 +0.0868 +0.1234 +0.0811 +0.0522 +0.0624 +0.0568 +0.1198 +0.105 +0.1004 +0.0877 +0.0575 +0.1017 +0.0767 +0.0887 +0.0587 +0.0793 +0.0697 +0.0882 +0.0907 +0.0946 +0.077 +0.0744 +0.0966 +0.076 +0.0354 +0.0779 +0.0686 +0.0926 +0.0898 +0.1199 +0.0632 +0.0912 +0.0736 +0.1014 +0.098 +0.0648 +0.0831 +0.0625 +0.1113 +0.1017 +0.1146 +0.1055 +0.0746 +0.0907 +0.0925 +0.1694 +0.0823 +0.0782 +0.0545 +0.0805 +0.1099 +0.1155 +0.1038 +0.0421 +0.0835 +0.0905 +0.1209 +0.1092 +0.0824 +0.0584 +0.0608 +0.0681 +0.0741 +0.0634 +0.0785 +0.1236 +0.0866 +0.0776 +0.0759 +0.0814 +0.0833 +0.0413 +0.0487 +0.1114 +0.074 +0.0905 +0.0893 +0.0519 +0.0838 +0.1004 +0.0864 +0.1133 +0.0886 +0.0901 +0.0694 +0.0901 +0.0998 +0.0797 +0.0847 +0.1201 +0.0615 +0.0656 +0.1266 +0.1007 +0.0955 +0.0511 +0.0826 +0.0693 +0.0685 +0.1515 +0.0655 +0.1055 +0.0727 +0.0809 +0.0998 +0.139 +0.0532 +0.0739 +0.1126 +0.1364 +0.0789 +0.101 +0.0866 +0.1181 +0.1094 +0.0966 +0.0613 +0.0636 +0.1289 +0.0995 +0.0813 +0.1515 +0.0972 +0.1173 +0.1266 +0.089 +0.1061 +0.1101 +0.1218 +0.1125 +0.1227 +0.113 +0.1263 +0.0578 +0.124 +0.0779 +0.0698 +0.1036 +0.0962 +0.0972 +0.1371 +0.0819 +0.1424 +0.1469 +0.1255 +0.0953 +0.1116 +0.096 +0.1208 +0.1163 +0.191 +0.1107 +0.1281 +0.1235 +0.1206 +0.1571 +0.1084 +0.0933 +0.1093 +0.1016 +0.1056 +0.0762 +0.0792 +0.1287 +0.0879 +0.1012 +0.0891 +0.105 +0.1143 +0.0853 +0.0805 +0.0821 +0.091 +0.1156 +0.1762 +0.1021 +0.1004 +0.1263 +0.0923 +0.1176 +0.1169 +0.1263 +0.1526 +0.2063 +0.1094 +0.1311 +0.1224 +0.19 +0.1229 +0.0918 +0.1145 +0.1675 +0.0923 +0.1179 +0.1415 +0.1301 +0.1456 +0.1443 +0.1555 +0.1051 +0.112 +0.0803 +0.1408 +0.1674 +0.1202 +0.1671 +0.1104 +0.1596 +0.1606 +0.1115 +0.185 +0.1496 +0.1573 +0.1228 +0.1017 +0.1238 +0.1138 +0.1174 +0.1429 +0.1604 +0.1286 +0.1269 +0.117 +0.1648 +0.11 +0.0936 +0.1252 +0.1158 +0.1363 +0.1192 +0.1564 +0.1659 +0.0866 +0.1234 +0.1441 +0.1549 +0.1362 +0.1102 +0.1421 +0.1678 +0.1118 +0.1146 +0.1343 +0.1301 +0.1011 +0.1823 +0.146 +0.1433 +0.1231 +0.1221 +0.1437 +0.1294 +0.1255 +0.1589 +0.0997 +0.1551 +0.1258 +0.1073 +0.131 +0.136 +0.1562 +0.1438 +0.1684 +0.1703 +0.1172 +0.1278 +0.1587 +0.1454 +0.2502 +0.1585 +0.1433 +0.1939 +0.1465 +0.1774 +0.1651 +0.2331 +0.1853 +0.1402 +0.1718 +0.1303 +0.1495 +0.1269 +0.1663 +0.1804 +0.2434 +0.1473 +0.1921 +0.1706 +0.1693 +0.1103 +0.1199 +0.1017 +0.1514 +0.1877 +0.1937 +0.1893 +0.1702 +0.2143 +0.2283 +0.2315 +0.1142 +0.1371 +0.1486 +0.1606 +0.1422 +0.2449 +0.1312 +0.1255 +0.1884 +0.1355 +0.2155 +0.1702 +0.1891 +0.1667 +0.1595 +0.1229 +0.156 +0.1516 +0.1883 +0.1425 +0.1702 +0.1368 +0.1613 +0.1708 +0.133 +0.1137 +0.1426 +0.1428 +0.146 +0.1712 +0.1291 +0.1806 +0.1393 +0.129 +0.1659 +0.1364 +0.1258 +0.1451 +0.188 +0.1495 +0.1251 +0.1955 +0.1553 +0.2071 +0.1557 +0.1533 +0.1341 +0.1565 +0.1308 +0.2062 +0.1284 +0.1162 +0.1312 +0.1397 +0.1607 +0.1403 +0.2012 +0.1944 +0.1398 +0.1114 +0.2279 +0.2039 +0.1746 +0.1646 +0.1905 +0.1928 +0.179 +0.2535 +0.1739 +0.1342 +0.1765 +0.1953 +0.2236 +0.167 +0.1562 +0.1491 +0.2115 +0.1774 +0.2054 +0.1837 +0.1796 +0.2151 +0.1979 +0.2116 +0.2192 +0.192 +0.2278 +0.2001 +0.2563 +0.1912 +0.2174 +0.2191 +0.2168 +0.1597 +0.1376 +0.1651 +0.1836 +0.2059 +0.1305 +0.1586 +0.1908 +0.1827 +0.1883 +0.2125 +0.2171 +0.164 +0.1983 +0.2403 +0.2206 +0.1958 +0.1706 +0.2473 +0.2015 +0.1581 +0.1908 +0.2192 +0.2896 +0.2545 +0.1967 +0.1643 +0.1846 +0.183 +0.201 +0.2145 +0.17 +0.1785 +0.1418 +0.2342 +0.237 +0.2261 +0.2521 +0.1714 +0.185 +0.2326 +0.225 +0.2167 +0.2032 +0.2879 +0.1751 +0.1834 +0.1914 +0.1887 +0.2251 +0.2016 +0.2209 +0.1873 +0.2692 +0.2183 +0.2082 +0.1809 +0.2293 +0.2262 +0.2202 +0.2152 +0.2536 +0.2442 +0.3825 +0.2664 +0.2277 +0.2192 +0.2455 +0.1534 +0.1547 +0.2054 +0.1748 +0.1844 +0.2099 +0.246 +0.1989 +0.2397 +0.2051 +0.1851 +0.3339 +0.19 +0.3349 +0.2158 +0.2426 +0.1891 +0.2486 +0.2328 +0.2353 +0.2586 +0.2783 +0.1974 +0.2128 +0.1494 +0.2046 +0.2105 +0.2317 +0.1946 +0.2395 +0.2304 +0.2216 +0.2267 +0.182 +0.1863 +0.2474 +0.1757 +0.2081 +0.2369 +0.2328 +0.2087 +0.2279 +0.1745 +0.1745 +0.168 +0.2489 +0.3041 +0.1817 +0.2142 +0.2136 +0.2668 +0.2303 +0.2441 +0.2334 +0.2373 +0.2365 +0.2096 +0.199 +0.1817 +0.2348 +0.3724 +0.2099 +0.3305 +0.3063 +0.1907 +0.1297 +0.2612 +0.185 +0.1893 +0.2286 +0.1886 +0.1741 +0.2299 +0.2107 +0.1837 +0.22 +0.1964 +0.2035 +0.195 +0.2165 +0.317 +0.2295 +0.2058 +0.2045 +0.2293 +0.2596 +0.2873 +0.3949 +0.2709 +0.2992 +0.2454 +0.2525 +0.1963 +0.2301 +0.2735 +0.1448 +0.2017 +0.2114 +0.3402 +0.2622 +0.257 +0.2141 +0.3416 +0.2514 +0.2063 +0.2068 +0.2411 +0.2481 +0.2748 +0.2097 +0.1769 +0.213 +0.2531 +0.3399 +0.2114 +0.1741 +0.3608 +0.2595 +0.2129 +0.2026 +0.2791 +0.3923 +0.2736 +0.2739 +0.2974 +0.2936 +0.2706 +0.2565 +0.2346 +0.3494 +0.3222 +0.316 +0.256 +0.3213 +0.3094 +0.3008 +0.2846 +0.223 +0.1944 +0.3038 +0.3075 +0.2477 +0.3725 +0.3159 +0.2407 +0.2855 +0.355 +0.3561 +0.2729 +0.2497 +0.2147 +0.3445 +0.2465 +0.237 +0.2802 +0.4251 +0.2764 +0.2885 +0.3291 +0.2509 +0.2526 +0.2104 +0.2625 +0.2605 +0.3001 +0.2353 +0.1882 +0.2352 +0.233 +0.3604 +0.3438 +0.3816 +0.2953 +0.4096 +0.4453 +0.3545 +0.2791 +0.3215 +0.3582 +0.3165 +0.2832 +0.3268 +0.2956 +0.233 +0.4115 +0.2559 +0.3055 +0.2407 +0.4052 +0.3081 +0.3109 +0.2946 +0.2055 +0.2276 +0.2574 +0.262 +0.2096 +0.1949 +0.4268 +0.3888 +0.2314 +0.2176 +0.2635 +0.4945 +0.275 +0.2142 +0.215 +0.4962 +0.2658 +0.3692 +0.2175 +0.2144 +0.2659 +0.392 +0.269 +0.4556 +0.2631 +0.3976 +0.206 +0.3458 +0.2753 +0.3061 +0.5305 +0.383 +0.3333 +0.4005 +0.3835 +0.2546 +0.3214 +0.3995 +0.3174 +0.3417 +0.2655 +0.4024 +0.3623 +0.3471 +0.323 +0.3178 +0.3838 +0.3689 +0.2826 +0.4032 +0.4184 +0.3008 +0.2677 +0.2952 +0.4304 +0.2814 +0.3265 +0.4046 +0.3735 +0.3982 +0.3849 +0.3772 +0.285 +0.2919 +0.5386 +0.3341 +0.2517 +0.3513 +0.3324 +0.3069 +0.3389 +0.4039 +0.3462 +0.3834 +0.3369 +0.3582 +0.3184 +0.3303 +0.3144 +0.5149 +0.334 +0.2345 +0.4414 +0.2834 +0.3183 +0.3406 +0.3606 +0.2516 +0.3645 +0.3422 +0.3843 +0.2712 +0.3439 +0.2205 +0.261 +0.35 +0.2873 +0.3923 +0.2437 +0.3979 +0.3217 +0.3672 +0.3512 +0.4098 +0.2953 +0.4178 +0.2812 +0.2768 +0.2705 +0.3987 +0.297 +0.3169 +0.3029 +0.3434 +0.3584 +0.2606 +0.3941 +0.5976 +0.3004 +0.242 +0.2621 +0.3839 +0.3487 +0.3627 +0.3603 +0.3469 +0.3268 +0.3947 +0.3415 +0.3474 +0.3926 +0.4104 +0.4281 +0.3367 +0.3126 +0.2975 +0.3191 +0.3085 +0.3141 +0.3719 +0.3386 +0.2989 +0.345 +0.2906 +0.4719 +0.5137 +0.3735 +0.479 +0.2743 +0.3422 +0.3122 +0.3753 +0.4102 +0.2796 +0.3068 +0.3452 +0.2825 +0.2521 +0.3378 +0.3169 +0.2555 +0.4341 +0.3855 +0.2625 +0.2347 +0.332 +0.336 +0.3089 +0.3382 +0.2977 +0.3854 +0.3486 +0.4122 +0.4985 +0.3225 +0.3816 +0.4254 +0.3102 +0.3521 +0.4159 +0.3338 +0.3731 +0.363 +0.3726 +0.3463 +0.3088 +0.3419 +0.3127 +0.3544 +0.4116 +0.3243 +0.3712 +0.3161 +0.7578 +0.3597 +0.4521 +0.4382 +0.4364 +0.4271 +0.4319 +0.5477 +0.407 +0.5028 +0.5233 +0.506 +0.7292 +0.4775 +0.3786 +0.3948 +0.4034 +0.397 +0.4482 +0.3448 +0.4 +0.4172 +0.3773 +0.3239 +0.378 +0.3685 +0.4118 +0.4189 +0.2966 +0.3305 +0.3929 +0.3582 +0.4537 +0.498 +0.4121 +0.28 +0.5949 +0.2929 +0.3407 +0.3226 +0.3548 +0.3405 +0.4428 +0.423 +0.5593 +0.5013 +0.5999 +0.4643 +0.4839 +0.3974 +0.318 +0.3698 +0.3809 +0.4896 +0.4516 +0.4558 +0.6247 +0.5194 +0.445 +0.421 +0.444 +0.5348 +0.451 +0.3977 +0.4136 +0.4262 +0.505 +0.6135 +0.5014 +0.3628 +0.3764 +0.5129 +0.5383 +0.3431 +0.4801 +0.6918 +0.5619 +0.8736 +0.4425 +0.4192 +0.5198 +0.499 +0.4163 +0.5225 +0.5733 +0.536 +0.463 +0.4119 +0.6297 +0.3849 +0.415 +0.4042 +0.3375 +0.4756 +0.4653 +0.4324 +0.5297 +0.6474 +0.6708 +0.5121 +0.6019 +0.432 +0.6021 +0.3995 +0.39 +0.6006 +0.5906 +0.4058 +0.496 +0.4043 +0.5384 +0.5077 +0.6121 +0.5026 +0.603 +0.5689 +0.4687 +0.3425 +0.4013 +0.3686 +0.4575 +0.3759 +0.4816 +0.5345 +0.3585 +0.5818 +0.395 +0.61 +0.7003 +0.4558 +0.6558 +0.5128 +0.4657 +0.4269 +0.378 +0.4797 +0.5866 +0.5424 +0.5726 +0.4407 +0.6187 +0.6722 +0.4974 +0.5763 +0.4132 +0.5569 +0.4977 +0.6013 +0.5545 +0.5177 +0.3972 +0.5198 +0.875 +1 diff --git a/pytorch_example/RUL/otherIdea/LSTM/__init__.py b/pytorch_example/RUL/otherIdea/LSTM/__init__.py new file mode 100644 index 0000000..baa7e9a --- /dev/null +++ b/pytorch_example/RUL/otherIdea/LSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:27 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/LSTM/loadData.py b/pytorch_example/RUL/otherIdea/LSTM/loadData.py new file mode 100644 index 0000000..f565413 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/LSTM/loadData.py @@ -0,0 +1,139 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + # HI_merge_data_origin = np.load("../../dataset/HI_merge_data.npy") + # HI_merge_data = HI_merge_data_origin[0:1250, 1] + # plt.plot(HI_merge_data[0:1250, 1]) + + + HI_merge_data = np.loadtxt("E:\self_example\pytorch_example\HealthyScorePredict\dataset\Healthy_score.csv", delimiter=",") + + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + # todo 解决模型保存时,query无法序列化的问题 + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset diff --git a/pytorch_example/RUL/otherIdea/LSTM/model.py b/pytorch_example/RUL/otherIdea/LSTM/model.py new file mode 100644 index 0000000..a83d7b3 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/LSTM/model.py @@ -0,0 +1,234 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM 2D基本实现 +''' + +import torch.nn as nn +import torch +from torch.autograd import Variable + + +class LSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C + B: bacth_size + T: timestamp + C: channel + """ + + super(LSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.bias = bias + + self.hidden = nn.Linear(in_features=self.input_dim + self.hidden_dim, + out_features=4 * self.hidden_dim, + bias=self.bias) + + def forward(self, input_tensor, cur_state): + # shape :b,c + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=-1) # concatenate along channel axis + + combined_linear = self.hidden(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_linear, self.hidden_dim, dim=1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size): + return (torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device), + torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device)) + + +class LSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C or T, B, C + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(LSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append(LSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + bias=self.bias)) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c, s) or (b, t, c, s) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2) + + b, _, _ = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +class PredictModel(nn.Module): + + def __init__(self, input_dim): + super(PredictModel, self).__init__() + + self.lstm = LSTM(input_dim=input_dim, hidden_dim=[512, 256], num_layers=2, batch_first=True, bias=True, + return_all_layers=False) + self.backbone = nn.Sequential( + nn.Linear(in_features=256, out_features=128), + nn.ReLU(), + nn.Linear(in_features=128, out_features=64), + nn.ReLU(), + nn.Dropout(0.2), + nn.BatchNorm1d(64), + nn.Linear(in_features=64, out_features=32), + nn.ReLU(), + nn.Dropout(0.2), + nn.BatchNorm1d(32), + nn.ReLU(), + nn.Linear(in_features=32, out_features=16), + nn.Linear(in_features=16, out_features=1) + ) + + def forward(self, input_tensor): + input_tensor = input_tensor.to(torch.float32) + layer_output_list, last_states = self.lstm(input_tensor) + last_timestamp = last_states[0][0] + predict = self.backbone(last_timestamp) + return predict + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + lstm = LSTM(input_dim=64, hidden_dim=16, num_layers=1, batch_first=True, bias=True, + return_all_layers=False) + layer_output_list, last_states = lstm(x) + + all = layer_output_list[0] + h = last_states[0][0] + print(all.size()) + print(h.size()) diff --git a/pytorch_example/RUL/otherIdea/LSTM/modelForEasy.py b/pytorch_example/RUL/otherIdea/LSTM/modelForEasy.py new file mode 100644 index 0000000..7a7c185 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/LSTM/modelForEasy.py @@ -0,0 +1,227 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM 2D基本实现 +''' + +import torch.nn as nn +import torch +from torch.autograd import Variable + + +class LSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C + B: bacth_size + T: timestamp + C: channel + """ + + super(LSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.bias = bias + + self.hidden = nn.Linear(in_features=self.input_dim + self.hidden_dim, + out_features=4 * self.hidden_dim, + bias=self.bias) + + def forward(self, input_tensor, cur_state): + # shape :b,c + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=-1) # concatenate along channel axis + + combined_linear = self.hidden(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_linear, self.hidden_dim, dim=1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size): + return (torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device), + torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device)) + + +class LSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C or T, B, C + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(LSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append(LSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + bias=self.bias)) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c, s) or (b, t, c, s) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2) + + b, _, _ = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +class PredictModel(nn.Module): + + def __init__(self, input_dim): + super(PredictModel, self).__init__() + + self.lstm = LSTM(input_dim=input_dim, hidden_dim=[64, 64], num_layers=2, batch_first=True, bias=True, + return_all_layers=False) + self.backbone = nn.Sequential( + nn.Linear(in_features=64, out_features=64), + nn.Linear(in_features=64, out_features=64), + nn.BatchNorm1d(64), + nn.ReLU(), + nn.Dropout(0.5), + nn.Linear(in_features=64, out_features=1) + ) + + def forward(self, input_tensor): + input_tensor = input_tensor.to(torch.float32) + layer_output_list, last_states = self.lstm(input_tensor) + last_timestamp = last_states[0][0] + predict = self.backbone(last_timestamp) + return predict + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + lstm = LSTM(input_dim=64, hidden_dim=16, num_layers=1, batch_first=True, bias=True, + return_all_layers=False) + layer_output_list, last_states = lstm(x) + + all = layer_output_list[0] + h = last_states[0][0] + print(all.size()) + print(h.size()) diff --git a/pytorch_example/RUL/otherIdea/LSTM/test.py b/pytorch_example/RUL/otherIdea/LSTM/test.py new file mode 100644 index 0000000..30fa4df --- /dev/null +++ b/pytorch_example/RUL/otherIdea/LSTM/test.py @@ -0,0 +1,118 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from RUL.otherIdea.LSTM.loadData import getDataset, getTotalData +from RUL.otherIdea.LSTM.modelForEasy import PredictModel +from torch.utils.data import DataLoader +import matplotlib.pyplot as plt +from RUL.baseModel.plot import plot_prediction, plot_forSelf +from RUL.baseModel.loss.Evaluate import getEvaluate + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model(each_predict_data).cpu().detach().numpy()[-1] # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + a = np.concatenate([each_predict_data[-1, -1, 1:], predicted_data], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.concatenate([each_predict_data[1:, :, :], np.expand_dims(b, axis=0)], axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, save_path, save_fig_name, is_single=True, is_norm=False): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + model = PredictModel(input_dim=feature).to(device) + + model.load_state_dict( + torch.load(save_path, map_location=device) + ) + + print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + # 衡量矩阵 + train_list = [] + easy_list = [] + val_label = [] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.float().to(device), label.float().to(device) + last_train_data = data + each_predicted_data = torch.squeeze(model(data)).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + train_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = torch.squeeze(model(data)).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + easy_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + val_label = np.concatenate( + [val_label, label.cpu().detach().numpy()], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predict_hard = predictOneByOne(model, last_train_data, predict_num=predict_num) + predicted_data_hard = np.concatenate([predicted_data_hard, + predict_hard], axis=0) + ####衡量 + train_evaluate = np.mean(train_list, axis=0) + easy_evaluate = np.mean(easy_list, axis=0) + hard_evaluate = getEvaluate(val_label, predict_hard) + print('train: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (train_evaluate[0], train_evaluate[1], train_evaluate[2], train_evaluate[3])) + print('easy: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (easy_evaluate[0], easy_evaluate[1], easy_evaluate[2], easy_evaluate[3])) + print('hard: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (hard_evaluate[0], hard_evaluate[1], hard_evaluate[2], hard_evaluate[3])) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name, predict_num=predict_num) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "E:\self_example\pytorch_example\RUL\otherIdea\LSTM\parameters\LSTM_hidden40_feature10_predict50_epoch66_trainLoss0.05624270847895079_valLoss0.4181802272796631.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/LSTM/train.py b/pytorch_example/RUL/otherIdea/LSTM/train.py new file mode 100644 index 0000000..9a7284a --- /dev/null +++ b/pytorch_example/RUL/otherIdea/LSTM/train.py @@ -0,0 +1,177 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 14:56 +@Usage : +@Desc : 训练LSTM +''' +import os +import time +import random +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F +import matplotlib.pyplot as plt +from torch.utils.data import DataLoader +from RUL.otherIdea.LSTM.modelForEasy import PredictModel +from RUL.otherIdea.LSTM.loadData import getDataset +from RUL.otherIdea.LSTM.test import test +from RUL.baseModel.CommonFunction import IsStopTraining +from scipy.spatial.distance import cdist +import math +import RUL.baseModel.utils.utils as utils + +''' +超参数设置: +''' +hidden_num = 10 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 32 +EPOCH = 1000 +seed = 5 +predict_num = 200 # 预测个数 +is_norm = True +is_single = True +model_name = "LSTM" +base_save = r"parameters/{0}_hidden{1}_feature{2}_predict{3}".format(model_name, hidden_num, feature, + predict_num) +save_fig_name = 'fig/seed{0}_hidden{1}_feature{2}_predict{3}'.format(seed, hidden_num, feature, predict_num) + +if not os.path.exists("parameters"): + os.makedirs("parameters") +if not os.path.exists("fig"): + os.makedirs("fig") + + +def get_dataset(): + '''得到数据集''' + train_dataset, val_dataset = getDataset( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_single=is_single, is_norm=is_norm) + '''DataLoader''' + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=True, drop_last=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False, drop_last=False) + return train_loader, val_loader + + +def train(device, lr, lr_patience, early_stop_patience, epochs): + '''预测模型''' + global best_save_path + model = PredictModel(input_dim=feature) + '''得到数据集''' + train_loader, val_loader = get_dataset() + criterion = nn.MSELoss().to(device) + + optimizer_model = torch.optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer_model, mode="min", factor=0.5, + patience=lr_patience) + + def zero_grad_all(): + optimizer_model.zero_grad() + + train_loss_list = [] + val_loss_list = [] + best_save_path = None + + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss = 0.0 + val_loss = 0.0 + + model.train() + + for (train_batch_idx, (train_data, train_label)) in enumerate(train_loader): + + train_data, train_label = train_data.float().to(device), train_label.float().to(device) + + zero_grad_all() + + predict_data = torch.squeeze(model(train_data)) + + # MSE损失 + loss = criterion(predict_data, train_label) + + loss.backward() + optimizer_model.step() + + zero_grad_all() + + train_loss += loss.item() + + model.eval() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_label) in enumerate(val_loader): + val_data, val_label = val_data.float().to(device), val_label.float().to(device) + val_predict_data = torch.squeeze(model(val_data)) + + loss = criterion(val_predict_data, val_label) + val_loss += loss.item() + + scheduler_model.step(val_loss) + + train_loss = train_loss / len(train_loader) + val_loss = val_loss / len(val_loader) + print( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_loss: {:3.9f} | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss, + val_loss, + optimizer_model.state_dict()['param_groups'][0]['lr'])) + + # 保存在验证集上loss最小的模型 + # if val_loss_list.__len__() > 0 and (val_loss / val_dataset.__len__()) < min(val_loss_list): + # 如果精度大于最高精度,则保存 + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + print("保存模型最佳模型成功") + # 保存模型参数 + # 保存模型参数 + if best_save_path != None: + utils.delete_file(best_save_path) + best_save_path = base_save + "_epoch" + str(epoch) + \ + "_trainLoss" + str(train_loss) + \ + "_valLoss" + str(val_loss) + ".pkl" + torch.save(model.state_dict(), + best_save_path) + + train_loss_list.append(train_loss) + + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + break + + '''保存的模型参数的路径''' + return best_save_path + + +if __name__ == '__main__': + + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + '''训练''' + save_path = train(device, lr=0.01, lr_patience=10, early_stop_patience=20, epochs=1000) + + end = time.time() + + '''测试''' + # test1(5, src_condition, tar_condition, G_params_path, LC_params_path) + + test(hidden_num, feature, predict_num=predict_num, + batch_size=batch_size, save_path=save_path, + is_single=is_single, is_norm=is_norm, save_fig_name=save_fig_name) + + print("训练耗时:{:3.2f}s".format(end - begin)) diff --git a/pytorch_example/RUL/otherIdea/__init__.py b/pytorch_example/RUL/otherIdea/__init__.py new file mode 100644 index 0000000..c4388ef --- /dev/null +++ b/pytorch_example/RUL/otherIdea/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 21:33 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/__init__.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/__init__.py new file mode 100644 index 0000000..392eed6 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/20 14:11 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/__init__.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/__init__.py new file mode 100644 index 0000000..3e48d01 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/16 19:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/data_process.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/data_process.py new file mode 100644 index 0000000..c16991a --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/data_process.py @@ -0,0 +1,111 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:35 +@Usage : +@Desc : +''' +# encoding=utf-8 + +import RUL.otherIdea.adaRNN.dataset_vibrate.data_vibrate as data_vibrate +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +from RUL.otherIdea.adaRNN.dataset_vibrate.loadData import getVibrate_data + +import torch +import math + + +def get_split_time(num_domain=2, mode='pre_process', data=None, dis_type='coral'): + spilt_time = { + '2': [(0, 600), (600, 1200)] + } + if mode == 'pre_process': + return spilt_time[str(num_domain)] + if mode == 'tdc': + return TDC(num_domain, data, dis_type=dis_type) + else: + print("error in mode") + + +def TDC(num_domain, data, dis_type='coral'): + # 样本个数 + num_day = len(data[0]) + + split_N = 10 + feat = data[0][0:num_day] + feat = torch.tensor(feat, dtype=torch.float32) + feat_shape_1 = feat.shape[1] # 时间部 + + feat = feat.reshape(-1, feat.shape[2]) + feat = feat + + selected = [0, 10] + candidate = [1, 2, 3, 4, 5, 6, 7, 8, 9] + start = 0 + + if num_domain in [2, 3, 5, 7, 10]: + while len(selected) - 2 < num_domain - 1: + distance_list = [] + for can in candidate: + selected.append(can) + selected.sort() + dis_temp = 0 + for i in range(1, len(selected) - 1): + for j in range(i, len(selected) - 1): + index_part1_start = start + math.floor(selected[i - 1] / split_N * num_day) * feat_shape_1 + index_part1_end = start + math.floor(selected[i] / split_N * num_day) * feat_shape_1 + feat_part1 = feat[index_part1_start: index_part1_end] + + index_part2_start = start + math.floor(selected[j] / split_N * num_day) * feat_shape_1 + index_part2_end = start + math.floor(selected[j + 1] / split_N * num_day) * feat_shape_1 + feat_part2 = feat[index_part2_start:index_part2_end] + criterion_transder = TransferLoss(loss_type=dis_type, input_dim=feat_part1.shape[1]) + dis_temp += criterion_transder.compute(feat_part1, feat_part2) + distance_list.append(dis_temp) + selected.remove(can) + can_index = distance_list.index(max(distance_list)) + selected.append(candidate[can_index]) + candidate.remove(candidate[can_index]) + selected.sort() + res = [] + for i in range(1, len(selected)): + if i == 1: + sel_start_index = int(num_day / split_N * selected[i - 1]) + else: + sel_start_index = int(num_day / split_N * selected[i - 1]) + 1 + + sel_end_index = int(num_day / split_N * selected[i]) + + res.append((sel_start_index, sel_end_index)) + return res + else: + print("error in number of domain") + + +def load_weather_data_multi_domain(hidden_num, feature, predict_num, batch_size=6, number_domain=2, mode='pre_process', + dis_type='coral', is_norm=False): + # mode: 'tdc', 'pre_process' + train_data, val_data = getVibrate_data(hidden_num=hidden_num, feature=feature, predict_num=predict_num, + is_norm=is_norm) + + split_time_list = get_split_time(number_domain, mode=mode, data=train_data, dis_type=dis_type) + train_list = [] + for i in range(len(split_time_list)): + index_temp = split_time_list[i] + train_loader = data_vibrate.get_vibrate_data(train_data, start_index=index_temp[0], + end_index=index_temp[1], batch_size=batch_size) + train_list.append(train_loader) + + valid_loader = data_vibrate.get_vibrate_data(val_data, start_index=0, + end_index=len(val_data), batch_size=batch_size, mean=None, + std=None, shuffle=False) + test_loader = valid_loader + + return train_list, valid_loader, test_loader + + +if __name__ == '__main__': + load_weather_data_multi_domain(hidden_num=10, feature=10, predict_num=50, batch_size=32, number_domain=2, + mode='tdc', + dis_type='coral', is_norm=False) diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/data_vibrate.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/data_vibrate.py new file mode 100644 index 0000000..f6a843c --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/data_vibrate.py @@ -0,0 +1,78 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' + +import math +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import os +from pandas.core.frame import DataFrame +from torch.utils.data import Dataset, DataLoader +import torch +import pickle +import datetime + + +class data_loader(Dataset): + def __init__(self, df_feature, df_label, df_label_reg, t=None): + + assert len(df_feature) == len(df_label) + assert len(df_feature) == len(df_label_reg) + + # df_feature = df_feature.reshape(df_feature.shape[0], df_feature.shape[1] // 6, df_feature.shape[2] * 6) + self.df_feature = df_feature + self.df_label = df_label + self.df_label_reg = df_label_reg + + self.T = t + self.df_feature = torch.tensor( + self.df_feature, dtype=torch.float32) + self.df_label = torch.tensor( + self.df_label, dtype=torch.float32) + self.df_label_reg = torch.tensor( + self.df_label_reg, dtype=torch.float32) + + def __getitem__(self, index): + sample, target, label_reg = self.df_feature[index], self.df_label[index], self.df_label_reg[index] + if self.T: + return self.T(sample), target, label_reg + else: + return sample, target, label_reg + + def __len__(self): + return len(self.df_feature) + + +def create_dataset(data, start_index, end_index, mean=None, std=None): + feat, label_continue, label_single = data[0], data[1], data[2] + referece_start_index = 0 + referece_end_index = 1250 + + assert start_index - referece_start_index >= 0 + assert end_index - referece_end_index <= 0 + assert end_index - start_index >= 0 + + feat = feat[start_index: end_index + 1] + label = label_continue[start_index: end_index + 1] + label_reg = label_single[start_index: end_index + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return data_loader(feat, label, label_reg) + + +def get_vibrate_data(data, start_index, end_index, batch_size, shuffle=True, mean=None, std=None): + dataset = create_dataset(data, start_index, + end_index, mean=mean, std=std) + train_loader = DataLoader( + dataset, batch_size=batch_size, shuffle=shuffle) + return train_loader diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/loadData.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/loadData.py new file mode 100644 index 0000000..ed8c90d --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/dataset_vibrate/loadData.py @@ -0,0 +1,150 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + # HI_merge_data_origin = np.load("E:\self_example\pytorch_example\RUL\dataset\HI_merge_data1.npy") + # + # # plt.plot(HI_merge_data[0:1250, 1]) + # # 去除掉退化特征不明显前面的点 + # HI_merge_data = HI_merge_data_origin[0:1250, 1] + HI_merge_data = np.loadtxt("E:\self_example\pytorch_example\RUL\dataset\smallVHI.csv", delimiter=",") + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset + + +def getVibrate_data(hidden_num, feature, predict_num, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + + + + return [train_data,train_label,train_label_single],[val_data,val_label,val_label_single] diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/loss_transfer.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/loss_transfer.py new file mode 100644 index 0000000..7e2798d --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/loss_transfer.py @@ -0,0 +1,64 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:45 +@Usage : +@Desc : +''' +from RUL.baseModel.loss import adv_loss, coral, kl_js, mmd, mutual_info, cos, pair_dist + + +class TransferLoss(object): + def __init__(self, loss_type='cosine', input_dim=512): + """ + Supported loss_type: mmd(mmd_lin), mmd_rbf, coral, cosine, kl, js, mine, adv + """ + self.loss_type = loss_type + self.input_dim = input_dim + + def compute(self, X, Y): + """Compute adaptation loss + + Arguments: + X {tensor} -- source matrix + Y {tensor} -- target matrix + + Returns: + [tensor] -- transfer loss + """ + if self.loss_type == 'mmd_lin' or self.loss_type == 'mmd': + mmdloss = mmd.MMD_loss(kernel_type='linear') + loss = mmdloss(X, Y) + elif self.loss_type == 'coral': + loss = coral.CORAL(X, Y) + elif self.loss_type == 'cosine' or self.loss_type == 'cos': + loss = 1 - cos.cosine(X, Y) + elif self.loss_type == 'kl': + loss = kl_js.kl_div(X, Y) + elif self.loss_type == 'js': + loss = kl_js.js(X, Y) + elif self.loss_type == 'mine': + mine_model = mutual_info.Mine_estimator( + input_dim=self.input_dim, hidden_dim=60) + loss = mine_model(X, Y) + elif self.loss_type == 'adv': + loss = adv_loss.adv(X, Y, input_dim=self.input_dim, hidden_dim=32) + elif self.loss_type == 'mmd_rbf': + mmdloss = mmd.MMD_loss(kernel_type='rbf') + loss = mmdloss(X, Y) + elif self.loss_type == 'pairwise': + pair_mat = pair_dist.pairwise_dist(X, Y) + import torch + loss = torch.norm(pair_mat) + + return loss + + +if __name__ == "__main__": + import torch + + trans_loss = TransferLoss('adv') + a = (torch.randn(5, 512) * 10) + b = (torch.randn(5, 512) * 10) + print(trans_loss.compute(a, b)) diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/model.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/model.py new file mode 100644 index 0000000..990b223 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/model.py @@ -0,0 +1,411 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:44 +@Usage : +@Desc : +''' +import torch +import torch.nn as nn +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +import torch.nn.functional as F +from RUL.baseModel.dctChannelAttention import dct_channel_block + +import torch.nn as nn +import torch +from RUL.baseModel.dctAttention import dct_channel_block + + +class dctLSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C + B: bacth_size + T: timestamp + C: channel + """ + + super(dctLSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.bias = bias + + self.hidden = nn.Linear(in_features=self.input_dim + self.hidden_dim, + out_features=4 * self.hidden_dim, + bias=self.bias) + self.attention = dct_channel_block(channel=self.input_dim + self.hidden_dim) + + def forward(self, input_tensor, cur_state): + # shape :b,c + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=-1) # concatenate along channel axis + # 增加一个channelAttention + combined = self.attention(combined) + combined_linear = self.hidden(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_linear, self.hidden_dim, dim=-1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size): + return (torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device), + torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device)) + + +class LSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C or T, B, C + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(LSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append( + dctLSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + bias=self.bias), + ) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c) or (b, t, c) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2) + + b, _, _ = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + + # TODO 每层之间增加一个dct_attention + # layer_output = self.attention_list[layer_idx](layer_output) + + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +class AdaRNN(nn.Module): + """ + model_type: 'Boosting', 'AdaRNN' + bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + """ + + def __init__(self, use_bottleneck=False, bottleneck_list=[(64, False, False, 0), (64, True, True, 0.5)], + n_input=128, n_hiddens=[64, 64], n_output=6, + dropout=0.0, len_seq=9, model_type='AdaRNN', + trans_loss='mmd'): + super(AdaRNN, self).__init__() + self.use_bottleneck = use_bottleneck + self.n_input = n_input + self.num_layers = len(n_hiddens) + self.hiddens = n_hiddens + self.n_output = n_output + self.model_type = model_type + self.trans_loss = trans_loss + self.len_seq = len_seq + in_size = self.n_input + + features = nn.ModuleList() + # dctAttention = nn.ModuleList() + for hidden in n_hiddens: + # rnn = nn.GRU( + # input_size=in_size, + # num_layers=1, + # hidden_size=hidden, + # batch_first=True, + # dropout=dropout + # ) + rnn = LSTM(input_dim=in_size, hidden_dim=[hidden], num_layers=1, batch_first=True, return_all_layers=True) + # attention = dct_channel_block(channel=hidden) + features.append(rnn) + # dctAttention.append(attention) + in_size = hidden + self.features = nn.Sequential(*features) + # self.dctAttention = nn.Sequential(*dctAttention) + + if use_bottleneck == True: # finance + bottleneck = [] + for i in range(len(bottleneck_list)): + cur_input_dim = self.hiddens[-1] if i == 0 else bottleneck_list[i - 1][0] + bottleneck.append( + nn.Linear(cur_input_dim, bottleneck_list[i][0]) + ) + ### 不加初始权重会让Hard predict更不稳定,振幅更大 + # 初始权重越大,振幅越大 + bottleneck[-1].weight.data.normal_(0, 0.03) + bottleneck[-1].bias.data.fill_(0.01) + if bottleneck_list[i][1]: + bottleneck.append(nn.BatchNorm1d(bottleneck_list[i][0])) + if bottleneck_list[i][2]: + bottleneck.append(nn.ReLU()) + if bottleneck_list[i][3] != 0: + bottleneck.append(nn.Dropout(bottleneck_list[i][3])) + self.bottleneck = nn.Sequential(*bottleneck) + self.fc = nn.Linear(bottleneck_list[-1][0], n_output) + + torch.nn.init.xavier_normal_(self.fc.weight) + else: + self.fc_out = nn.Linear(n_hiddens[-1], self.n_output) + + if self.model_type == 'AdaRNN': + gate = nn.ModuleList() + for i in range(len(n_hiddens)): + gate_weight = nn.Linear( + len_seq * self.hiddens[i] * 2, len_seq) + gate.append(gate_weight) + self.gate = gate + + bnlst = nn.ModuleList() + for i in range(len(n_hiddens)): + bnlst.append(nn.BatchNorm1d(len_seq)) + self.bn_lst = bnlst + self.softmax = torch.nn.Softmax(dim=0) + self.init_layers() + + def init_layers(self): + for i in range(len(self.hiddens)): + self.gate[i].weight.data.normal_(0, 0.05) + self.gate[i].bias.data.fill_(0.0) + + def forward_pre_train(self, x, len_win=0): + out = self.gru_features(x) + # 两层GRU之后的结果 + fea = out[0] + + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + # 每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out_list_all, out_weight_list = out[1], out[2] + # 可以理解为前半段 和 后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = max(j - len_win, 0) + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] if self.model_type == 'AdaRNN' else 1 / ( + self.len_seq - h_start) * (2 * len_win + 1) + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def gru_features(self, x, predict=False): + x_input = x + out = None + out_lis = [] + out_weight_list = [] if ( + self.model_type == 'AdaRNN') else None + for i in range(self.num_layers): + # GRU的输出 + out, _ = self.features[i](x_input.float()) + out = out[0] + # out = self.dctAttention[i](out.float()) + x_input = out + out_lis.append(out) + if self.model_type == 'AdaRNN' and predict == False: + out_gate = self.process_gate_weight(x_input, i) + out_weight_list.append(out_gate) + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + return out, out_lis, out_weight_list + + def process_gate_weight(self, out, index): + x_s = out[0: int(out.shape[0] // 2)] # 可以理解为前一半个batch_size的分布 域Di + x_t = out[out.shape[0] // 2: out.shape[0]] # 可以理解为后一半个batch_size的分布 域Dj + # 对应着不同的域 + x_all = torch.cat((x_s, x_t), 2) + x_all = x_all.view(x_all.shape[0], -1) + weight = torch.sigmoid(self.bn_lst[index]( + self.gate[index](x_all.float()))) + weight = torch.mean(weight, dim=0) + res = self.softmax(weight).squeeze() + return res + + def get_features(self, output_list): + fea_list_src, fea_list_tar = [], [] + for fea in output_list: + fea_list_src.append(fea[0: fea.size(0) // 2]) + fea_list_tar.append(fea[fea.size(0) // 2:]) + return fea_list_src, fea_list_tar + + # For Boosting-based + def forward_Boosting(self, x, weight_mat=None): + out = self.gru_features(x) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + out_list_all = out[1] + # 可以理解为前半段和后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + if weight_mat is None: + weight = (1.0 / self.len_seq * + torch.ones(self.num_layers, self.len_seq)) + else: + weight = weight_mat + dist_mat = torch.zeros(self.num_layers, self.len_seq) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + for j in range(self.len_seq): + loss_trans = criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, j, :]) + loss_transfer = loss_transfer + weight[i, j] * loss_trans + dist_mat[i, j] = loss_trans + return fc_out, loss_transfer, dist_mat, weight + + # For Boosting-based + def update_weight_Boosting(self, weight_mat, dist_old, dist_new): + epsilon = 1e-12 + dist_old = dist_old.detach() + dist_new = dist_new.detach() + ind = dist_new > dist_old + epsilon + weight_mat[ind] = weight_mat[ind] * \ + (1 + torch.sigmoid(dist_new[ind] - dist_old[ind])) + weight_norm = torch.norm(weight_mat, dim=1, p=1) + weight_mat = weight_mat / weight_norm.t().unsqueeze(1).repeat(1, self.len_seq) + return weight_mat + + def predict(self, x): + out = self.gru_features(x, predict=True) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + return fc_out diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/test.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/test.py new file mode 100644 index 0000000..55ba30a --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/test.py @@ -0,0 +1,94 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from RUL.otherIdea.LSTM.loadData import getDataset, getTotalData +from RUL.otherIdea.dctLSTM.model import PredictModel +from torch.utils.data import DataLoader +import matplotlib.pyplot as plt + +from RUL.baseModel.plot import plot_prediction, plot_forSelf + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data[-1].unsqueeze(0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model.predict(each_predict_data).cpu().detach().numpy() # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + c = each_predict_data[-1, -1, 1:] + a = np.concatenate([each_predict_data[-1, -1, 1:], np.expand_dims(predicted_data, axis=0)], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.expand_dims(b, axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, model, is_single=True, is_norm=False, save_fig_name=""): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predicted_data_hard = np.concatenate([predicted_data_hard, + predictOneByOne(model, last_train_data, predict_num=predict_num)], axis=0) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name, predict_num=predict_num) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\outputs\AdaRNN_tdcLoss(cos)_transferLoss(cos)_dw0.5_lr0.0005\parameters\AdaRNN_hidden24_feature10_predict50_dimList64-64_epoch62_trainLoss0.5115623474121094_valLoss0.12946119904518127.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/train.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/train.py new file mode 100644 index 0000000..6eee8a6 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/train.py @@ -0,0 +1,476 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:32 +@Usage : +@Desc : +''' +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np +import random +from tqdm import tqdm +from RUL.otherIdea.adaDctEmdLSTM.utils import utils +from RUL.otherIdea.adaDctEmdLSTM.model import AdaRNN + +import RUL.otherIdea.adaDctEmdLSTM.dataset_vibrate.data_process as data_process +from RUL.baseModel.loss.ffd import fft_mse, dct_mse +from RUL.otherIdea.adaDctEmdLSTM.test import test +import matplotlib.pyplot as plt +import time +from RUL.baseModel.CommonFunction import IsStopTraining + +''' +超参数设置: +''' +# 数据准备 +is_norm = False +is_single = True +tdc_loss_type = 'cos' +num_domain = 2 # 划分为几个源域和目标域 + +# RNN相关 +hidden_num = 10 # LSTM细胞个数 +feature = 2 # 一个点的维度 +predict_num = 50 # 预测个数 +batch_size = 32 +model_name = "AdaRNN" +hidden_list = [64, 64] # 每层RNN的隐藏层的维度 +### bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) +bottleneck = [(64, False, False, 0), (64, True, True, 0.5)] +# bottleneck = [(128, False, True, 0), +# (64, True, True, 0.2), +# (32, True, True, 0.2), +# (16, False, False, 0)] + +# 训练相关 +pre_epoch = 40 +epochs = 1000 +transfer_loss_type = 'cos' # 目前测试cos最好 +dw = 0.5 +fft_dw = 0.1 +lr = 0.01 +len_win = 0 # 窗口大小,为0,暂时不知道有什么用 +seed = 125 + +# 相关初始化工作 +out_dir = './outputs' +output_path = out_dir + '/{0}_tdc({1})_transfer({2})_domain{3}_dw{4}_fdw{5}_lr{6}_Norm{7}'.format(model_name, + tdc_loss_type, + transfer_loss_type, + num_domain, + dw, fft_dw, lr, + is_norm) +save_model_name = 'parameters/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[ + 0]) + "-" + str( + hidden_list[1])) +save_fig_name = 'fig/{0}_hidden{1}_feature{2}_predict{3}_dimList{4}.png'.format(model_name, hidden_num, + feature, + predict_num, + str(hidden_list[0]) + "-" + str( + hidden_list[1])) +utils.dir_exist(output_path) +utils.dir_exist(os.path.join(output_path, 'parameters')) +utils.dir_exist(os.path.join(output_path, 'fig')) +log_file = os.path.join(output_path, 'run.log') + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if log_file is None: + return + with open(log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + # 经过测试,整体来说,如果加了bottleneck,整体更愿意振动,而不加整体仅存在趋势 + # bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + + return AdaRNN(use_bottleneck=True, bottleneck_list=bottleneck, n_input=feature, n_hiddens=hidden_list, + n_output=1, dropout=0.0, model_type=name, len_seq=hidden_num, + trans_loss=transfer_loss_type) + + +def train_AdaRNN(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(len(hidden_list), hidden_num) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + + # 如果训练集域之间的batch_size对不齐就没法计算, + # 为了不抛弃所有样本,这里将选择最小的域batch_size作为本轮的batch_size + min_batch_size = 10000 + for data in data_all: + min_batch_size = min(min_batch_size, data[0].shape[0]) + + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].float(), data[2].float() + list_feat.append(feature[:min_batch_size]) + list_label.append(label_reg[:min_batch_size]) + + index = get_index(len(data_all) - 1) + + loss_mse = torch.zeros(1) + loss_fft = torch.zeros(1) + loss_transfer = torch.zeros(1) + total_loss_l1 = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + # 在batch_size处合并 + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < pre_epoch: + pred_all, each_loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=len_win) + else: + pred_all, each_loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + + lossf_s = dct_mse(pred_s, label_reg_s) + lossf_t = dct_mse(pred_t, label_reg_t) + + loss_l1 = criterion_1(pred_s, label_reg_s) + + loss_mse += loss_s + loss_t + loss_fft += (lossf_s + lossf_t) * fft_dw + loss_transfer += dw * each_loss_transfer + total_loss_l1 += loss_l1 + + total_loss = loss_mse + loss_transfer + loss_all.append([total_loss.item(), loss_mse.item(), loss_transfer.item(), loss_fft.item()]) + loss_1_all.append(total_loss_l1.item()) + + # 反向传播 + total_loss.backward() + # 梯度裁剪,梯度最大范数为3 + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + + if epoch >= pre_epoch: + if epoch > pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def val_epoch(model, val_loader, device, scheduler): + model.eval() + val_loss = 0 + val_loss_1 = 0 + val_loss_r = 0 + + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_continue, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = model.predict(val_data) + + loss = criterion(val_predict_data, val_label) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(val_predict_data, val_label) + val_loss += loss.item() + val_loss_1 += loss_1.item() + val_loss_r += loss_r.item() + + scheduler.step(val_loss) + + loss = val_loss / len(val_loader) + loss_1 = val_loss_1 / len(val_loader) + loss_r = val_loss_r / len(val_loader) + + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(len(hidden_list), hidden_num) + for i in range(weight.shape[0]): + for j in range(weight.shape[1]): + weight[i, j] = init_weight[i][j].item() + return weight + + +def loadData(): + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_norm=is_norm, batch_size=batch_size, + number_domain=num_domain, mode='tdc', dis_type=tdc_loss_type + ) + return train_loader_list, valid_loader, test_loader + pass + + +def train(model, train_loader_list, valid_loader, lr_patience, early_stop_patience, device): + optimizer = optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode="min", factor=0.5, + patience=lr_patience) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + train_loss_list = [] + val_loss_list = [] + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss, loss1, weight_mat, dist_mat = train_AdaRNN( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + + val_loss, val_loss_l1, val_loss_r = val_epoch( + model, valid_loader, device=device, scheduler=scheduler_model) + + pprint( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_total_loss: {:3.9f} | train_mse_loss: {:3.9f} | train_transfer_loss: {:3.9f} | train_transfer_loss: {:3.9f} " + " | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss[0], train_loss[1], train_loss[3], train_loss[2], + val_loss, + optimizer.state_dict()['param_groups'][0]['lr'])) + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + pprint("保存模型最佳模型成功") + best_epoch = epoch + best_score = val_loss + # 保存模型参数 + best_save_path = save_model_name + "_epoch" + str(epoch) + \ + "_trainLoss" + str('%.5f' % train_loss[1]) + \ + "_valLoss" + str('%.5f' % val_loss) + ".pkl" + print(os.path.join(output_path, best_save_path)) + torch.save(model.state_dict(), + os.path.join(output_path, best_save_path)) + + train_loss_list.append(train_loss) + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + pprint("{0}次loss未下降,训练停止".format(early_stop_patience)) + break + + pprint('best val score:', best_score, '@', best_epoch) + return best_save_path + pass + + +def main_transfer(): + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + pprint('create DataLoaders...') + train_loader_list, valid_loader, test_loader = loadData() + + pprint('create AdaRNN model...') + model = get_model(model_name) + + num_model = count_parameters(model) + + print(model) + print('#model params:', num_model) + + pprint('train model...') + best_save_path = train(model=model, train_loader_list=train_loader_list, valid_loader=valid_loader, lr_patience=20, + early_stop_patience=50, device=device) + + end = time.time() + + print("训练耗时:{:3.2f}s".format(end - begin)) + + pprint('验证模型...') + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, best_save_path), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load(os.path.join(output_path, best_save_path), map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm, save_fig_name=os.path.join(output_path, save_fig_name)) + + +def after_test(save_name): + model = get_model(model_name) + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load( + save_name + , map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm) + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=feature) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='cos') + + parser.add_argument('--data_mode', type=str, default='tdc') + + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=hidden_num) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\dataset/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + # 训练与测试 + main_transfer() + + '''事后测试''' + # after_test(save_name="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\outputs\AdaRNN_tdcLoss(cos)_transferLoss(cos)_domain2_dw0.5_lr0.0005\parameters\AdaRNN_hidden24_feature10_predict50_dimList64-64_epoch62_trainLoss0.5115623474121094_valLoss0.12946119904518127.pkl") diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/utils/__init__.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/utils/__init__.py new file mode 100644 index 0000000..4e22673 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/utils/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/utils/utils.py b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/utils/utils.py new file mode 100644 index 0000000..08b396e --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctEmdLSTM/utils/utils.py @@ -0,0 +1,225 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' + +import collections +import torch +import os +import pandas as pd +import torch.nn as nn +from tqdm import tqdm +import numpy as np + +EPS = 1e-12 + + +class AverageMeter(object): + def __init__(self): + self.reset() + + def reset(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + self.list = [] + + def update(self, val, n=1): + self.val = val + self.list.append(val) + self.sum += val * n + self.count += n + self.avg = self.sum / self.count + + +def average_params(params_list): + assert isinstance(params_list, (tuple, list, collections.deque)) + n = len(params_list) + if n == 1: + return params_list[0] + new_params = collections.OrderedDict() + keys = None + for i, params in enumerate(params_list): + if keys is None: + keys = params.keys() + for k, v in params.items(): + if k not in keys: + raise ValueError('the %d-th model has different params' % i) + if k not in new_params: + new_params[k] = v / n + else: + new_params[k] += v / n + return new_params + + +def zscore(x): + return (x - x.mean(dim=0, keepdim=True)) / x.std(dim=0, keepdim=True, unbiased=False) + + +def calc_loss(pred, label): + return torch.mean((zscore(pred) - label) ** 2) + + +def calc_corr(pred, label): + return (zscore(pred) * zscore(label)).mean() + + +def test_ic(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = label_actual.clone().detach().view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_daily(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values + avg), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for slc in tqdm(data_list[i].iter_daily(), total=data_list[i].daily_length): + feature, label_actual, _, _ = data_list[i].get(slc) + # for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = torch.tensor(label_actual, dtype=torch.float32, device=device).view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_uni(model, data_loader, model_path=None, ic_type='spearman', verbose=False): + if model_path: + model.load_state_dict(torch.load(model_path)) + model.eval() + loss_all = [] + ic_all = [] + for slc in tqdm(data_loader.iter_daily(), total=data_loader.daily_length): + data, label, _, _ = data_loader.get(slc) + with torch.no_grad(): + pred = model.predict(data) + mask = ~torch.isnan(label) + pred = pred[mask] + label = label[mask] + loss = torch.mean(torch.log(torch.cosh(pred - label))) + if ic_type == 'spearman': + ic = spearman_corr(pred, label) + elif ic_type == 'pearson': + ic = pearson_corr(pred, label) + loss_all.append(loss.item()) + ic_all.append(ic) + loss, ic = np.mean(loss_all), np.mean(ic_all) + if verbose: + print('IC: ', ic) + return loss, ic + + +def calc_ic(x, y, ic_type='pearson'): + ic = -100 + if ic_type == 'pearson': + ic = pearson_corr(x, y) + elif ic_type == 'spearman': + ic = spearman_corr(x, y) + return ic + + +def create_dir(path): + if not os.path.exists(path): + os.makedirs(path) + + +def handle_nan(x): + mask = ~torch.isnan(x) + return x[mask], mask + + +class Log_Loss(nn.Module): + def __init__(self): + super(Log_Loss, self).__init__() + + def forward(self, ytrue, ypred): + delta = ypred - ytrue + return torch.mean(torch.log(torch.cosh(delta))) + + +def spearman_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='spearman') + return spearman + + +def spearman_corr2(x, y): + X = pd.Series(x) + Y = pd.Series(y) + spearman = X.corr(Y, method='spearman') + return spearman + + +def pearson_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='pearson') + return spearman + + +def dir_exist(dirs): + if not os.path.exists(dirs): + os.makedirs(dirs) \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/__init__.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/__init__.py new file mode 100644 index 0000000..392eed6 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/20 14:11 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/__init__.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/__init__.py new file mode 100644 index 0000000..3e48d01 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/16 19:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/data_process.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/data_process.py new file mode 100644 index 0000000..c16991a --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/data_process.py @@ -0,0 +1,111 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:35 +@Usage : +@Desc : +''' +# encoding=utf-8 + +import RUL.otherIdea.adaRNN.dataset_vibrate.data_vibrate as data_vibrate +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +from RUL.otherIdea.adaRNN.dataset_vibrate.loadData import getVibrate_data + +import torch +import math + + +def get_split_time(num_domain=2, mode='pre_process', data=None, dis_type='coral'): + spilt_time = { + '2': [(0, 600), (600, 1200)] + } + if mode == 'pre_process': + return spilt_time[str(num_domain)] + if mode == 'tdc': + return TDC(num_domain, data, dis_type=dis_type) + else: + print("error in mode") + + +def TDC(num_domain, data, dis_type='coral'): + # 样本个数 + num_day = len(data[0]) + + split_N = 10 + feat = data[0][0:num_day] + feat = torch.tensor(feat, dtype=torch.float32) + feat_shape_1 = feat.shape[1] # 时间部 + + feat = feat.reshape(-1, feat.shape[2]) + feat = feat + + selected = [0, 10] + candidate = [1, 2, 3, 4, 5, 6, 7, 8, 9] + start = 0 + + if num_domain in [2, 3, 5, 7, 10]: + while len(selected) - 2 < num_domain - 1: + distance_list = [] + for can in candidate: + selected.append(can) + selected.sort() + dis_temp = 0 + for i in range(1, len(selected) - 1): + for j in range(i, len(selected) - 1): + index_part1_start = start + math.floor(selected[i - 1] / split_N * num_day) * feat_shape_1 + index_part1_end = start + math.floor(selected[i] / split_N * num_day) * feat_shape_1 + feat_part1 = feat[index_part1_start: index_part1_end] + + index_part2_start = start + math.floor(selected[j] / split_N * num_day) * feat_shape_1 + index_part2_end = start + math.floor(selected[j + 1] / split_N * num_day) * feat_shape_1 + feat_part2 = feat[index_part2_start:index_part2_end] + criterion_transder = TransferLoss(loss_type=dis_type, input_dim=feat_part1.shape[1]) + dis_temp += criterion_transder.compute(feat_part1, feat_part2) + distance_list.append(dis_temp) + selected.remove(can) + can_index = distance_list.index(max(distance_list)) + selected.append(candidate[can_index]) + candidate.remove(candidate[can_index]) + selected.sort() + res = [] + for i in range(1, len(selected)): + if i == 1: + sel_start_index = int(num_day / split_N * selected[i - 1]) + else: + sel_start_index = int(num_day / split_N * selected[i - 1]) + 1 + + sel_end_index = int(num_day / split_N * selected[i]) + + res.append((sel_start_index, sel_end_index)) + return res + else: + print("error in number of domain") + + +def load_weather_data_multi_domain(hidden_num, feature, predict_num, batch_size=6, number_domain=2, mode='pre_process', + dis_type='coral', is_norm=False): + # mode: 'tdc', 'pre_process' + train_data, val_data = getVibrate_data(hidden_num=hidden_num, feature=feature, predict_num=predict_num, + is_norm=is_norm) + + split_time_list = get_split_time(number_domain, mode=mode, data=train_data, dis_type=dis_type) + train_list = [] + for i in range(len(split_time_list)): + index_temp = split_time_list[i] + train_loader = data_vibrate.get_vibrate_data(train_data, start_index=index_temp[0], + end_index=index_temp[1], batch_size=batch_size) + train_list.append(train_loader) + + valid_loader = data_vibrate.get_vibrate_data(val_data, start_index=0, + end_index=len(val_data), batch_size=batch_size, mean=None, + std=None, shuffle=False) + test_loader = valid_loader + + return train_list, valid_loader, test_loader + + +if __name__ == '__main__': + load_weather_data_multi_domain(hidden_num=10, feature=10, predict_num=50, batch_size=32, number_domain=2, + mode='tdc', + dis_type='coral', is_norm=False) diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/data_vibrate.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/data_vibrate.py new file mode 100644 index 0000000..f6a843c --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/data_vibrate.py @@ -0,0 +1,78 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' + +import math +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import os +from pandas.core.frame import DataFrame +from torch.utils.data import Dataset, DataLoader +import torch +import pickle +import datetime + + +class data_loader(Dataset): + def __init__(self, df_feature, df_label, df_label_reg, t=None): + + assert len(df_feature) == len(df_label) + assert len(df_feature) == len(df_label_reg) + + # df_feature = df_feature.reshape(df_feature.shape[0], df_feature.shape[1] // 6, df_feature.shape[2] * 6) + self.df_feature = df_feature + self.df_label = df_label + self.df_label_reg = df_label_reg + + self.T = t + self.df_feature = torch.tensor( + self.df_feature, dtype=torch.float32) + self.df_label = torch.tensor( + self.df_label, dtype=torch.float32) + self.df_label_reg = torch.tensor( + self.df_label_reg, dtype=torch.float32) + + def __getitem__(self, index): + sample, target, label_reg = self.df_feature[index], self.df_label[index], self.df_label_reg[index] + if self.T: + return self.T(sample), target, label_reg + else: + return sample, target, label_reg + + def __len__(self): + return len(self.df_feature) + + +def create_dataset(data, start_index, end_index, mean=None, std=None): + feat, label_continue, label_single = data[0], data[1], data[2] + referece_start_index = 0 + referece_end_index = 1250 + + assert start_index - referece_start_index >= 0 + assert end_index - referece_end_index <= 0 + assert end_index - start_index >= 0 + + feat = feat[start_index: end_index + 1] + label = label_continue[start_index: end_index + 1] + label_reg = label_single[start_index: end_index + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return data_loader(feat, label, label_reg) + + +def get_vibrate_data(data, start_index, end_index, batch_size, shuffle=True, mean=None, std=None): + dataset = create_dataset(data, start_index, + end_index, mean=mean, std=std) + train_loader = DataLoader( + dataset, batch_size=batch_size, shuffle=shuffle) + return train_loader diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/loadData.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/loadData.py new file mode 100644 index 0000000..ed8c90d --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/dataset_vibrate/loadData.py @@ -0,0 +1,150 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + # HI_merge_data_origin = np.load("E:\self_example\pytorch_example\RUL\dataset\HI_merge_data1.npy") + # + # # plt.plot(HI_merge_data[0:1250, 1]) + # # 去除掉退化特征不明显前面的点 + # HI_merge_data = HI_merge_data_origin[0:1250, 1] + HI_merge_data = np.loadtxt("E:\self_example\pytorch_example\RUL\dataset\smallVHI.csv", delimiter=",") + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset + + +def getVibrate_data(hidden_num, feature, predict_num, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + + + + return [train_data,train_label,train_label_single],[val_data,val_label,val_label_single] diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/loss_transfer.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/loss_transfer.py new file mode 100644 index 0000000..7e2798d --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/loss_transfer.py @@ -0,0 +1,64 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:45 +@Usage : +@Desc : +''' +from RUL.baseModel.loss import adv_loss, coral, kl_js, mmd, mutual_info, cos, pair_dist + + +class TransferLoss(object): + def __init__(self, loss_type='cosine', input_dim=512): + """ + Supported loss_type: mmd(mmd_lin), mmd_rbf, coral, cosine, kl, js, mine, adv + """ + self.loss_type = loss_type + self.input_dim = input_dim + + def compute(self, X, Y): + """Compute adaptation loss + + Arguments: + X {tensor} -- source matrix + Y {tensor} -- target matrix + + Returns: + [tensor] -- transfer loss + """ + if self.loss_type == 'mmd_lin' or self.loss_type == 'mmd': + mmdloss = mmd.MMD_loss(kernel_type='linear') + loss = mmdloss(X, Y) + elif self.loss_type == 'coral': + loss = coral.CORAL(X, Y) + elif self.loss_type == 'cosine' or self.loss_type == 'cos': + loss = 1 - cos.cosine(X, Y) + elif self.loss_type == 'kl': + loss = kl_js.kl_div(X, Y) + elif self.loss_type == 'js': + loss = kl_js.js(X, Y) + elif self.loss_type == 'mine': + mine_model = mutual_info.Mine_estimator( + input_dim=self.input_dim, hidden_dim=60) + loss = mine_model(X, Y) + elif self.loss_type == 'adv': + loss = adv_loss.adv(X, Y, input_dim=self.input_dim, hidden_dim=32) + elif self.loss_type == 'mmd_rbf': + mmdloss = mmd.MMD_loss(kernel_type='rbf') + loss = mmdloss(X, Y) + elif self.loss_type == 'pairwise': + pair_mat = pair_dist.pairwise_dist(X, Y) + import torch + loss = torch.norm(pair_mat) + + return loss + + +if __name__ == "__main__": + import torch + + trans_loss = TransferLoss('adv') + a = (torch.randn(5, 512) * 10) + b = (torch.randn(5, 512) * 10) + print(trans_loss.compute(a, b)) diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/model.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/model.py new file mode 100644 index 0000000..16a215e --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/model.py @@ -0,0 +1,224 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:44 +@Usage : +@Desc : +''' +import torch +import torch.nn as nn +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +import torch.nn.functional as F +from RUL.baseModel.dctChannelAttention import dct_channel_block + + +class AdaRNN(nn.Module): + """ + model_type: 'Boosting', 'AdaRNN' + bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + """ + + def __init__(self, use_bottleneck=False, bottleneck_list=[(64, False, False, 0), (64, True, True, 0.5)], + n_input=128, n_hiddens=[64, 64], n_output=6, + dropout=0.0, len_seq=9, model_type='AdaRNN', + trans_loss='mmd'): + super(AdaRNN, self).__init__() + self.use_bottleneck = use_bottleneck + self.n_input = n_input + self.num_layers = len(n_hiddens) + self.hiddens = n_hiddens + self.n_output = n_output + self.model_type = model_type + self.trans_loss = trans_loss + self.len_seq = len_seq + in_size = self.n_input + + features = nn.ModuleList() + dctAttention = nn.ModuleList() + for hidden in n_hiddens: + rnn = nn.GRU( + input_size=in_size, + num_layers=1, + hidden_size=hidden, + batch_first=True, + dropout=dropout + ) + attention = dct_channel_block(channel=hidden) + features.append(rnn) + dctAttention.append(attention) + in_size = hidden + self.features = nn.Sequential(*features) + self.dctAttention = nn.Sequential(*dctAttention) + + if use_bottleneck == True: # finance + bottleneck = [] + for i in range(len(bottleneck_list)): + cur_input_dim = self.hiddens[-1] if i == 0 else bottleneck_list[i - 1][0] + bottleneck.append( + nn.Linear(cur_input_dim, bottleneck_list[i][0]) + ) + ### 不加初始权重会让Hard predict更不稳定,振幅更大 + # 初始权重越大,振幅越大 + bottleneck[-1].weight.data.normal_(0, 0.03) + bottleneck[-1].bias.data.fill_(0.5) + if bottleneck_list[i][1]: + bottleneck.append(nn.BatchNorm1d(bottleneck_list[i][0])) + if bottleneck_list[i][2]: + bottleneck.append(nn.ReLU()) + if bottleneck_list[i][3] != 0: + bottleneck.append(nn.Dropout(bottleneck_list[i][3])) + self.bottleneck = nn.Sequential(*bottleneck) + self.fc = nn.Linear(bottleneck_list[-1][0], n_output) + + torch.nn.init.xavier_normal_(self.fc.weight) + else: + self.fc_out = nn.Linear(n_hiddens[-1], self.n_output) + + if self.model_type == 'AdaRNN': + gate = nn.ModuleList() + for i in range(len(n_hiddens)): + gate_weight = nn.Linear( + len_seq * self.hiddens[i] * 2, len_seq) + gate.append(gate_weight) + self.gate = gate + + bnlst = nn.ModuleList() + for i in range(len(n_hiddens)): + bnlst.append(nn.BatchNorm1d(len_seq)) + self.bn_lst = bnlst + self.softmax = torch.nn.Softmax(dim=0) + self.init_layers() + + def init_layers(self): + for i in range(len(self.hiddens)): + self.gate[i].weight.data.normal_(0, 0.05) + self.gate[i].bias.data.fill_(0.0) + + def forward_pre_train(self, x, len_win=0): + out = self.gru_features(x) + # 两层GRU之后的结果 + fea = out[0] + + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + # 每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out_list_all, out_weight_list = out[1], out[2] + # 可以理解为前半段 和 后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = max(j - len_win, 0) + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] if self.model_type == 'AdaRNN' else 1 / ( + self.len_seq - h_start) * (2 * len_win + 1) + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def gru_features(self, x, predict=False): + x_input = x + out = None + out_lis = [] + out_weight_list = [] if ( + self.model_type == 'AdaRNN') else None + for i in range(self.num_layers): + # GRU的输出 + out, _ = self.features[i](x_input.float()) + out = self.dctAttention[i](out.float()) + x_input = out + out_lis.append(out) + if self.model_type == 'AdaRNN' and predict == False: + out_gate = self.process_gate_weight(x_input, i) + out_weight_list.append(out_gate) + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + return out, out_lis, out_weight_list + + def process_gate_weight(self, out, index): + x_s = out[0: int(out.shape[0] // 2)] # 可以理解为前一半个batch_size的分布 域Di + x_t = out[out.shape[0] // 2: out.shape[0]] # 可以理解为后一半个batch_size的分布 域Dj + # 对应着不同的域 + x_all = torch.cat((x_s, x_t), 2) + x_all = x_all.view(x_all.shape[0], -1) + weight = torch.sigmoid(self.bn_lst[index]( + self.gate[index](x_all.float()))) + weight = torch.mean(weight, dim=0) + res = self.softmax(weight).squeeze() + return res + + def get_features(self, output_list): + fea_list_src, fea_list_tar = [], [] + for fea in output_list: + fea_list_src.append(fea[0: fea.size(0) // 2]) + fea_list_tar.append(fea[fea.size(0) // 2:]) + return fea_list_src, fea_list_tar + + # For Boosting-based + def forward_Boosting(self, x, weight_mat=None): + out = self.gru_features(x) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + out_list_all = out[1] + # 可以理解为前半段和后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + if weight_mat is None: + weight = (1.0 / self.len_seq * + torch.ones(self.num_layers, self.len_seq)) + else: + weight = weight_mat + dist_mat = torch.zeros(self.num_layers, self.len_seq) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + for j in range(self.len_seq): + loss_trans = criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, j, :]) + loss_transfer = loss_transfer + weight[i, j] * loss_trans + dist_mat[i, j] = loss_trans + return fc_out, loss_transfer, dist_mat, weight + + # For Boosting-based + def update_weight_Boosting(self, weight_mat, dist_old, dist_new): + epsilon = 1e-12 + dist_old = dist_old.detach() + dist_new = dist_new.detach() + ind = dist_new > dist_old + epsilon + weight_mat[ind] = weight_mat[ind] * \ + (1 + torch.sigmoid(dist_new[ind] - dist_old[ind])) + weight_norm = torch.norm(weight_mat, dim=1, p=1) + weight_mat = weight_mat / weight_norm.t().unsqueeze(1).repeat(1, self.len_seq) + return weight_mat + + def predict(self, x): + out = self.gru_features(x, predict=True) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + return fc_out + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + y = x.mean(1) + print(y.size()) + pass \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/test.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/test.py new file mode 100644 index 0000000..57e9407 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/test.py @@ -0,0 +1,96 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from RUL.otherIdea.LSTM.loadData import getDataset, getTotalData +from RUL.otherIdea.dctLSTM.model import PredictModel +from torch.utils.data import DataLoader +import matplotlib.pyplot as plt +from RUL.baseModel.plot import plot_prediction,plot_forSelf + + + + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data[-1].unsqueeze(0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model.predict(each_predict_data).cpu().detach().numpy() # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + c = each_predict_data[-1, -1, 1:] + a = np.concatenate([each_predict_data[-1, -1, 1:], np.expand_dims(predicted_data, axis=0)], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.expand_dims(b, axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, model, is_single=True, is_norm=False, save_fig_name=""): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predicted_data_hard = np.concatenate([predicted_data_hard, + predictOneByOne(model, last_train_data, predict_num=predict_num)], axis=0) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\outputs\AdaRNN_tdcLoss(cos)_transferLoss(cos)_dw0.5_lr0.0005\parameters\AdaRNN_hidden24_feature10_predict50_dimList64-64_epoch62_trainLoss0.5115623474121094_valLoss0.12946119904518127.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/train.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/train.py new file mode 100644 index 0000000..cc00aba --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/train.py @@ -0,0 +1,479 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:32 +@Usage : +@Desc : +''' +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np +import random +from tqdm import tqdm +from RUL.otherIdea.adaDctLSTM.utils import utils +from RUL.otherIdea.adaDctLSTM.model import AdaRNN + +import RUL.otherIdea.adaDctLSTM.dataset_vibrate.data_process as data_process +from RUL.baseModel.loss.ffd import fft_mse, dct_mse +from RUL.otherIdea.adaDctLSTM.test import test +import matplotlib.pyplot as plt +import time +from RUL.baseModel.CommonFunction import IsStopTraining + +''' +超参数设置: +''' +# 数据准备 +is_norm = False +is_single = True +tdc_loss_type = 'cos' +num_domain = 2 # 划分为几个源域和目标域 + +# RNN相关 +hidden_num = 10 # LSTM细胞个数 +feature = 2 # 一个点的维度 +predict_num = 50 # 预测个数 +batch_size = 32 +model_name = "AdaRNN" +hidden_list = [64, 64] # 每层RNN的隐藏层的维度 +### bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) +bottleneck = [(64, False, False, 0), (64, True, True, 0.5)] +# bottleneck = [(128, False, True, 0), +# (64, True, True, 0.2), +# (32, True, True, 0.2), +# (16, False, False, 0)] + +# 训练相关 +pre_epoch = 40 +epochs = 1000 +transfer_loss_type = 'cos' # 目前测试cos最好 +dw = 0.5 +lr = 0.01 +fft_dw = 0.1 # 整体效果,感觉是让Hard Predict更准了0.01 0.1较好 +len_win = 0 # 窗口大小为0,暂时不知道有什么用 +seed = 10 + +# 相关初始化工作 +out_dir = './outputs' +output_path = out_dir + '/{0}_tdc({1})_transfer({2})_domain{3}_dw{4}_fdw{5}_lr{6}_Norm{7}'.format(model_name, + tdc_loss_type, + transfer_loss_type, + num_domain, + dw, fft_dw, lr, + is_norm) +save_model_name = 'parameters/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[ + 0]) + "-" + str( + hidden_list[1])) +save_fig_name = 'fig/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[0]) + "-" + str( + hidden_list[1])) +utils.dir_exist(output_path) +utils.dir_exist(os.path.join(output_path, 'parameters')) +utils.dir_exist(os.path.join(output_path, 'fig')) +log_file = os.path.join(output_path, 'run.log') + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if log_file is None: + return + with open(log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + # 经过测试,整体来说,如果加了bottleneck,整体更愿意振动,而不加整体仅存在趋势 + # bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + + return AdaRNN(use_bottleneck=True, bottleneck_list=bottleneck, n_input=feature, n_hiddens=hidden_list, + n_output=1, dropout=0.0, model_type=name, len_seq=hidden_num, + trans_loss=transfer_loss_type) + + +def train_AdaRNN(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(len(hidden_list), hidden_num) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + + # 如果训练集域之间的batch_size对不齐就没法计算, + # 为了不抛弃所有样本,这里将选择最小的域batch_size作为本轮的batch_size + min_batch_size = 10000 + for data in data_all: + min_batch_size = min(min_batch_size, data[0].shape[0]) + + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].float(), data[2].float() + list_feat.append(feature[:min_batch_size]) + list_label.append(label_reg[:min_batch_size]) + + index = get_index(len(data_all) - 1) + + loss_mse = torch.zeros(1) + loss_fft = torch.zeros(1) + loss_transfer = torch.zeros(1) + total_loss_l1 = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + # 在batch_size处合并 + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < pre_epoch: + pred_all, each_loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=len_win) + else: + pred_all, each_loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + + lossf_s = dct_mse(pred_s, label_reg_s) + lossf_t = dct_mse(pred_t, label_reg_t) + + loss_l1 = criterion_1(pred_s, label_reg_s) + + loss_mse += loss_s + loss_t + loss_fft += (lossf_s + lossf_t) * fft_dw + loss_transfer += dw * each_loss_transfer + total_loss_l1 += loss_l1 + + total_loss = loss_mse + loss_transfer + loss_fft + loss_all.append([total_loss.item(), loss_mse.item(), loss_transfer.item(), loss_fft.item()]) + loss_1_all.append(total_loss_l1.item()) + + # 反向传播 + total_loss.backward() + # 梯度裁剪,梯度最大范数为3 + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + + if epoch >= pre_epoch: + if epoch > pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def val_epoch(model, val_loader, device, scheduler): + model.eval() + val_loss = 0 + val_loss_1 = 0 + val_loss_r = 0 + + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_continue, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = model.predict(val_data) + + loss = criterion(val_predict_data, val_label) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(val_predict_data, val_label) + val_loss += loss.item() + val_loss_1 += loss_1.item() + val_loss_r += loss_r.item() + + scheduler.step(val_loss) + + loss = val_loss / len(val_loader) + loss_1 = val_loss_1 / len(val_loader) + loss_r = val_loss_r / len(val_loader) + + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(len(hidden_list), hidden_num) + for i in range(weight.shape[0]): + for j in range(weight.shape[1]): + weight[i, j] = init_weight[i][j].item() + return weight + + +def loadData(): + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_norm=is_norm, batch_size=batch_size, + number_domain=num_domain, mode='tdc', dis_type=tdc_loss_type + ) + return train_loader_list, valid_loader, test_loader + pass + + +def train(model, train_loader_list, valid_loader, lr_patience, early_stop_patience, device): + optimizer = optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode="min", factor=0.5, + patience=lr_patience) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + train_loss_list = [] + val_loss_list = [] + best_save_path = None + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss, loss1, weight_mat, dist_mat = train_AdaRNN( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + + val_loss, val_loss_l1, val_loss_r = val_epoch( + model, valid_loader, device=device, scheduler=scheduler_model) + + pprint( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_total_loss: {:3.9f} | train_mse_loss: {:3.9f} | train_fft_loss: {:3.9f} | train_transfer_loss: {:3.9f} " + " | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss[0], train_loss[1], train_loss[3], train_loss[2], + val_loss, + optimizer.state_dict()['param_groups'][0]['lr'])) + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + pprint("保存模型最佳模型成功") + best_epoch = epoch + best_score = val_loss + # 保存模型参数 + if best_save_path != None: + utils.delete_file(os.path.join(output_path, best_save_path)) + best_save_path = save_model_name + "_epoch" + str(epoch) + \ + "_trainLoss" + str('%.5f' % train_loss[1]) + \ + "_valLoss" + str('%.5f' % val_loss) + ".pkl" + print(os.path.join(output_path, best_save_path)) + torch.save(model.state_dict(), + os.path.join(output_path, best_save_path)) + + train_loss_list.append(train_loss) + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + pprint("{0}次loss未下降,训练停止".format(early_stop_patience)) + break + + pprint('best val score:', best_score, '@', best_epoch) + return best_save_path + pass + + +def main_transfer(): + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + pprint('create DataLoaders...') + train_loader_list, valid_loader, test_loader = loadData() + + pprint('create AdaRNN model...') + model = get_model(model_name) + + num_model = count_parameters(model) + + print(model) + print('#model params:', num_model) + + pprint('train model...') + best_save_path = train(model=model, train_loader_list=train_loader_list, valid_loader=valid_loader, lr_patience=20, + early_stop_patience=50, device=device) + + end = time.time() + + print("训练耗时:{:3.2f}s".format(end - begin)) + + pprint('验证模型...') + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, best_save_path), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load(os.path.join(output_path, best_save_path), map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm, save_fig_name=os.path.join(output_path, save_fig_name)) + + +def after_test(save_name): + model = get_model(model_name) + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load( + save_name + , map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm) + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=feature) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='cos') + + parser.add_argument('--data_mode', type=str, default='tdc') + + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=hidden_num) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\dataset/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + # 训练与测试 + main_transfer() + + '''事后测试''' + # after_test(save_name="E:\self_example\pytorch_example\RUL\otherIdea/adaDctLSTM\outputs\AdaRNN_tdc(cos)_transfer(cos)_domain2_dw0.5_lr0.01_NormFalse\parameters\seed3069_hidden10_feature2_predict50_dimList64-64_epoch116_trainLoss0.02208_valLoss0.00271.pkl") diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/utils/__init__.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/utils/__init__.py new file mode 100644 index 0000000..4e22673 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/utils/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaDctLSTM/utils/utils.py b/pytorch_example/RUL/otherIdea/adaDctLSTM/utils/utils.py new file mode 100644 index 0000000..952e555 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaDctLSTM/utils/utils.py @@ -0,0 +1,229 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' + +import collections +import torch +import os +import pandas as pd +import torch.nn as nn +from tqdm import tqdm +import numpy as np + +EPS = 1e-12 + + +class AverageMeter(object): + def __init__(self): + self.reset() + + def reset(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + self.list = [] + + def update(self, val, n=1): + self.val = val + self.list.append(val) + self.sum += val * n + self.count += n + self.avg = self.sum / self.count + + +def average_params(params_list): + assert isinstance(params_list, (tuple, list, collections.deque)) + n = len(params_list) + if n == 1: + return params_list[0] + new_params = collections.OrderedDict() + keys = None + for i, params in enumerate(params_list): + if keys is None: + keys = params.keys() + for k, v in params.items(): + if k not in keys: + raise ValueError('the %d-th model has different params' % i) + if k not in new_params: + new_params[k] = v / n + else: + new_params[k] += v / n + return new_params + + +def zscore(x): + return (x - x.mean(dim=0, keepdim=True)) / x.std(dim=0, keepdim=True, unbiased=False) + + +def calc_loss(pred, label): + return torch.mean((zscore(pred) - label) ** 2) + + +def calc_corr(pred, label): + return (zscore(pred) * zscore(label)).mean() + + +def test_ic(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = label_actual.clone().detach().view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_daily(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values + avg), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for slc in tqdm(data_list[i].iter_daily(), total=data_list[i].daily_length): + feature, label_actual, _, _ = data_list[i].get(slc) + # for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = torch.tensor(label_actual, dtype=torch.float32, device=device).view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_uni(model, data_loader, model_path=None, ic_type='spearman', verbose=False): + if model_path: + model.load_state_dict(torch.load(model_path)) + model.eval() + loss_all = [] + ic_all = [] + for slc in tqdm(data_loader.iter_daily(), total=data_loader.daily_length): + data, label, _, _ = data_loader.get(slc) + with torch.no_grad(): + pred = model.predict(data) + mask = ~torch.isnan(label) + pred = pred[mask] + label = label[mask] + loss = torch.mean(torch.log(torch.cosh(pred - label))) + if ic_type == 'spearman': + ic = spearman_corr(pred, label) + elif ic_type == 'pearson': + ic = pearson_corr(pred, label) + loss_all.append(loss.item()) + ic_all.append(ic) + loss, ic = np.mean(loss_all), np.mean(ic_all) + if verbose: + print('IC: ', ic) + return loss, ic + + +def calc_ic(x, y, ic_type='pearson'): + ic = -100 + if ic_type == 'pearson': + ic = pearson_corr(x, y) + elif ic_type == 'spearman': + ic = spearman_corr(x, y) + return ic + + +def create_dir(path): + if not os.path.exists(path): + os.makedirs(path) + +def delete_file(path): + if os.path.exists(path): + os.remove(path) + + +def handle_nan(x): + mask = ~torch.isnan(x) + return x[mask], mask + + +class Log_Loss(nn.Module): + def __init__(self): + super(Log_Loss, self).__init__() + + def forward(self, ytrue, ypred): + delta = ypred - ytrue + return torch.mean(torch.log(torch.cosh(delta))) + + +def spearman_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='spearman') + return spearman + + +def spearman_corr2(x, y): + X = pd.Series(x) + Y = pd.Series(y) + spearman = X.corr(Y, method='spearman') + return spearman + + +def pearson_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='pearson') + return spearman + + +def dir_exist(dirs): + if not os.path.exists(dirs): + os.makedirs(dirs) \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/__init__.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/__init__.py new file mode 100644 index 0000000..75da775 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/20 20:32 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/__init__.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/__init__.py new file mode 100644 index 0000000..3e48d01 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/16 19:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/data_process.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/data_process.py new file mode 100644 index 0000000..e33d069 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/data_process.py @@ -0,0 +1,111 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:35 +@Usage : +@Desc : +''' +# encoding=utf-8 + +from .data_vibrate import get_vibrate_data +from ..loss_transfer import TransferLoss +from .loadData import getVibrate_data + +import torch +import math + + +def get_split_time(num_domain=2, mode='pre_process', data=None, dis_type='coral'): + spilt_time = { + '2': [(0, 600), (600, 1200)] + } + if mode == 'pre_process': + return spilt_time[str(num_domain)] + if mode == 'tdc': + return TDC(num_domain, data, dis_type=dis_type) + else: + print("error in mode") + + +def TDC(num_domain, data, dis_type='coral'): + # 样本个数 + num_day = len(data[0]) + + split_N = 10 + feat = data[0][0:num_day] + feat = torch.tensor(feat, dtype=torch.float32) + feat_shape_1 = feat.shape[1] # 时间部 + + feat = feat.reshape(-1, feat.shape[2]) + feat = feat + + selected = [0, 10] + candidate = [1, 2, 3, 4, 5, 6, 7, 8, 9] + start = 0 + + if num_domain in [2, 3, 5, 7, 10]: + while len(selected) - 2 < num_domain - 1: + distance_list = [] + for can in candidate: + selected.append(can) + selected.sort() + dis_temp = 0 + for i in range(1, len(selected) - 1): + for j in range(i, len(selected) - 1): + index_part1_start = start + math.floor(selected[i - 1] / split_N * num_day) * feat_shape_1 + index_part1_end = start + math.floor(selected[i] / split_N * num_day) * feat_shape_1 + feat_part1 = feat[index_part1_start: index_part1_end] + + index_part2_start = start + math.floor(selected[j] / split_N * num_day) * feat_shape_1 + index_part2_end = start + math.floor(selected[j + 1] / split_N * num_day) * feat_shape_1 + feat_part2 = feat[index_part2_start:index_part2_end] + criterion_transder = TransferLoss(loss_type=dis_type, input_dim=feat_part1.shape[1]) + dis_temp += criterion_transder.compute(feat_part1, feat_part2) + distance_list.append(dis_temp) + selected.remove(can) + can_index = distance_list.index(max(distance_list)) + selected.append(candidate[can_index]) + candidate.remove(candidate[can_index]) + selected.sort() + res = [] + for i in range(1, len(selected)): + if i == 1: + sel_start_index = int(num_day / split_N * selected[i - 1]) + else: + sel_start_index = int(num_day / split_N * selected[i - 1]) + 1 + + sel_end_index = int(num_day / split_N * selected[i]) + + res.append((sel_start_index, sel_end_index)) + return res + else: + print("error in number of domain") + + +def load_weather_data_multi_domain(hidden_num, feature, predict_num, batch_size=6, number_domain=2, mode='pre_process', + dis_type='coral', is_norm=False): + # mode: 'tdc', 'pre_process' + train_data, val_data = getVibrate_data(hidden_num=hidden_num, feature=feature, predict_num=predict_num, + is_norm=is_norm) + + split_time_list = get_split_time(number_domain, mode=mode, data=train_data, dis_type=dis_type) + train_list = [] + for i in range(len(split_time_list)): + index_temp = split_time_list[i] + train_loader = get_vibrate_data(train_data, start_index=index_temp[0], + end_index=index_temp[1], batch_size=batch_size) + train_list.append(train_loader) + + valid_loader = get_vibrate_data(val_data, start_index=0, + end_index=len(val_data[0]), batch_size=batch_size, mean=None, + std=None, shuffle=False) + test_loader = valid_loader + + return train_list, valid_loader, test_loader + + +if __name__ == '__main__': + load_weather_data_multi_domain(hidden_num=10, feature=10, predict_num=50, batch_size=32, number_domain=2, + mode='tdc', + dis_type='coral', is_norm=False) diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/data_vibrate.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/data_vibrate.py new file mode 100644 index 0000000..f6a843c --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/data_vibrate.py @@ -0,0 +1,78 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' + +import math +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import os +from pandas.core.frame import DataFrame +from torch.utils.data import Dataset, DataLoader +import torch +import pickle +import datetime + + +class data_loader(Dataset): + def __init__(self, df_feature, df_label, df_label_reg, t=None): + + assert len(df_feature) == len(df_label) + assert len(df_feature) == len(df_label_reg) + + # df_feature = df_feature.reshape(df_feature.shape[0], df_feature.shape[1] // 6, df_feature.shape[2] * 6) + self.df_feature = df_feature + self.df_label = df_label + self.df_label_reg = df_label_reg + + self.T = t + self.df_feature = torch.tensor( + self.df_feature, dtype=torch.float32) + self.df_label = torch.tensor( + self.df_label, dtype=torch.float32) + self.df_label_reg = torch.tensor( + self.df_label_reg, dtype=torch.float32) + + def __getitem__(self, index): + sample, target, label_reg = self.df_feature[index], self.df_label[index], self.df_label_reg[index] + if self.T: + return self.T(sample), target, label_reg + else: + return sample, target, label_reg + + def __len__(self): + return len(self.df_feature) + + +def create_dataset(data, start_index, end_index, mean=None, std=None): + feat, label_continue, label_single = data[0], data[1], data[2] + referece_start_index = 0 + referece_end_index = 1250 + + assert start_index - referece_start_index >= 0 + assert end_index - referece_end_index <= 0 + assert end_index - start_index >= 0 + + feat = feat[start_index: end_index + 1] + label = label_continue[start_index: end_index + 1] + label_reg = label_single[start_index: end_index + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return data_loader(feat, label, label_reg) + + +def get_vibrate_data(data, start_index, end_index, batch_size, shuffle=True, mean=None, std=None): + dataset = create_dataset(data, start_index, + end_index, mean=mean, std=std) + train_loader = DataLoader( + dataset, batch_size=batch_size, shuffle=shuffle) + return train_loader diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/loadData.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/loadData.py new file mode 100644 index 0000000..dd3fa37 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/dataset_vibrate/loadData.py @@ -0,0 +1,150 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("E:\self_example\pytorch_example\RUL\dataset\HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + # HI_merge_data = np.loadtxt("E:\self_example\pytorch_example\RUL\dataset\smallVHI.csv", delimiter=",") + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset + + +def getVibrate_data(hidden_num, feature, predict_num, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + + + + return [train_data,train_label,train_label_single],[val_data,val_label,val_label_single] diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/loss_transfer.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/loss_transfer.py new file mode 100644 index 0000000..7e2798d --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/loss_transfer.py @@ -0,0 +1,64 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:45 +@Usage : +@Desc : +''' +from RUL.baseModel.loss import adv_loss, coral, kl_js, mmd, mutual_info, cos, pair_dist + + +class TransferLoss(object): + def __init__(self, loss_type='cosine', input_dim=512): + """ + Supported loss_type: mmd(mmd_lin), mmd_rbf, coral, cosine, kl, js, mine, adv + """ + self.loss_type = loss_type + self.input_dim = input_dim + + def compute(self, X, Y): + """Compute adaptation loss + + Arguments: + X {tensor} -- source matrix + Y {tensor} -- target matrix + + Returns: + [tensor] -- transfer loss + """ + if self.loss_type == 'mmd_lin' or self.loss_type == 'mmd': + mmdloss = mmd.MMD_loss(kernel_type='linear') + loss = mmdloss(X, Y) + elif self.loss_type == 'coral': + loss = coral.CORAL(X, Y) + elif self.loss_type == 'cosine' or self.loss_type == 'cos': + loss = 1 - cos.cosine(X, Y) + elif self.loss_type == 'kl': + loss = kl_js.kl_div(X, Y) + elif self.loss_type == 'js': + loss = kl_js.js(X, Y) + elif self.loss_type == 'mine': + mine_model = mutual_info.Mine_estimator( + input_dim=self.input_dim, hidden_dim=60) + loss = mine_model(X, Y) + elif self.loss_type == 'adv': + loss = adv_loss.adv(X, Y, input_dim=self.input_dim, hidden_dim=32) + elif self.loss_type == 'mmd_rbf': + mmdloss = mmd.MMD_loss(kernel_type='rbf') + loss = mmdloss(X, Y) + elif self.loss_type == 'pairwise': + pair_mat = pair_dist.pairwise_dist(X, Y) + import torch + loss = torch.norm(pair_mat) + + return loss + + +if __name__ == "__main__": + import torch + + trans_loss = TransferLoss('adv') + a = (torch.randn(5, 512) * 10) + b = (torch.randn(5, 512) * 10) + print(trans_loss.compute(a, b)) diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/model.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/model.py new file mode 100644 index 0000000..f1bd315 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/model.py @@ -0,0 +1,253 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:44 +@Usage : +@Desc : +''' +import torch +import torch.nn as nn +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +import torch.nn.functional as F +from RUL.baseModel.dctChannelAttention import dct_channel_block + + +class AdaRNN(nn.Module): + """ + model_type: 'Boosting', 'AdaRNN' + bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + """ + + def __init__(self, use_bottleneck=False, bottleneck_list=[(64, False, False, 0), (64, True, True, 0.5)], + n_input=128, n_hiddens=[64, 64], n_output=6, + dropout=0.0, len_seq=9, model_type='AdaRNN', + trans_loss='mmd', mdw=1): + super(AdaRNN, self).__init__() + self.use_bottleneck = use_bottleneck + self.n_input = n_input + self.num_layers = len(n_hiddens) + self.hiddens = n_hiddens + self.n_output = n_output + self.model_type = model_type + self.trans_loss = trans_loss + self.len_seq = len_seq + in_size = self.n_input + + features = nn.ModuleList() + dctAttention = nn.ModuleList() + for hidden in n_hiddens: + rnn = nn.GRU( + input_size=in_size, + num_layers=1, + hidden_size=hidden, + batch_first=True, + dropout=dropout + ) + attention = dct_channel_block(channel=hidden) + features.append(rnn) + dctAttention.append(attention) + in_size = hidden + self.features = nn.Sequential(*features) + self.dctAttention = nn.Sequential(*dctAttention) + + if use_bottleneck == True: # finance + bottleneck = [] + for i in range(len(bottleneck_list)): + cur_input_dim = self.hiddens[-1] if i == 0 else bottleneck_list[i - 1][0] + bottleneck.append( + nn.Linear(cur_input_dim, bottleneck_list[i][0]) + ) + ### 不加初始权重会让Hard predict更不稳定,振幅更大 + # 初始权重越大,振幅越大 + # bottleneck[-1].weight.data.normal_(0, 0.04) + # bottleneck[-1].bias.data.fill_(0.1) + if bottleneck_list[i][1]: + bottleneck.append(nn.BatchNorm1d(bottleneck_list[i][0])) + if bottleneck_list[i][2]: + bottleneck.append(nn.ReLU()) + if bottleneck_list[i][3] != 0: + bottleneck.append(nn.Dropout(bottleneck_list[i][3])) + self.bottleneck = nn.Sequential(*bottleneck) + self.fc = nn.Linear(bottleneck_list[-1][0], n_output) + + torch.nn.init.xavier_normal_(self.fc.weight) + else: + self.fc_out = nn.Linear(n_hiddens[-1], self.n_output) + + # 平均值权重 + self.mean_weight = nn.Sequential( + nn.Linear(n_input, bottleneck_list[-1][0]), + nn.Linear(bottleneck_list[-1][0], bottleneck_list[-1][0]), + nn.BatchNorm1d(bottleneck_list[-1][0]), + nn.ReLU(), + nn.Dropout(), + nn.Linear(bottleneck_list[-1][0], self.n_output) + ) + self.mdw = mdw + # 方差权重 + self.std_weight = nn.Linear(in_features=n_input, out_features=n_hiddens[-1]) + + if self.model_type == 'AdaRNN': + gate = nn.ModuleList() + for i in range(len(n_hiddens)): + gate_weight = nn.Linear( + len_seq * self.hiddens[i] * 2, len_seq) + gate.append(gate_weight) + self.gate = gate + + bnlst = nn.ModuleList() + for i in range(len(n_hiddens)): + bnlst.append(nn.BatchNorm1d(len_seq)) + self.bn_lst = bnlst + self.softmax = torch.nn.Softmax(dim=0) + self.init_layers() + + def init_layers(self): + for i in range(len(self.hiddens)): + self.gate[i].weight.data.normal_(0, 0.05) + self.gate[i].bias.data.fill_(0.0) + + def forward_pre_train(self, x, len_win=0): + # TODO 与原始维度取平均之后加起来 + mean = x[:, -1, :].mean(-1) + # mean = self.mean_weight(mean) + + # std = x.std(1) + out = self.gru_features(x) + # 两层GRU之后的结果 + fea = out[0] + + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + mean * self.mdw + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + mean * self.mdw + # 每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out_list_all, out_weight_list = out[1], out[2] + # 可以理解为前半段 和 后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = max(j - len_win, 0) + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] if self.model_type == 'AdaRNN' else 1 / ( + self.len_seq - h_start) * (2 * len_win + 1) + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def gru_features(self, x, predict=False): + x_input = x + out = None + out_lis = [] + out_weight_list = [] if ( + self.model_type == 'AdaRNN') else None + for i in range(self.num_layers): + # GRU的输出 + out, _ = self.features[i](x_input.float()) + out = self.dctAttention[i](out.float()) + x_input = out + out_lis.append(out) + if self.model_type == 'AdaRNN' and predict == False: + out_gate = self.process_gate_weight(x_input, i) + out_weight_list.append(out_gate) + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + return out, out_lis, out_weight_list + + def process_gate_weight(self, out, index): + x_s = out[0: int(out.shape[0] // 2)] # 可以理解为前一半个batch_size的分布 域Di + x_t = out[out.shape[0] // 2: out.shape[0]] # 可以理解为后一半个batch_size的分布 域Dj + # 对应着不同的域 + x_all = torch.cat((x_s, x_t), 2) + x_all = x_all.view(x_all.shape[0], -1) + weight = torch.sigmoid(self.bn_lst[index]( + self.gate[index](x_all.float()))) + weight = torch.mean(weight, dim=0) + res = self.softmax(weight).squeeze() + return res + + def get_features(self, output_list): + fea_list_src, fea_list_tar = [], [] + for fea in output_list: + fea_list_src.append(fea[0: fea.size(0) // 2]) + fea_list_tar.append(fea[fea.size(0) // 2:]) + return fea_list_src, fea_list_tar + + # For Boosting-based + def forward_Boosting(self, x, weight_mat=None): + # TODO 与原始维度取平均之后加起来 + mean = x[:, -1, :].mean(-1) + # mean = self.mean_weight(mean) + + out = self.gru_features(x) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + mean* self.mdw + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + mean* self.mdw + + out_list_all = out[1] + # 可以理解为前半段和后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + if weight_mat is None: + weight = (1.0 / self.len_seq * + torch.ones(self.num_layers, self.len_seq)) + else: + weight = weight_mat + dist_mat = torch.zeros(self.num_layers, self.len_seq) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + for j in range(self.len_seq): + loss_trans = criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, j, :]) + loss_transfer = loss_transfer + weight[i, j] * loss_trans + dist_mat[i, j] = loss_trans + return fc_out, loss_transfer, dist_mat, weight + + # For Boosting-based + def update_weight_Boosting(self, weight_mat, dist_old, dist_new): + epsilon = 1e-12 + dist_old = dist_old.detach() + dist_new = dist_new.detach() + ind = dist_new > dist_old + epsilon + weight_mat[ind] = weight_mat[ind] * \ + (1 + torch.sigmoid(dist_new[ind] - dist_old[ind])) + weight_norm = torch.norm(weight_mat, dim=1, p=1) + weight_mat = weight_mat / weight_norm.t().unsqueeze(1).repeat(1, self.len_seq) + return weight_mat + + def predict(self, x): + # TODO 与原始维度取平均之后加起来 + mean = x[:, -1, :].mean(-1).to(torch.float32) + # mean = x.mean(1) + # mean = self.mean_weight(mean) + + out = self.gru_features(x, predict=True) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + mean* self.mdw + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + mean* self.mdw + + return fc_out + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + y = x.mean(1) + z = x.std(1) + print(y.size()) + print(z.size()) + pass diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/test.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/test.py new file mode 100644 index 0000000..b30faea --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/test.py @@ -0,0 +1,116 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from RUL.otherIdea.LSTM.loadData import getDataset, getTotalData +from RUL.otherIdea.dctLSTM.model import PredictModel +from torch.utils.data import DataLoader +import matplotlib.pyplot as plt +from RUL.baseModel.plot import plot_prediction, plot_forSelf +from RUL.baseModel.loss.Evaluate import getEvaluate + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data[-1].unsqueeze(0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model.predict(each_predict_data).cpu().detach().numpy() # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + c = each_predict_data[-1, -1, 1:] + # a = np.concatenate([each_predict_data[-1, -1, 1:], np.expand_dims(predicted_data, axis=0)], axis=0) + a = np.concatenate([each_predict_data[-1, -1, 1:], predicted_data], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.expand_dims(b, axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, model, is_single=True, is_norm=False, save_fig_name=""): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + # 衡量矩阵 + train_list = [] + easy_list = [] + val_label = [] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + train_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + easy_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + val_label = np.concatenate( + [val_label, label.cpu().detach().numpy()], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predict_hard = predictOneByOne(model, last_train_data, predict_num=predict_num) + predicted_data_hard = np.concatenate([predicted_data_hard, + predict_hard], axis=0) + ####衡量 + train_evaluate = np.mean(train_list, axis=0) + easy_evaluate = np.mean(easy_list, axis=0) + hard_evaluate = getEvaluate(val_label, predict_hard) + print('train: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (train_evaluate[0], train_evaluate[1], train_evaluate[2], train_evaluate[3])) + print('easy: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (easy_evaluate[0], easy_evaluate[1], easy_evaluate[2], easy_evaluate[3])) + print('hard: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (hard_evaluate[0], hard_evaluate[1], hard_evaluate[2], hard_evaluate[3])) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name, predict_num=predict_num) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\outputs\AdaRNN_tdcLoss(cos)_transferLoss(cos)_dw0.5_lr0.0005\parameters\AdaRNN_hidden24_feature10_predict50_dimList64-64_epoch62_trainLoss0.5115623474121094_valLoss0.12946119904518127.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/train.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/train.py new file mode 100644 index 0000000..552f276 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/train.py @@ -0,0 +1,480 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:32 +@Usage : +@Desc : +''' +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np +import random +from tqdm import tqdm +from RUL.otherIdea.adaHDctLSTM.utils import utils +from RUL.otherIdea.adaHDctLSTM.model import AdaRNN + +import RUL.otherIdea.adaHDctLSTM.dataset_vibrate.data_process as data_process +from RUL.baseModel.loss.ffd import fft_mse, dct_mse +from RUL.otherIdea.adaHDctLSTM.test import test +import matplotlib.pyplot as plt +import time +from RUL.baseModel.CommonFunction import IsStopTraining + +''' +超参数设置: +''' +# 数据准备 +is_norm = False +is_single = True +tdc_loss_type = 'cos' +num_domain = 2 # 划分为几个源域和目标域 + +# RNN相关 +hidden_num = 10 # LSTM细胞个数 +feature = 2 # 一个点的维度 +predict_num = 200 # 预测个数 +batch_size = 32 +model_name = "AdaRNN" +hidden_list = [64, 64] # 每层RNN的隐藏层的维度 +### bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) +bottleneck = [(64, False, False, 0), (64, True, True, 0.5)] +# bottleneck = [(128, False, True, 0), +# (64, True, True, 0.2), +# (32, True, True, 0.2), +# (16, False, False, 0)] + +# 训练相关 +pre_epoch = 40 +epochs = 1000 +transfer_loss_type = 'cos' # 目前测试cos最好 +dw = 0.5 +lr = 0.01 +fft_dw = 0.1 # 整体效果,感觉是让Hard Predict更准了0.01 0.1较好 +m_dw = 0.8 +len_win = 0 # 窗口大小为0,暂时不知道有什么用 +seed = 250 + +# 相关初始化工作 +out_dir = './outputs' +output_path = out_dir + '/{0}_tdc({1})_transfer({2})_domain{3}_dw{4}_fdw{5}_lr{6}_Norm{7}'.format(model_name, + tdc_loss_type, + transfer_loss_type, + num_domain, + dw, fft_dw, lr, + is_norm) +save_model_name = 'parameters/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[ + 0]) + "-" + str( + hidden_list[1])) +save_fig_name = 'fig/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[0]) + "-" + str( + hidden_list[1])) +utils.dir_exist(output_path) +utils.dir_exist(os.path.join(output_path, 'parameters')) +utils.dir_exist(os.path.join(output_path, 'fig')) +log_file = os.path.join(output_path, 'run.log') + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if log_file is None: + return + with open(log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + # 经过测试,整体来说,如果加了bottleneck,整体更愿意振动,而不加整体仅存在趋势 + # bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + + return AdaRNN(use_bottleneck=True, bottleneck_list=bottleneck, n_input=feature, n_hiddens=hidden_list, + n_output=1, dropout=0.0, model_type=name, len_seq=hidden_num, + trans_loss=transfer_loss_type,mdw=m_dw) + + +def train_AdaRNN(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(len(hidden_list), hidden_num) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + + # 如果训练集域之间的batch_size对不齐就没法计算, + # 为了不抛弃所有样本,这里将选择最小的域batch_size作为本轮的batch_size + min_batch_size = 10000 + for data in data_all: + min_batch_size = min(min_batch_size, data[0].shape[0]) + + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].float(), data[2].float() + list_feat.append(feature[:min_batch_size]) + list_label.append(label_reg[:min_batch_size]) + + index = get_index(len(data_all) - 1) + + loss_mse = torch.zeros(1) + loss_fft = torch.zeros(1) + loss_transfer = torch.zeros(1) + total_loss_l1 = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + # 在batch_size处合并 + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < pre_epoch: + pred_all, each_loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=len_win) + else: + pred_all, each_loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + + lossf_s = dct_mse(pred_s, label_reg_s) + lossf_t = dct_mse(pred_t, label_reg_t) + + loss_l1 = criterion_1(pred_s, label_reg_s) + + loss_mse += loss_s + loss_t + loss_fft += (lossf_s + lossf_t) * fft_dw + loss_transfer += dw * each_loss_transfer + total_loss_l1 += loss_l1 + + total_loss = loss_mse + loss_transfer + loss_fft + loss_all.append([total_loss.item(), loss_mse.item(), loss_transfer.item(), loss_fft.item()]) + loss_1_all.append(total_loss_l1.item()) + + # 反向传播 + total_loss.backward() + # 梯度裁剪,梯度最大范数为3 + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + + if epoch >= pre_epoch: + if epoch > pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def val_epoch(model, val_loader, device, scheduler): + model.eval() + val_loss = 0 + val_loss_1 = 0 + val_loss_r = 0 + + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_continue, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = model.predict(val_data) + + loss = criterion(val_predict_data, val_label) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(val_predict_data, val_label) + val_loss += loss.item() + val_loss_1 += loss_1.item() + val_loss_r += loss_r.item() + + scheduler.step(val_loss) + + loss = val_loss / len(val_loader) + loss_1 = val_loss_1 / len(val_loader) + loss_r = val_loss_r / len(val_loader) + + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(len(hidden_list), hidden_num) + for i in range(weight.shape[0]): + for j in range(weight.shape[1]): + weight[i, j] = init_weight[i][j].item() + return weight + + +def loadData(): + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_norm=is_norm, batch_size=batch_size, + number_domain=num_domain, mode='tdc', dis_type=tdc_loss_type + ) + return train_loader_list, valid_loader, test_loader + pass + + +def train(model, train_loader_list, valid_loader, lr_patience, early_stop_patience, device): + optimizer = optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode="min", factor=0.5, + patience=lr_patience) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + train_loss_list = [] + val_loss_list = [] + best_save_path = None + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss, loss1, weight_mat, dist_mat = train_AdaRNN( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + + val_loss, val_loss_l1, val_loss_r = val_epoch( + model, valid_loader, device=device, scheduler=scheduler_model) + + pprint( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_total_loss: {:3.9f} | train_mse_loss: {:3.9f} | train_fft_loss: {:3.9f} | train_transfer_loss: {:3.9f} " + " | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss[0], train_loss[1], train_loss[3], train_loss[2], + val_loss, + optimizer.state_dict()['param_groups'][0]['lr'])) + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + pprint("保存模型最佳模型成功") + best_epoch = epoch + best_score = val_loss + # 保存模型参数 + if best_save_path != None: + utils.delete_file(os.path.join(output_path, best_save_path)) + best_save_path = save_model_name + "_epoch" + str(epoch) + \ + "_trainLoss" + str('%.5f' % train_loss[1]) + \ + "_valLoss" + str('%.5f' % val_loss) + ".pkl" + print(os.path.join(output_path, best_save_path)) + torch.save(model.state_dict(), + os.path.join(output_path, best_save_path)) + + train_loss_list.append(train_loss) + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + pprint("{0}次loss未下降,训练停止".format(early_stop_patience)) + break + + pprint('best val score:', best_score, '@', best_epoch) + return best_save_path + pass + + +def main_transfer(): + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + pprint('create DataLoaders...') + train_loader_list, valid_loader, test_loader = loadData() + + pprint('create AdaRNN model...') + model = get_model(model_name) + + num_model = count_parameters(model) + + print(model) + print('#model params:', num_model) + + pprint('train model...') + best_save_path = train(model=model, train_loader_list=train_loader_list, valid_loader=valid_loader, lr_patience=20, + early_stop_patience=50, device=device) + + end = time.time() + + print("训练耗时:{:3.2f}s".format(end - begin)) + + pprint('验证模型...') + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, best_save_path), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load(os.path.join(output_path, best_save_path), map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm, save_fig_name=os.path.join(output_path, save_fig_name)) + + +def after_test(save_name): + model = get_model(model_name) + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load( + save_name + , map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm) + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=feature) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='cos') + + parser.add_argument('--data_mode', type=str, default='tdc') + + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=hidden_num) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\dataset/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + # 训练与测试 + main_transfer() + + '''事后测试''' + # after_test(save_name="E:\self_example\pytorch_example\RUL\otherIdea/adaHDctEmdLSTM\outputs\AdaRNN_tdc(cos)_transfer(cos)_domain2_dw0.5_fdw0.1_lr0.01_NormFalse\parameters\seed450_hidden10_feature2_predict50_dimList64-64_epoch34_trainLoss0.00751_valLoss0.01469.pkl") diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/utils/__init__.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/utils/__init__.py new file mode 100644 index 0000000..4e22673 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/utils/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaHDctLSTM/utils/utils.py b/pytorch_example/RUL/otherIdea/adaHDctLSTM/utils/utils.py new file mode 100644 index 0000000..952e555 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaHDctLSTM/utils/utils.py @@ -0,0 +1,229 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' + +import collections +import torch +import os +import pandas as pd +import torch.nn as nn +from tqdm import tqdm +import numpy as np + +EPS = 1e-12 + + +class AverageMeter(object): + def __init__(self): + self.reset() + + def reset(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + self.list = [] + + def update(self, val, n=1): + self.val = val + self.list.append(val) + self.sum += val * n + self.count += n + self.avg = self.sum / self.count + + +def average_params(params_list): + assert isinstance(params_list, (tuple, list, collections.deque)) + n = len(params_list) + if n == 1: + return params_list[0] + new_params = collections.OrderedDict() + keys = None + for i, params in enumerate(params_list): + if keys is None: + keys = params.keys() + for k, v in params.items(): + if k not in keys: + raise ValueError('the %d-th model has different params' % i) + if k not in new_params: + new_params[k] = v / n + else: + new_params[k] += v / n + return new_params + + +def zscore(x): + return (x - x.mean(dim=0, keepdim=True)) / x.std(dim=0, keepdim=True, unbiased=False) + + +def calc_loss(pred, label): + return torch.mean((zscore(pred) - label) ** 2) + + +def calc_corr(pred, label): + return (zscore(pred) * zscore(label)).mean() + + +def test_ic(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = label_actual.clone().detach().view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_daily(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values + avg), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for slc in tqdm(data_list[i].iter_daily(), total=data_list[i].daily_length): + feature, label_actual, _, _ = data_list[i].get(slc) + # for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = torch.tensor(label_actual, dtype=torch.float32, device=device).view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_uni(model, data_loader, model_path=None, ic_type='spearman', verbose=False): + if model_path: + model.load_state_dict(torch.load(model_path)) + model.eval() + loss_all = [] + ic_all = [] + for slc in tqdm(data_loader.iter_daily(), total=data_loader.daily_length): + data, label, _, _ = data_loader.get(slc) + with torch.no_grad(): + pred = model.predict(data) + mask = ~torch.isnan(label) + pred = pred[mask] + label = label[mask] + loss = torch.mean(torch.log(torch.cosh(pred - label))) + if ic_type == 'spearman': + ic = spearman_corr(pred, label) + elif ic_type == 'pearson': + ic = pearson_corr(pred, label) + loss_all.append(loss.item()) + ic_all.append(ic) + loss, ic = np.mean(loss_all), np.mean(ic_all) + if verbose: + print('IC: ', ic) + return loss, ic + + +def calc_ic(x, y, ic_type='pearson'): + ic = -100 + if ic_type == 'pearson': + ic = pearson_corr(x, y) + elif ic_type == 'spearman': + ic = spearman_corr(x, y) + return ic + + +def create_dir(path): + if not os.path.exists(path): + os.makedirs(path) + +def delete_file(path): + if os.path.exists(path): + os.remove(path) + + +def handle_nan(x): + mask = ~torch.isnan(x) + return x[mask], mask + + +class Log_Loss(nn.Module): + def __init__(self): + super(Log_Loss, self).__init__() + + def forward(self, ytrue, ypred): + delta = ypred - ytrue + return torch.mean(torch.log(torch.cosh(delta))) + + +def spearman_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='spearman') + return spearman + + +def spearman_corr2(x, y): + X = pd.Series(x) + Y = pd.Series(y) + spearman = X.corr(Y, method='spearman') + return spearman + + +def pearson_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='pearson') + return spearman + + +def dir_exist(dirs): + if not os.path.exists(dirs): + os.makedirs(dirs) \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/__init__.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/__init__.py new file mode 100644 index 0000000..3252e42 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/21 13:25 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/__init__.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/__init__.py new file mode 100644 index 0000000..3e48d01 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/16 19:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/data_process.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/data_process.py new file mode 100644 index 0000000..f8112b9 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/data_process.py @@ -0,0 +1,111 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:35 +@Usage : +@Desc : +''' +# encoding=utf-8 + +from .data_vibrate import get_vibrate_data +from ..loss_transfer import TransferLoss +from .loadData import getVibrate_data + +import torch +import math + + +def get_split_time(num_domain=2, mode='pre_process', data=None, dis_type='coral'): + spilt_time = { + '2': [(0, 600), (600, 1200)] + } + if mode == 'pre_process': + return spilt_time[str(num_domain)] + if mode == 'tdc': + return TDC(num_domain, data, dis_type=dis_type) + else: + print("error in mode") + + +def TDC(num_domain, data, dis_type='coral'): + # 样本个数 + num_day = len(data[0]) + + split_N = 10 + feat = data[0][0:num_day] + feat = torch.tensor(feat, dtype=torch.float32) + feat_shape_1 = feat.shape[1] # 时间部 + + feat = feat.reshape(-1, feat.shape[2]) + feat = feat + + selected = [0, 10] + candidate = [1, 2, 3, 4, 5, 6, 7, 8, 9] + start = 0 + + if num_domain in [2, 3, 5, 7, 10]: + while len(selected) - 2 < num_domain - 1: + distance_list = [] + for can in candidate: + selected.append(can) + selected.sort() + dis_temp = 0 + for i in range(1, len(selected) - 1): + for j in range(i, len(selected) - 1): + index_part1_start = start + math.floor(selected[i - 1] / split_N * num_day) * feat_shape_1 + index_part1_end = start + math.floor(selected[i] / split_N * num_day) * feat_shape_1 + feat_part1 = feat[index_part1_start: index_part1_end] + + index_part2_start = start + math.floor(selected[j] / split_N * num_day) * feat_shape_1 + index_part2_end = start + math.floor(selected[j + 1] / split_N * num_day) * feat_shape_1 + feat_part2 = feat[index_part2_start:index_part2_end] + criterion_transder = TransferLoss(loss_type=dis_type, input_dim=feat_part1.shape[1]) + dis_temp += criterion_transder.compute(feat_part1, feat_part2) + distance_list.append(dis_temp) + selected.remove(can) + can_index = distance_list.index(max(distance_list)) + selected.append(candidate[can_index]) + candidate.remove(candidate[can_index]) + selected.sort() + res = [] + for i in range(1, len(selected)): + if i == 1: + sel_start_index = int(num_day / split_N * selected[i - 1]) + else: + sel_start_index = int(num_day / split_N * selected[i - 1]) + 1 + + sel_end_index = int(num_day / split_N * selected[i]) + + res.append((sel_start_index, sel_end_index)) + return res + else: + print("error in number of domain") + + +def load_weather_data_multi_domain(hidden_num, feature, predict_num, batch_size=6, number_domain=2, mode='pre_process', + dis_type='coral', is_norm=False): + # mode: 'tdc', 'pre_process' + train_data, val_data = getVibrate_data(hidden_num=hidden_num, feature=feature, predict_num=predict_num, + is_norm=is_norm) + + split_time_list = get_split_time(number_domain, mode=mode, data=train_data, dis_type=dis_type) + train_list = [] + for i in range(len(split_time_list)): + index_temp = split_time_list[i] + train_loader = get_vibrate_data(train_data, start_index=index_temp[0], + end_index=index_temp[1], batch_size=batch_size) + train_list.append(train_loader) + + valid_loader = get_vibrate_data(val_data, start_index=0, + end_index=len(val_data[0]), batch_size=batch_size, mean=None, + std=None, shuffle=False) + test_loader = valid_loader + + return train_list, valid_loader, test_loader + + +if __name__ == '__main__': + load_weather_data_multi_domain(hidden_num=10, feature=10, predict_num=50, batch_size=32, number_domain=2, + mode='tdc', + dis_type='coral', is_norm=False) diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/data_vibrate.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/data_vibrate.py new file mode 100644 index 0000000..f6a843c --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/data_vibrate.py @@ -0,0 +1,78 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' + +import math +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import os +from pandas.core.frame import DataFrame +from torch.utils.data import Dataset, DataLoader +import torch +import pickle +import datetime + + +class data_loader(Dataset): + def __init__(self, df_feature, df_label, df_label_reg, t=None): + + assert len(df_feature) == len(df_label) + assert len(df_feature) == len(df_label_reg) + + # df_feature = df_feature.reshape(df_feature.shape[0], df_feature.shape[1] // 6, df_feature.shape[2] * 6) + self.df_feature = df_feature + self.df_label = df_label + self.df_label_reg = df_label_reg + + self.T = t + self.df_feature = torch.tensor( + self.df_feature, dtype=torch.float32) + self.df_label = torch.tensor( + self.df_label, dtype=torch.float32) + self.df_label_reg = torch.tensor( + self.df_label_reg, dtype=torch.float32) + + def __getitem__(self, index): + sample, target, label_reg = self.df_feature[index], self.df_label[index], self.df_label_reg[index] + if self.T: + return self.T(sample), target, label_reg + else: + return sample, target, label_reg + + def __len__(self): + return len(self.df_feature) + + +def create_dataset(data, start_index, end_index, mean=None, std=None): + feat, label_continue, label_single = data[0], data[1], data[2] + referece_start_index = 0 + referece_end_index = 1250 + + assert start_index - referece_start_index >= 0 + assert end_index - referece_end_index <= 0 + assert end_index - start_index >= 0 + + feat = feat[start_index: end_index + 1] + label = label_continue[start_index: end_index + 1] + label_reg = label_single[start_index: end_index + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return data_loader(feat, label, label_reg) + + +def get_vibrate_data(data, start_index, end_index, batch_size, shuffle=True, mean=None, std=None): + dataset = create_dataset(data, start_index, + end_index, mean=mean, std=std) + train_loader = DataLoader( + dataset, batch_size=batch_size, shuffle=shuffle) + return train_loader diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/loadData.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/loadData.py new file mode 100644 index 0000000..a578339 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_vibrate/loadData.py @@ -0,0 +1,149 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + # HI_merge_data_origin = np.load("E:\self_example\pytorch_example\RUL\dataset\HI_merge_data.npy") + # HI_merge_data = HI_merge_data_origin[0:1250, 1] + # plt.plot(HI_merge_data[0:1250, 1]) + + HI_merge_data = np.loadtxt("E:\self_example\pytorch_example\HealthyScorePredict\dataset\Healthy_score.csv", delimiter=",") + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset + + +def getVibrate_data(hidden_num, feature, predict_num, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + + + + return [train_data,train_label,train_label_single],[val_data,val_label,val_label_single] diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/__init__.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/__init__.py new file mode 100644 index 0000000..3e48d01 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/16 19:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/data_process.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/data_process.py new file mode 100644 index 0000000..dea7c5e --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/data_process.py @@ -0,0 +1,111 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:35 +@Usage : +@Desc : +''' +# encoding=utf-8 + +import RUL.otherIdea.adaNHDctLSTM.dataset_wind.data_vibrate as data_vibrate +from RUL.otherIdea.adaNHDctLSTM.loss_transfer import TransferLoss +from RUL.otherIdea.adaNHDctLSTM.dataset_wind.loadData import getVibrate_data + +import torch +import math + + +def get_split_time(num_domain=2, mode='pre_process', data=None, dis_type='coral'): + spilt_time = { + '2': [(0, 600), (600, 1200)] + } + if mode == 'pre_process': + return spilt_time[str(num_domain)] + if mode == 'tdc': + return TDC(num_domain, data, dis_type=dis_type) + else: + print("error in mode") + + +def TDC(num_domain, data, dis_type='coral'): + # 样本个数 + num_day = len(data[0]) + + split_N = 10 + feat = data[0][0:num_day] + feat = torch.tensor(feat, dtype=torch.float32) + feat_shape_1 = feat.shape[1] # 时间部 + + feat = feat.reshape(-1, feat.shape[2]) + feat = feat + + selected = [0, 10] + candidate = [1, 2, 3, 4, 5, 6, 7, 8, 9] + start = 0 + + if num_domain in [2, 3, 5, 7, 10]: + while len(selected) - 2 < num_domain - 1: + distance_list = [] + for can in candidate: + selected.append(can) + selected.sort() + dis_temp = 0 + for i in range(1, len(selected) - 1): + for j in range(i, len(selected) - 1): + index_part1_start = start + math.floor(selected[i - 1] / split_N * num_day) * feat_shape_1 + index_part1_end = start + math.floor(selected[i] / split_N * num_day) * feat_shape_1 + feat_part1 = feat[index_part1_start: index_part1_end] + + index_part2_start = start + math.floor(selected[j] / split_N * num_day) * feat_shape_1 + index_part2_end = start + math.floor(selected[j + 1] / split_N * num_day) * feat_shape_1 + feat_part2 = feat[index_part2_start:index_part2_end] + criterion_transder = TransferLoss(loss_type=dis_type, input_dim=feat_part1.shape[1]) + dis_temp += criterion_transder.compute(feat_part1, feat_part2) + distance_list.append(dis_temp) + selected.remove(can) + can_index = distance_list.index(max(distance_list)) + selected.append(candidate[can_index]) + candidate.remove(candidate[can_index]) + selected.sort() + res = [] + for i in range(1, len(selected)): + if i == 1: + sel_start_index = int(num_day / split_N * selected[i - 1]) + else: + sel_start_index = int(num_day / split_N * selected[i - 1]) + 1 + + sel_end_index = int(num_day / split_N * selected[i]) + + res.append((sel_start_index, sel_end_index)) + return res + else: + print("error in number of domain") + + +def load_weather_data_multi_domain(hidden_num, feature, predict_num, batch_size=6, number_domain=2, mode='pre_process', + dis_type='coral', is_norm=False): + # mode: 'tdc', 'pre_process' + train_data, val_data = getVibrate_data(hidden_num=hidden_num, feature=feature, predict_num=predict_num, + is_norm=is_norm) + + split_time_list = get_split_time(number_domain, mode=mode, data=train_data, dis_type=dis_type) + train_list = [] + for i in range(len(split_time_list)): + index_temp = split_time_list[i] + train_loader = data_vibrate.get_vibrate_data(train_data, start_index=index_temp[0], + end_index=index_temp[1], batch_size=batch_size) + train_list.append(train_loader) + + valid_loader = data_vibrate.get_vibrate_data(val_data, start_index=0, + end_index=len(val_data), batch_size=batch_size, mean=None, + std=None, shuffle=False) + test_loader = valid_loader + + return train_list, valid_loader, test_loader + + +if __name__ == '__main__': + load_weather_data_multi_domain(hidden_num=10, feature=10, predict_num=50, batch_size=32, number_domain=2, + mode='tdc', + dis_type='coral', is_norm=False) diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/data_vibrate.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/data_vibrate.py new file mode 100644 index 0000000..1590501 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/data_vibrate.py @@ -0,0 +1,78 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' + +import math +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import os +from pandas.core.frame import DataFrame +from torch.utils.data import Dataset, DataLoader +import torch +import pickle +import datetime + + +class data_loader(Dataset): + def __init__(self, df_feature, df_label, df_label_reg, t=None): + + assert len(df_feature) == len(df_label) + assert len(df_feature) == len(df_label_reg) + + # df_feature = df_feature.reshape(df_feature.shape[0], df_feature.shape[1] // 6, df_feature.shape[2] * 6) + self.df_feature = df_feature + self.df_label = df_label + self.df_label_reg = df_label_reg + + self.T = t + self.df_feature = torch.tensor( + self.df_feature, dtype=torch.float32) + self.df_label = torch.tensor( + self.df_label, dtype=torch.float32) + self.df_label_reg = torch.tensor( + self.df_label_reg, dtype=torch.float32) + + def __getitem__(self, index): + sample, target, label_reg = self.df_feature[index], self.df_label[index], self.df_label_reg[index] + if self.T: + return self.T(sample), target, label_reg + else: + return sample, target, label_reg + + def __len__(self): + return len(self.df_feature) + + +def create_dataset(data, start_index, end_index, mean=None, std=None): + feat, label_continue, label_single = data[0], data[1], data[2] + referece_start_index = 0 + referece_end_index = 2000 + + assert start_index - referece_start_index >= 0 + assert end_index - referece_end_index <= 0 + assert end_index - start_index >= 0 + + feat = feat[start_index: end_index + 1] + label = label_continue[start_index: end_index + 1] + label_reg = label_single[start_index: end_index + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return data_loader(feat, label, label_reg) + + +def get_vibrate_data(data, start_index, end_index, batch_size, shuffle=True, mean=None, std=None): + dataset = create_dataset(data, start_index, + end_index, mean=mean, std=std) + train_loader = DataLoader( + dataset, batch_size=batch_size, shuffle=shuffle) + return train_loader diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/loadData.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/loadData.py new file mode 100644 index 0000000..8a39415 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/dataset_wind/loadData.py @@ -0,0 +1,150 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("E:\self_example\pytorch_example\RUL\dataset\wind_HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:-10, 1] + # HI_merge_data = np.loadtxt("E:\self_example\pytorch_example\RUL\dataset\smallVHI.csv", delimiter=",") + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset + + +def getVibrate_data(hidden_num, feature, predict_num, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + + + + return [train_data,train_label,train_label_single],[val_data,val_label,val_label_single] diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/loss_transfer.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/loss_transfer.py new file mode 100644 index 0000000..7e2798d --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/loss_transfer.py @@ -0,0 +1,64 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:45 +@Usage : +@Desc : +''' +from RUL.baseModel.loss import adv_loss, coral, kl_js, mmd, mutual_info, cos, pair_dist + + +class TransferLoss(object): + def __init__(self, loss_type='cosine', input_dim=512): + """ + Supported loss_type: mmd(mmd_lin), mmd_rbf, coral, cosine, kl, js, mine, adv + """ + self.loss_type = loss_type + self.input_dim = input_dim + + def compute(self, X, Y): + """Compute adaptation loss + + Arguments: + X {tensor} -- source matrix + Y {tensor} -- target matrix + + Returns: + [tensor] -- transfer loss + """ + if self.loss_type == 'mmd_lin' or self.loss_type == 'mmd': + mmdloss = mmd.MMD_loss(kernel_type='linear') + loss = mmdloss(X, Y) + elif self.loss_type == 'coral': + loss = coral.CORAL(X, Y) + elif self.loss_type == 'cosine' or self.loss_type == 'cos': + loss = 1 - cos.cosine(X, Y) + elif self.loss_type == 'kl': + loss = kl_js.kl_div(X, Y) + elif self.loss_type == 'js': + loss = kl_js.js(X, Y) + elif self.loss_type == 'mine': + mine_model = mutual_info.Mine_estimator( + input_dim=self.input_dim, hidden_dim=60) + loss = mine_model(X, Y) + elif self.loss_type == 'adv': + loss = adv_loss.adv(X, Y, input_dim=self.input_dim, hidden_dim=32) + elif self.loss_type == 'mmd_rbf': + mmdloss = mmd.MMD_loss(kernel_type='rbf') + loss = mmdloss(X, Y) + elif self.loss_type == 'pairwise': + pair_mat = pair_dist.pairwise_dist(X, Y) + import torch + loss = torch.norm(pair_mat) + + return loss + + +if __name__ == "__main__": + import torch + + trans_loss = TransferLoss('adv') + a = (torch.randn(5, 512) * 10) + b = (torch.randn(5, 512) * 10) + print(trans_loss.compute(a, b)) diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/model.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/model.py new file mode 100644 index 0000000..86d87a7 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/model.py @@ -0,0 +1,284 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:44 +@Usage : +@Desc : +''' +import torch +import torch.nn as nn +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +import torch.nn.functional as F +from RUL.baseModel.dctChannelAttention import dct_channel_block + + +class AdaRNN(nn.Module): + """ + model_type: 'Boosting', 'AdaRNN' + bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + """ + + def __init__(self, use_bottleneck=False, bottleneck_list=[(64, False, False, 0), (64, True, True, 0.5)], + n_input=128, n_hiddens=[64, 64], n_output=6, + dropout=0.0, len_seq=9, model_type='AdaRNN', + trans_loss='mmd',mdw=1): + super(AdaRNN, self).__init__() + self.use_bottleneck = use_bottleneck + self.n_input = n_input + self.num_layers = len(n_hiddens) + self.hiddens = n_hiddens + self.n_output = n_output + self.model_type = model_type + self.trans_loss = trans_loss + self.len_seq = len_seq + in_size = self.n_input + + features = nn.ModuleList() + dctAttention = nn.ModuleList() + for hidden in n_hiddens: + rnn = nn.GRU( + input_size=in_size, + num_layers=1, + hidden_size=hidden, + batch_first=True, + dropout=dropout + ) + attention = dct_channel_block(channel=hidden) + features.append(rnn) + dctAttention.append(attention) + in_size = hidden + self.features = nn.Sequential(*features) + self.dctAttention = nn.Sequential(*dctAttention) + + if use_bottleneck == True: # finance + bottleneck = [] + for i in range(len(bottleneck_list)): + cur_input_dim = self.hiddens[-1] if i == 0 else bottleneck_list[i - 1][0] + bottleneck.append( + nn.Linear(cur_input_dim, bottleneck_list[i][0]) + ) + ### 不加初始权重会让Hard predict更不稳定,振幅更大 + # 初始权重越大,振幅越大 + # bottleneck[-1].weight.data.normal_(0, 0.03) + # bottleneck[-1].bias.data.fill_(0.1) + if bottleneck_list[i][1]: + bottleneck.append(nn.BatchNorm1d(bottleneck_list[i][0])) + if bottleneck_list[i][2]: + bottleneck.append(nn.ReLU()) + if bottleneck_list[i][3] != 0: + bottleneck.append(nn.Dropout(bottleneck_list[i][3])) + self.bottleneck = nn.Sequential(*bottleneck) + self.fc = nn.Linear(bottleneck_list[-1][0], n_output) + + torch.nn.init.xavier_normal_(self.fc.weight) + else: + self.fc_out = nn.Linear(n_hiddens[-1], self.n_output) + + # 平均值权重 + self.mean_weight = nn.Sequential( + nn.Conv1d(in_channels=2, out_channels=64, kernel_size=5, padding='same'), + nn.BatchNorm1d(64), + nn.ReLU(), + nn.AdaptiveAvgPool1d(self.len_seq//2), + nn.Conv1d(in_channels=64, out_channels=64, kernel_size=3, padding='same'), + nn.BatchNorm1d(64), + nn.ReLU(), + nn.AdaptiveAvgPool1d(self.len_seq//4), + nn.Flatten(), + nn.Dropout(0.2), + nn.Linear(len_seq // 4 * 64, 64), + nn.BatchNorm1d(64), + nn.ReLU(), + nn.Linear(64, self.n_output) + ) + self.mdw = mdw + # 方差权重 + self.std_weight = nn.Linear(in_features=n_input, out_features=n_hiddens[-1]) + + if self.model_type == 'AdaRNN': + gate = nn.ModuleList() + for i in range(len(n_hiddens)): + gate_weight = nn.Linear( + len_seq * self.hiddens[i] * 2, len_seq) + gate.append(gate_weight) + self.gate = gate + + bnlst = nn.ModuleList() + for i in range(len(n_hiddens)): + bnlst.append(nn.BatchNorm1d(len_seq)) + self.bn_lst = bnlst + self.softmax = torch.nn.Softmax(dim=0) + self.init_layers() + + def init_layers(self): + for i in range(len(self.hiddens)): + self.gate[i].weight.data.normal_(0, 0.05) + self.gate[i].bias.data.fill_(0.0) + + def forward_pre_train(self, x, len_win=0): + # TODO 与原始维度取平均之后加起来 + mean = x[:, :, :].mean(-1) + std = x[:, :, :].std(-1) + hand_feature = torch.stack([mean, std], dim=1) + + + mean = self.mean_weight(hand_feature).squeeze() + + # std = x.std(1) + out = self.gru_features(x) + # 两层GRU之后的结果 + fea = out[0] + + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + mean*self.mdw + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + mean*self.mdw + # 每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out_list_all, out_weight_list = out[1], out[2] + # 可以理解为前半段 和 后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = max(j - len_win, 0) + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] if self.model_type == 'AdaRNN' else 1 / ( + self.len_seq - h_start) * (2 * len_win + 1) + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def gru_features(self, x, predict=False): + x_input = x + out = None + out_lis = [] + out_weight_list = [] if ( + self.model_type == 'AdaRNN') else None + for i in range(self.num_layers): + # GRU的输出 + out, _ = self.features[i](x_input.float()) + out = self.dctAttention[i](out.float()) + x_input = out + out_lis.append(out) + if self.model_type == 'AdaRNN' and predict == False: + out_gate = self.process_gate_weight(x_input, i) + out_weight_list.append(out_gate) + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + return out, out_lis, out_weight_list + + def process_gate_weight(self, out, index): + x_s = out[0: int(out.shape[0] // 2)] # 可以理解为前一半个batch_size的分布 域Di + x_t = out[out.shape[0] // 2: out.shape[0]] # 可以理解为后一半个batch_size的分布 域Dj + # 对应着不同的域 + x_all = torch.cat((x_s, x_t), 2) + x_all = x_all.view(x_all.shape[0], -1) + weight = torch.sigmoid(self.bn_lst[index]( + self.gate[index](x_all.float()))) + weight = torch.mean(weight, dim=0) + res = self.softmax(weight).squeeze() + return res + + def get_features(self, output_list): + fea_list_src, fea_list_tar = [], [] + for fea in output_list: + fea_list_src.append(fea[0: fea.size(0) // 2]) + fea_list_tar.append(fea[fea.size(0) // 2:]) + return fea_list_src, fea_list_tar + + # For Boosting-based + def forward_Boosting(self, x, weight_mat=None): + # TODO 与原始维度取平均之后加起来 + mean = x[:,:, :].mean(-1) + std = x[:,:, :].std(-1) + hand_feature = torch.stack([mean, std], dim=1) + mean = self.mean_weight(hand_feature).squeeze() + + out = self.gru_features(x) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + mean*self.mdw + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + mean*self.mdw + + out_list_all = out[1] + # 可以理解为前半段和后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + if weight_mat is None: + weight = (1.0 / self.len_seq * + torch.ones(self.num_layers, self.len_seq)) + else: + weight = weight_mat + dist_mat = torch.zeros(self.num_layers, self.len_seq) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + for j in range(self.len_seq): + loss_trans = criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, j, :]) + loss_transfer = loss_transfer + weight[i, j] * loss_trans + dist_mat[i, j] = loss_trans + return fc_out, loss_transfer, dist_mat, weight + + # For Boosting-based + def update_weight_Boosting(self, weight_mat, dist_old, dist_new): + epsilon = 1e-12 + dist_old = dist_old.detach() + dist_new = dist_new.detach() + ind = dist_new > dist_old + epsilon + weight_mat[ind] = weight_mat[ind] * \ + (1 + torch.sigmoid(dist_new[ind] - dist_old[ind])) + weight_norm = torch.norm(weight_mat, dim=1, p=1) + weight_mat = weight_mat / weight_norm.t().unsqueeze(1).repeat(1, self.len_seq) + return weight_mat + + def predict(self, x): + # TODO 与原始维度取平均之后加起来 + x = x.to(torch.float32) + mean = x[:, :, :].mean(-1) + std = x[:, :, :].std(-1) + hand_feature = torch.stack([mean, std], dim=1) + mean = self.mean_weight(hand_feature).squeeze() + + out = self.gru_features(x, predict=True) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + mean*self.mdw + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + mean*self.mdw + + return fc_out + + +if __name__ == '__main__': + x = torch.rand((64, 2, 20)) + + x=nn.Conv1d(in_channels=2, out_channels=64, kernel_size=5, padding='same')(x) + x=nn.BatchNorm1d(64)(x) + x=nn.ReLU()(x) + x=nn.AdaptiveAvgPool1d(2)(x) + x=nn.Conv1d(in_channels=64, out_channels=64, kernel_size=3, padding='same')(x) + x=nn.BatchNorm1d(64)(x) + x=nn.ReLU()(x) + x=nn.AdaptiveAvgPool1d(2)(x) + x=nn.Flatten()(x) + x=nn.Dropout(0.2)(x) + x=nn.Linear(320, 64)(x) + x=nn.BatchNorm1d(64)(x) + x=nn.ReLU()(x) + x=nn.Linear(64, 1)(x) + # y = x.mean(1) + # z = x.std(1) + # print(y.size()) + # print(z.size()) + pass diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/test.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/test.py new file mode 100644 index 0000000..3c8c0c5 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/test.py @@ -0,0 +1,120 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch + +from .dataset_vibrate.loadData import getDataset, getTotalData +from torch.utils.data import DataLoader +from RUL.baseModel.plot import plot_prediction,plot_forSelf +from RUL.baseModel.loss.Evaluate import getEvaluate + + + + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data[-1].unsqueeze(0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model.predict(each_predict_data).cpu().detach().numpy() # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + c = each_predict_data[-1, -1, 1:] + a = np.concatenate([each_predict_data[-1, -1, 1:], np.expand_dims(predicted_data, axis=0)], axis=0) + # a = np.concatenate([each_predict_data[-1, -1, 1:], predicted_data], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.expand_dims(b, axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, model, is_single=True, is_norm=False, save_fig_name=""): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + # print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + # 衡量矩阵 + train_list = [] + easy_list = [] + val_label = [] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = model.predict(data).cpu().detach().numpy() + + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + train_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + + easy_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + val_label = np.concatenate( + [val_label, label.cpu().detach().numpy()], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predict_hard = predictOneByOne(model, last_train_data, predict_num=predict_num) + predicted_data_hard = np.concatenate([predicted_data_hard, + predict_hard], axis=0) + ####衡量 + train_evaluate = np.mean(train_list, axis=0) + easy_evaluate = np.mean(easy_list, axis=0) + hard_evaluate = getEvaluate(val_label, predict_hard) + print('train: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (train_evaluate[0], train_evaluate[1], train_evaluate[2], train_evaluate[3])) + print('easy: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (easy_evaluate[0], easy_evaluate[1], easy_evaluate[2], easy_evaluate[3])) + print('hard: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (hard_evaluate[0], hard_evaluate[1], hard_evaluate[2], hard_evaluate[3])) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name,predict_num=predict_num) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\outputs\AdaRNN_tdcLoss(cos)_transferLoss(cos)_dw0.5_lr0.0005\parameters\AdaRNN_hidden24_feature10_predict50_dimList64-64_epoch62_trainLoss0.5115623474121094_valLoss0.12946119904518127.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/test_wind.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/test_wind.py new file mode 100644 index 0000000..d74fbc2 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/test_wind.py @@ -0,0 +1,114 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from .dataset_wind.loadData import getDataset, getTotalData +from torch.utils.data import DataLoader +from RUL.baseModel.plot import plot_prediction, plot_forSelf +from RUL.baseModel.loss.Evaluate import getEvaluate + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data[-1].unsqueeze(0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model.predict(each_predict_data).cpu().detach().numpy() # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + c = each_predict_data[-1, -1, 1:] + a = np.concatenate([each_predict_data[-1, -1, 1:], np.expand_dims(predicted_data, axis=0)], axis=0) + # a = np.concatenate([each_predict_data[-1, -1, 1:], predicted_data], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.expand_dims(b, axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, model, is_single=True, is_norm=False, save_fig_name=""): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + # print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + # 衡量矩阵 + train_list = [] + easy_list = [] + val_label = [] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + train_list.append(getEvaluate(label.cpu().detach().numpy(),each_predicted_data)) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + easy_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + val_label=np.concatenate( + [val_label, label.cpu().detach().numpy()], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predict_hard = predictOneByOne(model, last_train_data, predict_num=predict_num) + predicted_data_hard = np.concatenate([predicted_data_hard, + predict_hard], axis=0) + ####衡量 + train_evaluate = np.mean(train_list, axis=0) + easy_evaluate = np.mean(easy_list, axis=0) + hard_evaluate = getEvaluate(val_label, predict_hard) + print('train: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (train_evaluate[0], train_evaluate[1], train_evaluate[2], train_evaluate[3])) + print('easy: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (easy_evaluate[0], easy_evaluate[1], easy_evaluate[2], easy_evaluate[3])) + print('hard: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (hard_evaluate[0], hard_evaluate[1], hard_evaluate[2], hard_evaluate[3])) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name, predict_num=predict_num) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\outputs\AdaRNN_tdcLoss(cos)_transferLoss(cos)_dw0.5_lr0.0005\parameters\AdaRNN_hidden24_feature10_predict50_dimList64-64_epoch62_trainLoss0.5115623474121094_valLoss0.12946119904518127.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/train.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/train.py new file mode 100644 index 0000000..1d22726 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/train.py @@ -0,0 +1,536 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:32 +@Usage : +@Desc : +''' +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np +import random +from tqdm import tqdm +from RUL.otherIdea.adaNHDctLSTM.utils import utils +from RUL.otherIdea.adaNHDctLSTM.model import AdaRNN + +import RUL.otherIdea.adaNHDctLSTM.dataset_vibrate.data_process as data_process +from RUL.baseModel.loss.ffd import fft_mse, dct_mse +from RUL.otherIdea.adaNHDctLSTM.test import test +import matplotlib.pyplot as plt +import time +from RUL.baseModel.CommonFunction import IsStopTraining + +''' +超参数设置: +''' +# 数据准备 +is_norm = True +is_single = True +tdc_loss_type = 'cos' +num_domain = 2 # 划分为几个源域和目标域 + +# RNN相关 +hidden_num = 10 # LSTM细胞个数 +feature = 20 # 一个点的维度 +predict_num = 200 # 预测个数 +batch_size = 32 +model_name = "AdaRNN" +hidden_list = [64, 64] # 每层RNN的隐藏层的维度 +### bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) +bottleneck = [(64, False, False, 0), (64, True, True, 0.5)] +# bottleneck = [(128, False, True, 0), +# (64, True, True, 0.2), +# (32, True, True, 0.2), +# (16, False, False, 0)] + +# 训练相关 +pre_epoch = 40 +epochs = 1000 +transfer_loss_type = 'cos' # 目前测试cos最好 +dw = 0.5 # 迁移loss权重 +lr = 0.01 +fft_dw = 0.01 # fft_loss权重 整体效果,感觉是让Hard Predict更准了0.01 0.1较好 +mdw = 0.0 # 手工特征权重 整体效果,0.3 0.5比较好 +len_win = 0 # 窗口大小为0,暂时不知道有什么用 +seed = 5 + +# 相关初始化工作 +out_dir = './outputs' +output_path = out_dir + '/{0}_tdc({1})_transfer({2})_domain{3}_dw{4}_fdw{5}_lr{6}_Norm{7}'.format(model_name, + tdc_loss_type, + transfer_loss_type, + num_domain, + dw, fft_dw, lr, + is_norm) +save_model_name = 'parameters/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[ + 0]) + "-" + str( + hidden_list[1])) +save_fig_name = 'fig/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[0]) + "-" + str( + hidden_list[1])) +utils.dir_exist(output_path) +utils.dir_exist(os.path.join(output_path, 'parameters')) +utils.dir_exist(os.path.join(output_path, 'fig')) +log_file = os.path.join(output_path, 'run.log') + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if log_file is None: + return + with open(log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + # 经过测试,整体来说,如果加了bottleneck,整体更愿意振动,而不加整体仅存在趋势 + # bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + + return AdaRNN(use_bottleneck=True, bottleneck_list=bottleneck, n_input=feature, n_hiddens=hidden_list, + n_output=1, dropout=0.0, model_type=name, len_seq=hidden_num, + trans_loss=transfer_loss_type, mdw=mdw) + + +def train_AdaRNN(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(len(hidden_list), hidden_num) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + + # 如果训练集域之间的batch_size对不齐就没法计算, + # 为了不抛弃所有样本,这里将选择最小的域batch_size作为本轮的batch_size + min_batch_size = 10000 + for data in data_all: + min_batch_size = min(min_batch_size, data[0].shape[0]) + + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].float(), data[2].float() + list_feat.append(feature[:min_batch_size]) + list_label.append(label_reg[:min_batch_size]) + + index = get_index(len(data_all) - 1) + + loss_mse = torch.zeros(1) + loss_fft = torch.zeros(1) + loss_transfer = torch.zeros(1) + total_loss_l1 = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + # 在batch_size处合并 + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < pre_epoch: + pred_all, each_loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=len_win) + else: + pred_all, each_loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + + lossf_s = dct_mse(pred_s, label_reg_s) + lossf_t = dct_mse(pred_t, label_reg_t) + + loss_l1 = criterion_1(pred_s, label_reg_s) + + loss_mse += loss_s + loss_t + loss_fft += (lossf_s + lossf_t) * fft_dw + loss_transfer += dw * each_loss_transfer + total_loss_l1 += loss_l1 + + total_loss = loss_mse + loss_transfer + loss_fft + loss_all.append([total_loss.item(), loss_mse.item(), loss_transfer.item(), loss_fft.item()]) + loss_1_all.append(total_loss_l1.item()) + + # 反向传播 + total_loss.backward() + # 梯度裁剪,梯度最大范数为3 + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + + if epoch >= pre_epoch: + if epoch > pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def val_epoch(model, val_loader, device, scheduler): + model.eval() + val_loss = 0 + val_loss_1 = 0 + val_loss_r = 0 + + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_continue, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = model.predict(val_data) + + loss = criterion(val_predict_data, val_label) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(val_predict_data, val_label) + val_loss += loss.item() + val_loss_1 += loss_1.item() + val_loss_r += loss_r.item() + + scheduler.step(val_loss) + + loss = val_loss / len(val_loader) + loss_1 = val_loss_1 / len(val_loader) + loss_r = val_loss_r / len(val_loader) + + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(len(hidden_list), hidden_num) + for i in range(weight.shape[0]): + for j in range(weight.shape[1]): + weight[i, j] = init_weight[i][j].item() + return weight + + +def loadData(): + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_norm=is_norm, batch_size=batch_size, + number_domain=num_domain, mode='tdc', dis_type=tdc_loss_type + ) + return train_loader_list, valid_loader, test_loader + pass + + +def train(model, train_loader_list, valid_loader, lr_patience, early_stop_patience, device): + optimizer = optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode="min", factor=0.5, + patience=lr_patience) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + train_loss_list = [] + val_loss_list = [] + best_save_path = None + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss, loss1, weight_mat, dist_mat = train_AdaRNN( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + + val_loss, val_loss_l1, val_loss_r = val_epoch( + model, valid_loader, device=device, scheduler=scheduler_model) + + pprint( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_total_loss: {:3.9f} | train_mse_loss: {:3.9f} | train_fft_loss: {:3.9f} | train_transfer_loss: {:3.9f} " + " | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss[0], train_loss[1], train_loss[3], train_loss[2], + val_loss, + optimizer.state_dict()['param_groups'][0]['lr'])) + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + pprint("保存模型最佳模型成功") + best_epoch = epoch + best_score = val_loss + # 保存模型参数 + if best_save_path != None: + utils.delete_file(os.path.join(output_path, best_save_path)) + best_save_path = save_model_name + "_epoch" + str(epoch) + \ + "_trainLoss" + str('%.5f' % train_loss[1]) + \ + "_valLoss" + str('%.5f' % val_loss) + ".pkl" + print(os.path.join(output_path, best_save_path)) + torch.save(model.state_dict(), + os.path.join(output_path, best_save_path)) + + train_loss_list.append(train_loss) + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + pprint("{0}次loss未下降,训练停止".format(early_stop_patience)) + break + + pprint('best val score:', best_score, '@', best_epoch) + return best_save_path + pass + + +# 全局最优再保存 +def trainForTotal(model, train_loader_list, valid_loader, lr_patience, early_stop_patience, device): + optimizer = optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode="min", factor=0.5, + patience=lr_patience) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + train_loss_list = [] + val_loss_list = [] + best_save_path = None + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss, loss1, weight_mat, dist_mat = train_AdaRNN( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + + val_loss, val_loss_l1, val_loss_r = val_epoch( + model, valid_loader, device=device, scheduler=scheduler_model) + + pprint( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_total_loss: {:3.9f} | train_mse_loss: {:3.9f} | train_fft_loss: {:3.9f} | train_transfer_loss: {:3.9f} " + " | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss[0], train_loss[1], train_loss[3], train_loss[2], + val_loss, + optimizer.state_dict()['param_groups'][0]['lr'])) + totalLoss = train_loss[1]+val_loss + if len(val_loss_list) == 0 or totalLoss < min(val_loss_list): + pprint(f"保存模型最佳模型成功,Loss:{totalLoss}") + best_epoch = epoch + best_score = val_loss + # 保存模型参数 + if best_save_path != None: + utils.delete_file(os.path.join(output_path, best_save_path)) + best_save_path = save_model_name + "_epoch" + str(epoch) + \ + "_trainLoss" + str('%.5f' % train_loss[1]) + \ + "_valLoss" + str('%.5f' % val_loss) + ".pkl" + print(os.path.join(output_path, best_save_path)) + torch.save(model.state_dict(), + os.path.join(output_path, best_save_path)) + + train_loss_list.append(train_loss) + val_loss_list.append(totalLoss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + pprint("{0}次loss未下降,训练停止".format(early_stop_patience)) + break + + pprint('best val score:', best_score, '@', best_epoch) + return best_save_path + pass + +def main_transfer(): + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + pprint('create DataLoaders...') + train_loader_list, valid_loader, test_loader = loadData() + + pprint('create AdaRNN model...') + model = get_model(model_name) + + num_model = count_parameters(model) + + print(model) + print('#model params:', num_model) + + pprint('train model...') + best_save_path = train(model=model, train_loader_list=train_loader_list, valid_loader=valid_loader, lr_patience=20, + early_stop_patience=50, device=device) + # best_save_path = trainForTotal(model=model, train_loader_list=train_loader_list, valid_loader=valid_loader, lr_patience=20, + # early_stop_patience=50, device=device) + + end = time.time() + + print("训练耗时:{:3.2f}s".format(end - begin)) + + pprint('验证模型...') + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, best_save_path), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load(os.path.join(output_path, best_save_path), map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm, save_fig_name=os.path.join(output_path, save_fig_name)) + + +def after_test(save_name): + model = get_model(model_name) + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load( + save_name + , map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm) + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=feature) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='cos') + + parser.add_argument('--data_mode', type=str, default='tdc') + + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=hidden_num) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\dataset/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + # 训练与测试 + main_transfer() + + '''事后测试''' + # after_test(save_name="E:\self_example\pytorch_example\RUL\otherIdea/adaNHDctLSTM\outputs\AdaRNN_tdc(cos)_transfer(cos)_domain2_dw0.5_fdw0.1_lr0.01_NormFalse\parameters\seed250_hidden10_feature2_predict50_dimList64-64_epoch18_trainLoss0.03446_valLoss0.01136.pkl") diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/train_wind.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/train_wind.py new file mode 100644 index 0000000..fe53038 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/train_wind.py @@ -0,0 +1,479 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:32 +@Usage : +@Desc : +''' +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np +import random +from tqdm import tqdm +from RUL.otherIdea.adaNHDctLSTM.utils import utils +from RUL.otherIdea.adaNHDctLSTM.model import AdaRNN + +import RUL.otherIdea.adaNHDctLSTM.dataset_wind.data_process as data_process +from RUL.baseModel.loss.ffd import fft_mse, dct_mse +from RUL.otherIdea.adaNHDctLSTM.test_wind import test +import matplotlib.pyplot as plt +import time +from RUL.baseModel.CommonFunction import IsStopTraining + +''' +超参数设置: +''' +# 数据准备 +is_norm = False +is_single = True +tdc_loss_type = 'cos' +num_domain = 2 # 划分为几个源域和目标域 + +# RNN相关 +hidden_num = 10 # LSTM细胞个数 +feature = 2 # 一个点的维度 +predict_num = 200 # 预测个数 +batch_size = 32 +model_name = "AdaRNN" +hidden_list = [64, 64] # 每层RNN的隐藏层的维度 +### bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) +bottleneck = [(64, False, False, 0), (64, True, True, 0.5)] +# bottleneck = [(128, False, True, 0), +# (64, True, True, 0.2), +# (32, True, True, 0.2), +# (16, False, False, 0)] + +# 训练相关 +pre_epoch = 40 +epochs = 1000 +transfer_loss_type = 'cos' # 目前测试cos最好 +dw = 0.5 +lr = 0.01 +fft_dw = 0.1 # 整体效果,感觉是让Hard Predict更准了0.01 0.1较好 +len_win = 0 # 窗口大小为0,暂时不知道有什么用 +seed = 250 + +# 相关初始化工作 +out_dir = './outputs/wind' +output_path = out_dir + '/{0}_tdc({1})_transfer({2})_domain{3}_dw{4}_fdw{5}_lr{6}_Norm{7}'.format(model_name, + tdc_loss_type, + transfer_loss_type, + num_domain, + dw, fft_dw, lr, + is_norm) +save_model_name = 'parameters/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[ + 0]) + "-" + str( + hidden_list[1])) +save_fig_name = 'fig/seed{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(seed, hidden_num, + feature, + predict_num, + str(hidden_list[0]) + "-" + str( + hidden_list[1])) +utils.dir_exist(output_path) +utils.dir_exist(os.path.join(output_path, 'parameters')) +utils.dir_exist(os.path.join(output_path, 'fig')) +log_file = os.path.join(output_path, 'run.log') + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if log_file is None: + return + with open(log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + # 经过测试,整体来说,如果加了bottleneck,整体更愿意振动,而不加整体仅存在趋势 + # bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + + return AdaRNN(use_bottleneck=True, bottleneck_list=bottleneck, n_input=feature, n_hiddens=hidden_list, + n_output=1, dropout=0.0, model_type=name, len_seq=hidden_num, + trans_loss=transfer_loss_type) + + +def train_AdaRNN(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(len(hidden_list), hidden_num) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + + # 如果训练集域之间的batch_size对不齐就没法计算, + # 为了不抛弃所有样本,这里将选择最小的域batch_size作为本轮的batch_size + min_batch_size = 10000 + for data in data_all: + min_batch_size = min(min_batch_size, data[0].shape[0]) + + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].float(), data[2].float() + list_feat.append(feature[:min_batch_size]) + list_label.append(label_reg[:min_batch_size]) + + index = get_index(len(data_all) - 1) + + loss_mse = torch.zeros(1) + loss_fft = torch.zeros(1) + loss_transfer = torch.zeros(1) + total_loss_l1 = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + # 在batch_size处合并 + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < pre_epoch: + pred_all, each_loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=len_win) + else: + pred_all, each_loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + + lossf_s = dct_mse(pred_s, label_reg_s) + lossf_t = dct_mse(pred_t, label_reg_t) + + loss_l1 = criterion_1(pred_s, label_reg_s) + + loss_mse += loss_s + loss_t + loss_fft += (lossf_s + lossf_t) * fft_dw + loss_transfer += dw * each_loss_transfer + total_loss_l1 += loss_l1 + + total_loss = loss_mse + loss_transfer + loss_fft + loss_all.append([total_loss.item(), loss_mse.item(), loss_transfer.item(), loss_fft.item()]) + loss_1_all.append(total_loss_l1.item()) + + # 反向传播 + total_loss.backward() + # 梯度裁剪,梯度最大范数为3 + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + + if epoch >= pre_epoch: + if epoch > pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def val_epoch(model, val_loader, device, scheduler): + model.eval() + val_loss = 0 + val_loss_1 = 0 + val_loss_r = 0 + + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_continue, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = model.predict(val_data) + + loss = criterion(val_predict_data, val_label) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(val_predict_data, val_label) + val_loss += loss.item() + val_loss_1 += loss_1.item() + val_loss_r += loss_r.item() + + scheduler.step(val_loss) + + loss = val_loss / len(val_loader) + loss_1 = val_loss_1 / len(val_loader) + loss_r = val_loss_r / len(val_loader) + + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(len(hidden_list), hidden_num) + for i in range(weight.shape[0]): + for j in range(weight.shape[1]): + weight[i, j] = init_weight[i][j].item() + return weight + + +def loadData(): + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_norm=is_norm, batch_size=batch_size, + number_domain=num_domain, mode='tdc', dis_type=tdc_loss_type + ) + return train_loader_list, valid_loader, test_loader + pass + + +def train(model, train_loader_list, valid_loader, lr_patience, early_stop_patience, device): + optimizer = optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode="min", factor=0.5, + patience=lr_patience) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + train_loss_list = [] + val_loss_list = [] + best_save_path = None + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss, loss1, weight_mat, dist_mat = train_AdaRNN( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + + val_loss, val_loss_l1, val_loss_r = val_epoch( + model, valid_loader, device=device, scheduler=scheduler_model) + + pprint( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_total_loss: {:3.9f} | train_mse_loss: {:3.9f} | train_fft_loss: {:3.9f} | train_transfer_loss: {:3.9f} " + " | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss[0], train_loss[1], train_loss[3], train_loss[2], + val_loss, + optimizer.state_dict()['param_groups'][0]['lr'])) + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + pprint("保存模型最佳模型成功") + best_epoch = epoch + best_score = val_loss + # 保存模型参数 + if best_save_path != None: + utils.delete_file(os.path.join(output_path, best_save_path)) + best_save_path = save_model_name + "_epoch" + str(epoch) + \ + "_trainLoss" + str('%.5f' % train_loss[1]) + \ + "_valLoss" + str('%.5f' % val_loss) + ".pkl" + print(os.path.join(output_path, best_save_path)) + torch.save(model.state_dict(), + os.path.join(output_path, best_save_path)) + + train_loss_list.append(train_loss) + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + pprint("{0}次loss未下降,训练停止".format(early_stop_patience)) + break + + pprint('best val score:', best_score, '@', best_epoch) + return best_save_path + pass + + +def main_transfer(): + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + pprint('create DataLoaders...') + train_loader_list, valid_loader, test_loader = loadData() + + pprint('create AdaRNN model...') + model = get_model(model_name) + + num_model = count_parameters(model) + + print(model) + print('#model params:', num_model) + + pprint('train model...') + best_save_path = train(model=model, train_loader_list=train_loader_list, valid_loader=valid_loader, lr_patience=20, + early_stop_patience=50, device=device) + + end = time.time() + + print("训练耗时:{:3.2f}s".format(end - begin)) + + pprint('验证模型...') + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, best_save_path), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load(os.path.join(output_path, best_save_path), map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm, save_fig_name=os.path.join(output_path, save_fig_name)) + + +def after_test(save_name): + model = get_model(model_name) + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load( + save_name + , map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm) + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=feature) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='cos') + + parser.add_argument('--data_mode', type=str, default='tdc') + + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=hidden_num) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\dataset/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + # 训练与测试 + # main_transfer() + + '''事后测试''' + after_test(save_name="E:\self_example\pytorch_example\RUL\otherIdea/adaNHDctLSTM\outputs\wind\AdaRNN_tdc(cos)_transfer(cos)_domain2_dw0.5_fdw0.1_lr0.01_NormFalse\parameters\seed250_hidden10_feature2_predict200_dimList64-64_epoch66_trainLoss0.02555_valLoss0.00037.pkl") diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/utils/__init__.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/utils/__init__.py new file mode 100644 index 0000000..4e22673 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/utils/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaNHDctLSTM/utils/utils.py b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/utils/utils.py new file mode 100644 index 0000000..952e555 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaNHDctLSTM/utils/utils.py @@ -0,0 +1,229 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' + +import collections +import torch +import os +import pandas as pd +import torch.nn as nn +from tqdm import tqdm +import numpy as np + +EPS = 1e-12 + + +class AverageMeter(object): + def __init__(self): + self.reset() + + def reset(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + self.list = [] + + def update(self, val, n=1): + self.val = val + self.list.append(val) + self.sum += val * n + self.count += n + self.avg = self.sum / self.count + + +def average_params(params_list): + assert isinstance(params_list, (tuple, list, collections.deque)) + n = len(params_list) + if n == 1: + return params_list[0] + new_params = collections.OrderedDict() + keys = None + for i, params in enumerate(params_list): + if keys is None: + keys = params.keys() + for k, v in params.items(): + if k not in keys: + raise ValueError('the %d-th model has different params' % i) + if k not in new_params: + new_params[k] = v / n + else: + new_params[k] += v / n + return new_params + + +def zscore(x): + return (x - x.mean(dim=0, keepdim=True)) / x.std(dim=0, keepdim=True, unbiased=False) + + +def calc_loss(pred, label): + return torch.mean((zscore(pred) - label) ** 2) + + +def calc_corr(pred, label): + return (zscore(pred) * zscore(label)).mean() + + +def test_ic(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = label_actual.clone().detach().view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_daily(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values + avg), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for slc in tqdm(data_list[i].iter_daily(), total=data_list[i].daily_length): + feature, label_actual, _, _ = data_list[i].get(slc) + # for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = torch.tensor(label_actual, dtype=torch.float32, device=device).view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_uni(model, data_loader, model_path=None, ic_type='spearman', verbose=False): + if model_path: + model.load_state_dict(torch.load(model_path)) + model.eval() + loss_all = [] + ic_all = [] + for slc in tqdm(data_loader.iter_daily(), total=data_loader.daily_length): + data, label, _, _ = data_loader.get(slc) + with torch.no_grad(): + pred = model.predict(data) + mask = ~torch.isnan(label) + pred = pred[mask] + label = label[mask] + loss = torch.mean(torch.log(torch.cosh(pred - label))) + if ic_type == 'spearman': + ic = spearman_corr(pred, label) + elif ic_type == 'pearson': + ic = pearson_corr(pred, label) + loss_all.append(loss.item()) + ic_all.append(ic) + loss, ic = np.mean(loss_all), np.mean(ic_all) + if verbose: + print('IC: ', ic) + return loss, ic + + +def calc_ic(x, y, ic_type='pearson'): + ic = -100 + if ic_type == 'pearson': + ic = pearson_corr(x, y) + elif ic_type == 'spearman': + ic = spearman_corr(x, y) + return ic + + +def create_dir(path): + if not os.path.exists(path): + os.makedirs(path) + +def delete_file(path): + if os.path.exists(path): + os.remove(path) + + +def handle_nan(x): + mask = ~torch.isnan(x) + return x[mask], mask + + +class Log_Loss(nn.Module): + def __init__(self): + super(Log_Loss, self).__init__() + + def forward(self, ytrue, ypred): + delta = ypred - ytrue + return torch.mean(torch.log(torch.cosh(delta))) + + +def spearman_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='spearman') + return spearman + + +def spearman_corr2(x, y): + X = pd.Series(x) + Y = pd.Series(y) + spearman = X.corr(Y, method='spearman') + return spearman + + +def pearson_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='pearson') + return spearman + + +def dir_exist(dirs): + if not os.path.exists(dirs): + os.makedirs(dirs) \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaRNN/__init__.py b/pytorch_example/RUL/otherIdea/adaRNN/__init__.py new file mode 100644 index 0000000..d96a162 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 21:34 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset/PRSA_Data_1.pkl b/pytorch_example/RUL/otherIdea/adaRNN/dataset/PRSA_Data_1.pkl new file mode 100644 index 0000000..937fd13 Binary files /dev/null and b/pytorch_example/RUL/otherIdea/adaRNN/dataset/PRSA_Data_1.pkl differ diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset/__init__.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset/__init__.py new file mode 100644 index 0000000..701f052 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_act.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_act.py new file mode 100644 index 0000000..6b5cdb0 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_act.py @@ -0,0 +1,115 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' +# encoding=utf-8 + +import numpy as np +from torch.utils.data import Dataset, DataLoader + +# from config import config_info + + + +# This is for parsing the X data, you can ignore it if you do not need preprocessing +def format_data_x(datafile): + x_data = None + for item in datafile: + item_data = np.loadtxt(item, dtype=np.float) + if x_data is None: + x_data = np.zeros((len(item_data), 1)) + x_data = np.hstack((x_data, item_data)) + x_data = x_data[:, 1:] + print(x_data.shape) + X = None + for i in range(len(x_data)): + row = np.asarray(x_data[i, :]) + row = row.reshape(9, 128).T + if X is None: + X = np.zeros((len(x_data), 128, 9)) + X[i] = row + print(X.shape) + return X + + +# This is for parsing the Y data, you can ignore it if you do not need preprocessing +def format_data_y(datafile): + data = np.loadtxt(datafile, dtype=np.int) - 1 + YY = np.eye(6)[data] + return YY + + +# Load data function, if there exists parsed data file, then use it +# If not, parse the original dataset from scratch +def load_data(data_folder, domain): + import os + domain = '1_20' if domain == 'A' else '21_30' + data_file = os.path.join(data_folder, 'data_har_' + domain + '.npz') + if os.path.exists(data_file): + data = np.load(data_file) + X_train = data['X_train'] + Y_train = data['Y_train'] + X_test = data['X_test'] + Y_test = data['Y_test'] + else: + # This for processing the dataset from scratch + # After downloading the dataset, put it to somewhere that str_folder can find + str_folder = config_info['data_folder_raw'] + 'UCI HAR Dataset/' + INPUT_SIGNAL_TYPES = [ + "body_acc_x_", + "body_acc_y_", + "body_acc_z_", + "body_gyro_x_", + "body_gyro_y_", + "body_gyro_z_", + "total_acc_x_", + "total_acc_y_", + "total_acc_z_" + ] + + str_train_files = [str_folder + 'train/' + 'Inertial Signals/' + item + 'train.txt' for item in + INPUT_SIGNAL_TYPES] + str_test_files = [str_folder + 'test/' + 'Inertial Signals/' + + item + 'test.txt' for item in INPUT_SIGNAL_TYPES] + str_train_y = str_folder + 'train/y_train.txt' + str_test_y = str_folder + 'test/y_test.txt' + + X_train = format_data_x(str_train_files) + X_test = format_data_x(str_test_files) + Y_train = format_data_y(str_train_y) + Y_test = format_data_y(str_test_y) + + return X_train, onehot_to_label(Y_train), X_test, onehot_to_label(Y_test) + + +def onehot_to_label(y_onehot): + a = np.argwhere(y_onehot == 1) + return a[:, -1] + + +class data_loader(Dataset): + def __init__(self, samples, labels, t): + self.samples = samples + self.labels = labels + self.T = t + + def __getitem__(self, index): + sample, target = self.samples[index], self.labels[index] + if self.T: + return self.T(sample), target + else: + return sample, target + + def __len__(self): + return len(self.samples) + + +def normalize(x): + x_min = x.min(axis=(0, 2, 3), keepdims=True) + x_max = x.max(axis=(0, 2, 3), keepdims=True) + x_norm = (x - x_min) / (x_max - x_min) + return x_norm \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_process.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_process.py new file mode 100644 index 0000000..130fd73 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_process.py @@ -0,0 +1,148 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:35 +@Usage : +@Desc : +''' +# encoding=utf-8 +import os +import RUL.otherIdea.adaRNN.dataset.data_act as data_act +import pandas as pd +import RUL.otherIdea.adaRNN.dataset.data_weather as data_weather +import datetime +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +import torch +import math +from RUL.otherIdea.adaRNN.dataset import data_process + + +def load_act_data(data_folder, batch_size=64, domain="1_20"): + x_train, y_train, x_test, y_test = data_act.load_data(data_folder, domain) + x_train, x_test = x_train.reshape( + (-1, x_train.shape[2], 1, x_train.shape[1])), x_test.reshape((-1, x_train.shape[2], 1, x_train.shape[1])) + transform = None + train_set = data_act.data_loader(x_train, y_train, transform) + test_set = data_act.data_loader(x_test, y_test, transform) + train_loader = data_act.DataLoader( + train_set, batch_size=batch_size, shuffle=True, drop_last=True) + test_loader = data_act.DataLoader( + test_set, batch_size=batch_size, shuffle=False) + return train_loader, train_loader, test_loader + + +def load_weather_data(file_path, batch_size=6, station='Changping'): + data_file = os.path.join(file_path, "PRSA_Data_1.pkl") + mean_train, std_train = data_weather.get_weather_data_statistic(data_file, station=station, + start_time='2013-3-1 0:0', + end_time='2016-10-30 23:0') + train_loader = data_weather.get_weather_data(data_file, station=station, start_time='2013-3-6 0:0', + end_time='2015-5-31 23:0', batch_size=batch_size, mean=mean_train, + std=std_train) + valid_train_loader = data_weather.get_weather_data(data_file, station=station, start_time='2015-6-2 0:0', + end_time='2016-6-30 23:0', batch_size=batch_size, + mean=mean_train, std=std_train) + valid_vld_loader = data_weather.get_weather_data(data_file, station=station, start_time='2016-7-2 0:0', + end_time='2016-10-30 23:0', batch_size=batch_size, mean=mean_train, + std=std_train) + test_loader = data_weather.get_weather_data(data_file, station=station, start_time='2016-11-2 0:0', + end_time='2017-2-28 23:0', batch_size=batch_size, mean=mean_train, + std=std_train) + return train_loader, valid_train_loader, valid_vld_loader, test_loader + + +def get_split_time(num_domain=2, mode='pre_process', data_file=None, station=None, dis_type='coral'): + spilt_time = { + '2': [('2013-3-6 0:0', '2015-5-31 23:0'), ('2015-6-2 0:0', '2016-6-30 23:0')] + } + if mode == 'pre_process': + return spilt_time[str(num_domain)] + if mode == 'tdc': + return TDC(num_domain, data_file, station, dis_type=dis_type) + else: + print("error in mode") + + +def TDC(num_domain, data_file, station, dis_type='coral'): + start_time = datetime.datetime.strptime( + '2013-03-01 00:00:00', '%Y-%m-%d %H:%M:%S') + end_time = datetime.datetime.strptime( + '2016-06-30 23:00:00', '%Y-%m-%d %H:%M:%S') + num_day = (end_time - start_time).days + split_N = 10 + data = pd.read_pickle(data_file)[station] + feat = data[0][0:num_day] + feat = torch.tensor(feat, dtype=torch.float32) + feat_shape_1 = feat.shape[1] # 时间部 + feat = feat.reshape(-1, feat.shape[2]) + feat = feat + # num_day_new = feat.shape[0] + + selected = [0, 10] + candidate = [1, 2, 3, 4, 5, 6, 7, 8, 9] + start = 0 + + if num_domain in [2, 3, 5, 7, 10]: + while len(selected) - 2 < num_domain - 1: + distance_list = [] + for can in candidate: + selected.append(can) + selected.sort() + dis_temp = 0 + for i in range(1, len(selected) - 1): + for j in range(i, len(selected) - 1): + index_part1_start = start + math.floor(selected[i - 1] / split_N * num_day) * feat_shape_1 + index_part1_end = start + math.floor(selected[i] / split_N * num_day) * feat_shape_1 + feat_part1 = feat[index_part1_start: index_part1_end] + + index_part2_start = start + math.floor(selected[j] / split_N * num_day) * feat_shape_1 + index_part2_end = start + math.floor(selected[j + 1] / split_N * num_day) * feat_shape_1 + feat_part2 = feat[index_part2_start:index_part2_end] + criterion_transder = TransferLoss(loss_type=dis_type, input_dim=feat_part1.shape[1]) + dis_temp += criterion_transder.compute(feat_part1, feat_part2) + distance_list.append(dis_temp) + selected.remove(can) + can_index = distance_list.index(max(distance_list)) + selected.append(candidate[can_index]) + candidate.remove(candidate[can_index]) + selected.sort() + res = [] + for i in range(1, len(selected)): + if i == 1: + sel_start_time = start_time + datetime.timedelta(days=int(num_day / split_N * selected[i - 1]), hours=0) + else: + sel_start_time = start_time + datetime.timedelta(days=int(num_day / split_N * selected[i - 1]) + 1, + hours=0) + sel_end_time = start_time + datetime.timedelta(days=int(num_day / split_N * selected[i]), hours=23) + sel_start_time = datetime.datetime.strftime(sel_start_time, '%Y-%m-%d %H:%M') + sel_end_time = datetime.datetime.strftime(sel_end_time, '%Y-%m-%d %H:%M') + res.append((sel_start_time, sel_end_time)) + return res + else: + print("error in number of domain") + + +def load_weather_data_multi_domain(file_path, batch_size=6, station='Changping', number_domain=2, mode='pre_process', + dis_type='coral'): + # mode: 'tdc', 'pre_process' + data_file = os.path.join(file_path, "PRSA_Data_1.pkl") + mean_train, std_train = data_weather.get_weather_data_statistic(data_file, station=station, + start_time='2013-3-1 0:0', + end_time='2016-10-30 23:0') + split_time_list = get_split_time(number_domain, mode=mode, data_file=data_file, station=station, dis_type=dis_type) + train_list = [] + for i in range(len(split_time_list)): + time_temp = split_time_list[i] + train_loader = data_weather.get_weather_data(data_file, station=station, start_time=time_temp[0], + end_time=time_temp[1], batch_size=batch_size, mean=mean_train, + std=std_train) + train_list.append(train_loader) + + valid_vld_loader = data_weather.get_weather_data(data_file, station=station, start_time='2016-7-2 0:0', + end_time='2016-10-30 23:0', batch_size=batch_size, mean=mean_train, + std=std_train) + test_loader = data_weather.get_weather_data(data_file, station=station, start_time='2016-11-2 0:0', + end_time='2017-2-28 23:0', batch_size=batch_size, mean=mean_train, + std=std_train, shuffle=False) + return train_list, valid_vld_loader, test_loader diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_weather.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_weather.py new file mode 100644 index 0000000..3b8d5d2 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset/data_weather.py @@ -0,0 +1,141 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' + +import math +import matplotlib.pyplot as plt +import numpy as np +import pandas as pd +import os +from pandas.core.frame import DataFrame +from torch.utils.data import Dataset, DataLoader +import torch +import pickle +import datetime + + +class data_loader(Dataset): + def __init__(self, df_feature, df_label, df_label_reg, t=None): + + assert len(df_feature) == len(df_label) + assert len(df_feature) == len(df_label_reg) + + # df_feature = df_feature.reshape(df_feature.shape[0], df_feature.shape[1] // 6, df_feature.shape[2] * 6) + self.df_feature = df_feature + self.df_label = df_label + self.df_label_reg = df_label_reg + + self.T = t + self.df_feature = torch.tensor( + self.df_feature, dtype=torch.float32) + self.df_label = torch.tensor( + self.df_label, dtype=torch.float32) + self.df_label_reg = torch.tensor( + self.df_label_reg, dtype=torch.float32) + + def __getitem__(self, index): + sample, target, label_reg = self.df_feature[index], self.df_label[index], self.df_label_reg[index] + if self.T: + return self.T(sample), target + else: + return sample, target, label_reg + + def __len__(self): + return len(self.df_feature) + + +def create_dataset(df, station, start_date, end_date, mean=None, std=None): + data = df[station] + feat, label, label_reg = data[0], data[1], data[2] + referece_start_time = datetime.datetime(2013, 3, 1, 0, 0) + referece_end_time = datetime.datetime(2017, 2, 28, 0, 0) + + assert (pd.to_datetime(start_date) - referece_start_time).days >= 0 + assert (pd.to_datetime(end_date) - referece_end_time).days <= 0 + assert (pd.to_datetime(end_date) - pd.to_datetime(start_date)).days >= 0 + index_start = (pd.to_datetime(start_date) - referece_start_time).days + index_end = (pd.to_datetime(end_date) - referece_start_time).days + feat = feat[index_start: index_end + 1] + label = label[index_start: index_end + 1] + label_reg = label_reg[index_start: index_end + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return data_loader(feat, label, label_reg) + + +def create_dataset_shallow(df, station, start_date, end_date, mean=None, std=None): + data = df[station] + feat, label, label_reg = data[0], data[1], data[2] + referece_start_time = datetime.datetime(2013, 3, 1, 0, 0) + referece_end_time = datetime.datetime(2017, 2, 28, 0, 0) + + assert (pd.to_datetime(start_date) - referece_start_time).days >= 0 + assert (pd.to_datetime(end_date) - referece_end_time).days <= 0 + assert (pd.to_datetime(end_date) - pd.to_datetime(start_date)).days >= 0 + index_start = (pd.to_datetime(start_date) - referece_start_time).days + index_end = (pd.to_datetime(end_date) - referece_start_time).days + feat = feat[index_start: index_end + 1] + label = label[index_start: index_end + 1] + label_reg = label_reg[index_start: index_end + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return feat, label_reg + + +def get_dataset_statistic(df, station, start_date, end_date): + data = df[station] + feat, label = data[0], data[1] + referece_start_time = datetime.datetime(2013, 3, 1, 0, 0) + referece_end_time = datetime.datetime(2017, 2, 28, 0, 0) + + assert (pd.to_datetime(start_date) - referece_start_time).days >= 0 + assert (pd.to_datetime(end_date) - referece_end_time).days <= 0 + assert (pd.to_datetime(end_date) - pd.to_datetime(start_date)).days >= 0 + index_start = (pd.to_datetime(start_date) - referece_start_time).days + index_end = (pd.to_datetime(end_date) - referece_start_time).days + feat = feat[index_start: index_end + 1] + label = label[index_start: index_end + 1] + feat = feat.reshape(-1, feat.shape[2]) + mu_train = np.mean(feat, axis=0) + sigma_train = np.std(feat, axis=0) + + return mu_train, sigma_train + + +def get_weather_data(data_file, station, start_time, end_time, batch_size, shuffle=True, mean=None, std=None): + df = pd.read_pickle(data_file) + + dataset = create_dataset(df, station, start_time, + end_time, mean=mean, std=std) + train_loader = DataLoader( + dataset, batch_size=batch_size, shuffle=shuffle) + return train_loader + + +def get_weather_data_shallow(data_file, station, start_time, end_time, batch_size, shuffle=True, mean=None, std=None): + df = pd.read_pickle(data_file) + + feat, label_reg = create_dataset_shallow(df, station, start_time, + end_time, mean=mean, std=std) + + return feat, label_reg + + +def get_weather_data_statistic(data_file, station, start_time, end_time): + df = pd.read_pickle(data_file) + mean_train, std_train = get_dataset_statistic( + df, station, start_time, end_time) + return mean_train, std_train diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset/watchData.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset/watchData.py new file mode 100644 index 0000000..054f338 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset/watchData.py @@ -0,0 +1,26 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/16 14:53 +@Usage : +@Desc : +''' + +import pandas as pd + +data_file = 'G:\data\北京多站点空气质量数据集\PRSA_Data_1.pkl' +data = pd.read_pickle(data_file)['Tiantan'] + +feature, label, label_reg = data +print(data) + +import matplotlib.pyplot as plt + + +# plt.subplot(2,1,1) +# plt.plot(feature) +plt.subplot(2,1,2) + +plt.plot(label_reg) +plt.show() diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/__init__.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/__init__.py new file mode 100644 index 0000000..3e48d01 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/16 19:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/data_process.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/data_process.py new file mode 100644 index 0000000..44df906 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/data_process.py @@ -0,0 +1,111 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:35 +@Usage : +@Desc : +''' +# encoding=utf-8 + +import RUL.otherIdea.adaRNN.dataset_vibrate.data_vibrate as data_vibrate +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +from RUL.otherIdea.adaRNN.dataset_vibrate.loadData import getVibrate_data + +import torch +import math + + +def get_split_time(num_domain=2, mode='pre_process', data=None, dis_type='coral'): + spilt_time = { + '2': [(0, 600), (600, 1200)] + } + if mode == 'pre_process': + return spilt_time[str(num_domain)] + if mode == 'tdc': + return TDC(num_domain, data, dis_type=dis_type) + else: + print("error in mode") + + +def TDC(num_domain, data, dis_type='coral'): + # 样本个数 + num_day = len(data[0]) + + split_N = 10 + feat = data[0][0:num_day] + feat = torch.tensor(feat, dtype=torch.float32) + feat_shape_1 = feat.shape[1] # 时间部 + + feat = feat.reshape(-1, feat.shape[2]) + feat = feat + + selected = [0, 10] + candidate = [1, 2, 3, 4, 5, 6, 7, 8, 9] + start = 0 + + if num_domain in [2, 3, 5, 7, 10]: + while len(selected) - 2 < num_domain - 1: + distance_list = [] + for can in candidate: + selected.append(can) + selected.sort() + dis_temp = 0 + for i in range(1, len(selected) - 1): + for j in range(i, len(selected) - 1): + index_part1_start = start + math.floor(selected[i - 1] / split_N * num_day) * feat_shape_1 + index_part1_end = start + math.floor(selected[i] / split_N * num_day) * feat_shape_1 + feat_part1 = feat[index_part1_start: index_part1_end] + + index_part2_start = start + math.floor(selected[j] / split_N * num_day) * feat_shape_1 + index_part2_end = start + math.floor(selected[j + 1] / split_N * num_day) * feat_shape_1 + feat_part2 = feat[index_part2_start:index_part2_end] + criterion_transder = TransferLoss(loss_type=dis_type, input_dim=feat_part1.shape[1]) + dis_temp += criterion_transder.compute(feat_part1, feat_part2) + distance_list.append(dis_temp) + selected.remove(can) + can_index = distance_list.index(max(distance_list)) + selected.append(candidate[can_index]) + candidate.remove(candidate[can_index]) + selected.sort() + res = [] + for i in range(1, len(selected)): + if i == 1: + sel_start_index = int(num_day / split_N * selected[i - 1]) + else: + sel_start_index = int(num_day / split_N * selected[i - 1]) + 1 + + sel_end_index = int(num_day / split_N * selected[i]) + + res.append((sel_start_index, sel_end_index)) + return res + else: + print("error in number of domain") + + +def load_weather_data_multi_domain(hidden_num, feature, predict_num, batch_size=6, number_domain=2, mode='pre_process', + dis_type='coral', is_norm=False): + # mode: 'tdc', 'pre_process' + train_data, val_data = getVibrate_data(hidden_num=hidden_num, feature=feature, predict_num=predict_num, + is_norm=is_norm) + + split_time_list = get_split_time(number_domain, mode=mode, data=train_data, dis_type=dis_type) + train_list = [] + for i in range(len(split_time_list)): + index_temp = split_time_list[i] + train_loader = data_vibrate.get_vibrate_data(train_data, start_index=index_temp[0], + end_index=index_temp[1], batch_size=batch_size) + train_list.append(train_loader) + + valid_loader = data_vibrate.get_vibrate_data(val_data, start_index=0, + end_index=len(val_data[0]), batch_size=batch_size, mean=None, + std=None, shuffle=False) + test_loader = valid_loader + + return train_list, valid_loader, test_loader + + +if __name__ == '__main__': + load_weather_data_multi_domain(hidden_num=10, feature=10, predict_num=50, batch_size=32, number_domain=2, + mode='tdc', + dis_type='coral', is_norm=False) diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/data_vibrate.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/data_vibrate.py new file mode 100644 index 0000000..daded1e --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/data_vibrate.py @@ -0,0 +1,72 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:36 +@Usage : +@Desc : +''' + + +from torch.utils.data import Dataset, DataLoader +import torch + + + +class data_loader(Dataset): + def __init__(self, df_feature, df_label, df_label_reg, t=None): + + assert len(df_feature) == len(df_label) + assert len(df_feature) == len(df_label_reg) + + # df_feature = df_feature.reshape(df_feature.shape[0], df_feature.shape[1] // 6, df_feature.shape[2] * 6) + self.df_feature = df_feature + self.df_label = df_label + self.df_label_reg = df_label_reg + + self.T = t + self.df_feature = torch.tensor( + self.df_feature, dtype=torch.float32) + self.df_label = torch.tensor( + self.df_label, dtype=torch.float32) + self.df_label_reg = torch.tensor( + self.df_label_reg, dtype=torch.float32) + + def __getitem__(self, index): + sample, target, label_reg = self.df_feature[index], self.df_label[index], self.df_label_reg[index] + if self.T: + return self.T(sample), target, label_reg + else: + return sample, target, label_reg + + def __len__(self): + return len(self.df_feature) + + +def create_dataset(data, start_index, end_index, mean=None, std=None): + feat, label_continue, label_single = data[0], data[1], data[2] + referece_start_index = 0 + referece_end_index = 1250 + + assert start_index - referece_start_index >= 0 + assert end_index - referece_end_index <= 0 + assert end_index - start_index >= 0 + + feat = feat[start_index: end_index + 1] + label = label_continue[start_index: end_index + 1] + label_reg = label_single[start_index: end_index + 1] + + # ori_shape_1, ori_shape_2=feat.shape[1], feat.shape[2] + # feat=feat.reshape(-1, feat.shape[2]) + # feat=(feat - mean) / std + # feat=feat.reshape(-1, ori_shape_1, ori_shape_2) + + return data_loader(feat, label, label_reg) + + +def get_vibrate_data(data, start_index, end_index, batch_size, shuffle=True, mean=None, std=None): + dataset = create_dataset(data, start_index, + end_index, mean=mean, std=std) + train_loader = DataLoader( + dataset, batch_size=batch_size, shuffle=shuffle) + return train_loader diff --git a/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/loadData.py b/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/loadData.py new file mode 100644 index 0000000..dd3fa37 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/dataset_vibrate/loadData.py @@ -0,0 +1,150 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("E:\self_example\pytorch_example\RUL\dataset\HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + # HI_merge_data = np.loadtxt("E:\self_example\pytorch_example\RUL\dataset\smallVHI.csv", delimiter=",") + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset + + +def getVibrate_data(hidden_num, feature, predict_num, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + + + + return [train_data,train_label,train_label_single],[val_data,val_label,val_label_single] diff --git a/pytorch_example/RUL/otherIdea/adaRNN/loss_transfer.py b/pytorch_example/RUL/otherIdea/adaRNN/loss_transfer.py new file mode 100644 index 0000000..7e2798d --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/loss_transfer.py @@ -0,0 +1,64 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:45 +@Usage : +@Desc : +''' +from RUL.baseModel.loss import adv_loss, coral, kl_js, mmd, mutual_info, cos, pair_dist + + +class TransferLoss(object): + def __init__(self, loss_type='cosine', input_dim=512): + """ + Supported loss_type: mmd(mmd_lin), mmd_rbf, coral, cosine, kl, js, mine, adv + """ + self.loss_type = loss_type + self.input_dim = input_dim + + def compute(self, X, Y): + """Compute adaptation loss + + Arguments: + X {tensor} -- source matrix + Y {tensor} -- target matrix + + Returns: + [tensor] -- transfer loss + """ + if self.loss_type == 'mmd_lin' or self.loss_type == 'mmd': + mmdloss = mmd.MMD_loss(kernel_type='linear') + loss = mmdloss(X, Y) + elif self.loss_type == 'coral': + loss = coral.CORAL(X, Y) + elif self.loss_type == 'cosine' or self.loss_type == 'cos': + loss = 1 - cos.cosine(X, Y) + elif self.loss_type == 'kl': + loss = kl_js.kl_div(X, Y) + elif self.loss_type == 'js': + loss = kl_js.js(X, Y) + elif self.loss_type == 'mine': + mine_model = mutual_info.Mine_estimator( + input_dim=self.input_dim, hidden_dim=60) + loss = mine_model(X, Y) + elif self.loss_type == 'adv': + loss = adv_loss.adv(X, Y, input_dim=self.input_dim, hidden_dim=32) + elif self.loss_type == 'mmd_rbf': + mmdloss = mmd.MMD_loss(kernel_type='rbf') + loss = mmdloss(X, Y) + elif self.loss_type == 'pairwise': + pair_mat = pair_dist.pairwise_dist(X, Y) + import torch + loss = torch.norm(pair_mat) + + return loss + + +if __name__ == "__main__": + import torch + + trans_loss = TransferLoss('adv') + a = (torch.randn(5, 512) * 10) + b = (torch.randn(5, 512) * 10) + print(trans_loss.compute(a, b)) diff --git a/pytorch_example/RUL/otherIdea/adaRNN/model.py b/pytorch_example/RUL/otherIdea/adaRNN/model.py new file mode 100644 index 0000000..1889d6d --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/model.py @@ -0,0 +1,208 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 14:44 +@Usage : +@Desc : +''' +import torch +import torch.nn as nn +from RUL.otherIdea.adaRNN.loss_transfer import TransferLoss +import torch.nn.functional as F + + +class AdaRNN(nn.Module): + """ + model_type: 'Boosting', 'AdaRNN' + bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + """ + + def __init__(self, use_bottleneck=False, bottleneck_list=[(64,False,False,0),(64,True,True,0.5)], n_input=128, n_hiddens=[64, 64], n_output=6, + dropout=0.0, len_seq=9, model_type='AdaRNN', + trans_loss='mmd'): + super(AdaRNN, self).__init__() + self.use_bottleneck = use_bottleneck + self.n_input = n_input + self.num_layers = len(n_hiddens) + self.hiddens = n_hiddens + self.n_output = n_output + self.model_type = model_type + self.trans_loss = trans_loss + self.len_seq = len_seq + in_size = self.n_input + + features = nn.ModuleList() + for hidden in n_hiddens: + rnn = nn.GRU( + input_size=in_size, + num_layers=1, + hidden_size=hidden, + batch_first=True, + dropout=dropout + ) + features.append(rnn) + in_size = hidden + self.features = nn.Sequential(*features) + + if use_bottleneck == True: # finance + bottleneck =[] + for i in range(len(bottleneck_list)): + cur_input_dim = self.hiddens[-1] if i == 0 else bottleneck_list[i - 1][0] + bottleneck.append( + nn.Linear(cur_input_dim, bottleneck_list[i][0]) + ) + bottleneck[-1].weight.data.normal_(0, 0.05) + bottleneck[-1].bias.data.fill_(0.1) + if bottleneck_list[i][1]: + bottleneck.append(nn.BatchNorm1d(bottleneck_list[i][0])) + if bottleneck_list[i][2]: + bottleneck.append(nn.ReLU()) + if bottleneck_list[i][3] != 0: + bottleneck.append(nn.Dropout(bottleneck_list[i][3])) + self.bottleneck = nn.Sequential(*bottleneck) + self.fc = nn.Linear(bottleneck_list[-1][0], n_output) + + torch.nn.init.xavier_normal_(self.fc.weight) + else: + self.fc_out = nn.Linear(n_hiddens[-1], self.n_output) + + if self.model_type == 'AdaRNN': + gate = nn.ModuleList() + for i in range(len(n_hiddens)): + gate_weight = nn.Linear( + len_seq * self.hiddens[i] * 2, len_seq) + gate.append(gate_weight) + self.gate = gate + + bnlst = nn.ModuleList() + for i in range(len(n_hiddens)): + bnlst.append(nn.BatchNorm1d(len_seq)) + self.bn_lst = bnlst + self.softmax = torch.nn.Softmax(dim=0) + self.init_layers() + + def init_layers(self): + for i in range(len(self.hiddens)): + self.gate[i].weight.data.normal_(0, 0.05) + self.gate[i].bias.data.fill_(0.0) + + def forward_pre_train(self, x, len_win=0): + out = self.gru_features(x) + # 两层GRU之后的结果 + fea = out[0] + + if self.use_bottleneck == True: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + # 每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + out_list_all, out_weight_list = out[1], out[2] + # 可以理解为前半段 和 后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + h_start = 0 + for j in range(h_start, self.len_seq, 1): + i_start = max(j - len_win, 0) + i_end = j + len_win if j + len_win < self.len_seq else self.len_seq - 1 + for k in range(i_start, i_end + 1): + weight = out_weight_list[i][j] if self.model_type == 'AdaRNN' else 1 / ( + self.len_seq - h_start) * (2 * len_win + 1) + loss_transfer = loss_transfer + weight * criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, k, :]) + return fc_out, loss_transfer, out_weight_list + + def gru_features(self, x, predict=False): + x_input = x + out = None + out_lis = [] + out_weight_list = [] if ( + self.model_type == 'AdaRNN') else None + for i in range(self.num_layers): + # GRU的输出 + out, _ = self.features[i](x_input.float()) + x_input = out + out_lis.append(out) + if self.model_type == 'AdaRNN' and predict == False: + out_gate = self.process_gate_weight(x_input, i) + out_weight_list.append(out_gate) + # 两层GRU之后的结果,每层GRU之后的结果,每层GRU前后权重归一化之后的结果 + return out, out_lis, out_weight_list + + def process_gate_weight(self, out, index): + x_s = out[0: int(out.shape[0] // 2)] # 可以理解为前一半个batch_size的分布 域Di + x_t = out[out.shape[0] // 2: out.shape[0]] # 可以理解为后一半个batch_size的分布 域Dj + # 对应着不同的域 + x_all = torch.cat((x_s, x_t), 2) + x_all = x_all.view(x_all.shape[0], -1) + weight = torch.sigmoid(self.bn_lst[index]( + self.gate[index](x_all.float()))) + weight = torch.mean(weight, dim=0) + res = self.softmax(weight).squeeze() + return res + + def get_features(self, output_list): + fea_list_src, fea_list_tar = [], [] + for fea in output_list: + fea_list_src.append(fea[0: fea.size(0) // 2]) + fea_list_tar.append(fea[fea.size(0) // 2:]) + return fea_list_src, fea_list_tar + + # For Boosting-based + def forward_Boosting(self, x, weight_mat=None): + out = self.gru_features(x) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + out_list_all = out[1] + # 可以理解为前半段和后半段 + out_list_s, out_list_t = self.get_features(out_list_all) + loss_transfer = torch.zeros((1,)) + if weight_mat is None: + weight = (1.0 / self.len_seq * + torch.ones(self.num_layers, self.len_seq)) + else: + weight = weight_mat + dist_mat = torch.zeros(self.num_layers, self.len_seq) + for i in range(len(out_list_s)): + criterion_transder = TransferLoss( + loss_type=self.trans_loss, input_dim=out_list_s[i].shape[2]) + for j in range(self.len_seq): + loss_trans = criterion_transder.compute( + out_list_s[i][:, j, :], out_list_t[i][:, j, :]) + loss_transfer = loss_transfer + weight[i, j] * loss_trans + dist_mat[i, j] = loss_trans + return fc_out, loss_transfer, dist_mat, weight + + # For Boosting-based + def update_weight_Boosting(self, weight_mat, dist_old, dist_new): + epsilon = 1e-12 + dist_old = dist_old.detach() + dist_new = dist_new.detach() + ind = dist_new > dist_old + epsilon + weight_mat[ind] = weight_mat[ind] * \ + (1 + torch.sigmoid(dist_new[ind] - dist_old[ind])) + weight_norm = torch.norm(weight_mat, dim=1, p=1) + weight_mat = weight_mat / weight_norm.t().unsqueeze(1).repeat(1, self.len_seq) + return weight_mat + + def predict(self, x): + out = self.gru_features(x, predict=True) + fea = out[0] + + if self.use_bottleneck: + fea_bottleneck = self.bottleneck(fea[:, -1, :]) + fc_out = self.fc(fea_bottleneck).squeeze() + else: + fc_out = self.fc_out(fea[:, -1, :]).squeeze() + + return fc_out diff --git a/pytorch_example/RUL/otherIdea/adaRNN/test.py b/pytorch_example/RUL/otherIdea/adaRNN/test.py new file mode 100644 index 0000000..47b6626 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/test.py @@ -0,0 +1,117 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from RUL.otherIdea.LSTM.loadData import getDataset, getTotalData +from RUL.otherIdea.dctLSTM.model import PredictModel +from torch.utils.data import DataLoader +import matplotlib.pyplot as plt +from RUL.baseModel.plot import plot_forSelf,plot_prediction +from RUL.baseModel.loss.Evaluate import getEvaluate + + + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data[-1].unsqueeze(0) + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model.predict(each_predict_data).cpu().detach().numpy() # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + c = each_predict_data[-1, -1, 1:] + a = np.concatenate([each_predict_data[-1, -1, 1:], np.expand_dims(predicted_data, axis=0)], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.expand_dims(b, axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, model, is_single=True, is_norm=False, save_fig_name=""): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + # 衡量矩阵 + train_list = [] + easy_list = [] + val_label = [] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + train_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = model.predict(data).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + easy_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + val_label = np.concatenate( + [val_label, label.cpu().detach().numpy()], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predict_hard = predictOneByOne(model, last_train_data, predict_num=predict_num) + predicted_data_hard = np.concatenate([predicted_data_hard, + predict_hard], axis=0) + ####衡量 + train_evaluate = np.mean(train_list, axis=0) + easy_evaluate = np.mean(easy_list, axis=0) + hard_evaluate = getEvaluate(val_label, predict_hard) + print('train: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (train_evaluate[0], train_evaluate[1], train_evaluate[2], train_evaluate[3])) + print('easy: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (easy_evaluate[0], easy_evaluate[1], easy_evaluate[2], easy_evaluate[3])) + print('hard: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (hard_evaluate[0], hard_evaluate[1], hard_evaluate[2], hard_evaluate[3])) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name, predict_num=predict_num) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\outputs\AdaRNN_tdcLoss(cos)_transferLoss(cos)_dw0.5_lr0.0005\parameters\AdaRNN_hidden24_feature10_predict50_dimList64-64_epoch62_trainLoss0.5115623474121094_valLoss0.12946119904518127.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/adaRNN/train.py b/pytorch_example/RUL/otherIdea/adaRNN/train.py new file mode 100644 index 0000000..5a829c0 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/train.py @@ -0,0 +1,467 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:32 +@Usage : +@Desc : +''' +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np +import random +from tqdm import tqdm +import RUL.baseModel.utils.utils as utils +from RUL.otherIdea.adaRNN.model import AdaRNN + +import RUL.otherIdea.adaRNN.dataset_vibrate.data_process as data_process +from RUL.otherIdea.adaRNN.test import test +import matplotlib.pyplot as plt +import time +from RUL.baseModel.CommonFunction import IsStopTraining + +''' +超参数设置: +''' +# 数据准备 +is_norm = False +is_single = True +tdc_loss_type = 'cos' +num_domain = 2 # 划分为几个源域和目标域 + +# RNN相关 +hidden_num = 10 # LSTM细胞个数 +feature = 2 # 一个点的维度 +predict_num = 200 # 预测个数 +batch_size = 32 +model_name = "AdaRNN" +hidden_list = [64, 64] # 每层RNN的隐藏层的维度 +bottleneck = [(64, False, False, 0), (64, True, True, 0.5)] +# bottleneck = [(128, False, True, 0), +# (64, True, True, 0.2), +# (32, True, True, 0.2), +# (16, False, False, 0)] + +# 训练相关 +pre_epoch = 40 +epochs = 1000 +transfer_loss_type = 'cos' +dw = 0.5 +lr = 0.01 +len_win = 0 # 窗口大小,为0,暂时不知道有什么用 +seed = 5 + +# 相关初始化工作 +out_dir = './outputs' +output_path = out_dir + '/{0}_tdcLoss({1})_transferLoss({2})_domain{3}_dw{4}_lr{5}'.format(model_name, tdc_loss_type, + transfer_loss_type, + num_domain, + dw, lr) +save_model_name = 'parameters/{0}_hidden{1}_feature{2}_predict{3}_dimList{4}'.format(model_name, hidden_num, + feature, + predict_num, + str(hidden_list[0]) + "-" + str( + hidden_list[1])) +save_fig_name = 'fig/{0}_hidden{1}_feature{2}_predict{3}_dimList{4}.png'.format(model_name, hidden_num, + feature, + predict_num, + str(hidden_list[0]) + "-" + str( + hidden_list[1])) +utils.dir_exist(output_path) +utils.dir_exist(os.path.join(output_path, 'parameters')) +utils.dir_exist(os.path.join(output_path, 'fig')) +log_file = os.path.join(output_path, 'run.log') + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if log_file is None: + return + with open(log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + # 经过测试,整体来说,如果加了bottleneck,整体更愿意振动,而不加整体仅存在趋势 + # bottleneck_list: (dim,is_BatchNorm,is_ReLu,drop_out) + + return AdaRNN(use_bottleneck=True, bottleneck_list=bottleneck, n_input=feature, n_hiddens=hidden_list, + n_output=1, dropout=0.0, model_type=name, len_seq=hidden_num, + trans_loss=transfer_loss_type) + + +def train_AdaRNN(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(len(hidden_list), hidden_num) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + + # 如果训练集域之间的batch_size对不齐就没法计算, + # 为了不抛弃所有样本,这里将选择最小的域batch_size作为本轮的batch_size + min_batch_size = 10000 + for data in data_all: + min_batch_size = min(min_batch_size, data[0].shape[0]) + + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].float(), data[2].float() + list_feat.append(feature[:min_batch_size]) + list_label.append(label_reg[:min_batch_size]) + + index = get_index(len(data_all) - 1) + + loss_mse = torch.zeros(1) + loss_transfer = torch.zeros(1) + total_loss_l1 = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + # 在batch_size处合并 + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < pre_epoch: + pred_all, each_loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=len_win) + else: + pred_all, each_loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + loss_mse += loss_s + loss_t + loss_transfer += dw * each_loss_transfer + total_loss_l1 += loss_l1 + + total_loss = loss_mse + loss_transfer + loss_all.append([total_loss.item(), loss_mse.item(), loss_transfer.item()]) + loss_1_all.append(total_loss_l1.item()) + + # 反向传播 + total_loss.backward() + # 梯度裁剪,梯度最大范数为3 + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + + if epoch >= pre_epoch: + if epoch > pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def val_epoch(model, val_loader, device, scheduler): + model.eval() + val_loss = 0 + val_loss_1 = 0 + val_loss_r = 0 + + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_continue, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = model.predict(val_data) + + loss = criterion(val_predict_data, val_label) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(val_predict_data, val_label) + val_loss += loss.item() + val_loss_1 += loss_1.item() + val_loss_r += loss_r.item() + + # scheduler.step(val_loss) + + loss = val_loss / len(val_loader) + loss_1 = val_loss_1 / len(val_loader) + loss_r = val_loss_r / len(val_loader) + + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(len(hidden_list), hidden_num) + for i in range(weight.shape[0]): + for j in range(weight.shape[1]): + weight[i, j] = init_weight[i][j].item() + return weight + + +def loadData(): + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_norm=is_norm, batch_size=batch_size, + number_domain=num_domain, mode='tdc', dis_type=tdc_loss_type + ) + return train_loader_list, valid_loader, test_loader + pass + + +def train(model, train_loader_list, valid_loader, lr_patience, early_stop_patience, device): + optimizer = optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer, mode="min", factor=0.2, + patience=lr_patience) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + train_loss_list = [] + val_loss_list = [] + best_save_path = None + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss, loss1, weight_mat, dist_mat = train_AdaRNN( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + + val_loss, val_loss_l1, val_loss_r = val_epoch( + model, valid_loader, device=device, scheduler=scheduler_model) + + pprint( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_total_loss: {:3.9f} | train_mse_loss: {:3.9f} | train_transfer_loss: {:3.9f} " + " | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss[0], train_loss[1], train_loss[2], + val_loss, + optimizer.state_dict()['param_groups'][0]['lr'])) + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + pprint("保存模型最佳模型成功") + best_epoch = epoch + best_score = val_loss + # 保存模型参数 + if best_save_path != None: + utils.delete_file(best_save_path) + best_save_path = save_model_name + "_epoch" + str(epoch) + \ + "_trainLoss" + str(train_loss[1]) + \ + "_valLoss" + str(val_loss) + ".pkl" + print(os.path.join(output_path, best_save_path)) + torch.save(model.state_dict(), + os.path.join(output_path, best_save_path)) + + train_loss_list.append(train_loss) + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + pprint("{0}次loss未下降,训练停止".format(early_stop_patience)) + break + + pprint('best val score:', best_score, '@', best_epoch) + return best_save_path + pass + + +def main_transfer(): + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + pprint('create DataLoaders...') + train_loader_list, valid_loader, test_loader = loadData() + + pprint('create AdaRNN model...') + model = get_model(model_name) + + num_model = count_parameters(model) + + print(model) + print('#model params:', num_model) + + pprint('train model...') + best_save_path = train(model=model, train_loader_list=train_loader_list, valid_loader=valid_loader, lr_patience=20, + early_stop_patience=50, device=device) + + end = time.time() + + print("训练耗时:{:3.2f}s".format(end - begin)) + + pprint('验证模型...') + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, best_save_path), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load(os.path.join(output_path, best_save_path), map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm, save_fig_name=os.path.join(output_path, save_fig_name)) + + +def after_test(save_name): + model = get_model(model_name) + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + + model.load_state_dict(torch.load( + save_name + , map_location=device)) + + test(hidden_num=hidden_num, feature=feature, predict_num=predict_num, batch_size=batch_size, model=model, + is_single=is_single, is_norm=is_norm) + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=feature) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='cos') + + parser.add_argument('--data_mode', type=str, default='tdc') + + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=hidden_num) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\dataset/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + # 训练与测试 + main_transfer() + + '''事后测试''' + # after_test(save_name="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\outputs\AdaRNN_tdcLoss(cos)_transferLoss(cos)_domain2_dw0.5_lr0.0005\parameters\AdaRNN_hidden24_feature10_predict50_dimList64-64_epoch62_trainLoss0.5115623474121094_valLoss0.12946119904518127.pkl") diff --git a/pytorch_example/RUL/otherIdea/adaRNN/train_vibrate.py b/pytorch_example/RUL/otherIdea/adaRNN/train_vibrate.py new file mode 100644 index 0000000..994f340 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/train_vibrate.py @@ -0,0 +1,423 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:32 +@Usage : +@Desc : +''' +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np + +from tqdm import tqdm +from RUL.otherIdea.adaRNN.utils import utils +from RUL.otherIdea.adaRNN.model import AdaRNN + +import RUL.otherIdea.adaRNN.dataset_vibrate.data_process as data_process +import matplotlib.pyplot as plt + +''' +超参数设置: +''' +hidden_num = 40 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 32 +EPOCH = 1000 +predict_num = 50 # 预测个数 +is_norm = False +is_single = True +model_name = "dctLSTM" + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if args.log_file is None: + return + with open(args.log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + n_hiddens = [args.hidden_size for i in range(args.num_layers)] + return AdaRNN(use_bottleneck=True, bottleneck_width=64, n_input=feature, n_hiddens=n_hiddens, + n_output=args.class_num, dropout=args.dropout, model_type=name, len_seq=hidden_num, + trans_loss=args.loss_type) + + +def train_AdaRNN(args, model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(args.num_layers, args.len_seq) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].long(), data[2].float() + list_feat.append(feature) + list_label.append(label_reg) + flag = False + index = get_index(len(data_all) - 1) + for temp_index in index: + s1 = temp_index[0] + s2 = temp_index[1] + if list_feat[s1].shape[0] != list_feat[s2].shape[0]: + flag = True + break + if flag: + continue + + total_loss = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < args.pre_epoch: + pred_all, loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=args.len_win) + else: + pred_all, loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + total_loss = total_loss + loss_s + loss_t + args.dw * loss_transfer + loss_all.append( + [total_loss.item(), (loss_s + loss_t).item(), loss_transfer.item()]) + loss_1_all.append(loss_l1.item()) + optimizer.zero_grad() + total_loss.backward() + # 梯度裁剪,梯度最大范数为3 + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + if epoch >= args.pre_epoch: + if epoch > args.pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def train_epoch_transfer_Boosting(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(args.num_layers, args.len_seq) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].long(), data[2].float() + list_feat.append(feature) + list_label.append(label_reg) + flag = False + index = get_index(len(data_all) - 1) + for temp_index in index: + s1 = temp_index[0] + s2 = temp_index[1] + if list_feat[s1].shape[0] != list_feat[s2].shape[0]: + flag = True + break + if flag: + continue + + total_loss = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + feature_all = torch.cat((feature_s, feature_t), 0) + + pred_all, loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + total_loss = total_loss + loss_s + loss_t + args.dw * loss_transfer + + loss_all.append( + [total_loss.item(), (loss_s + loss_t).item(), loss_transfer.item()]) + loss_1_all.append(loss_l1.item()) + optimizer.zero_grad() + total_loss.backward() + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + if epoch > 0: # args.pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def test_epoch(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = loss_r / len(test_loader) + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(args.num_layers, args.len_seq) + for i in range(args.num_layers): + for j in range(args.len_seq): + weight[i, j] = init_weight[i][j].item() + return weight + + +def main_transfer(args): + print(args) + + output_path = args.outdir + '_' + args.station + '_' + args.model_name + '_vibrate_' + \ + args.loss_type + '_' + str(args.pre_epoch) + \ + '_' + str(args.dw) + '_' + str(args.lr) + save_model_name = args.model_name + '_' + args.loss_type + \ + '_' + str(args.dw) + '_' + str(args.lr) + '.pkl' + utils.dir_exist(output_path) + pprint('create loaders...') + + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_norm=is_norm, batch_size=args.batch_size, + number_domain=args.num_domain, mode=args.data_mode + ) + + args.log_file = os.path.join(output_path, 'run.log') + pprint('create model...') + model = get_model(args.model_name) + num_model = count_parameters(model) + print('#model params:', num_model) + + optimizer = optim.Adam(model.parameters(), lr=args.lr) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + + for epoch in range(args.n_epochs): + pprint('Epoch:', epoch) + pprint('training...') + if args.model_name in ['Boosting']: + loss, loss1, weight_mat, dist_mat = train_epoch_transfer_Boosting( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + elif args.model_name in ['AdaRNN']: + loss, loss1, weight_mat, dist_mat = train_AdaRNN( + args, model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + else: + print("error in model_name!") + pprint(loss, loss1) + + pprint('evaluating...') + train_loss, train_loss_l1, train_loss_r = test_epoch( + model, train_loader_list[0], prefix='Train') + val_loss, val_loss_l1, val_loss_r = test_epoch( + model, valid_loader, prefix='Valid') + test_loss, test_loss_l1, test_loss_r = test_epoch( + model, test_loader, prefix='Test') + + pprint('valid %.6f, test %.6f' % + (val_loss_l1, test_loss_l1)) + + if val_loss < best_score: + best_score = val_loss + stop_round = 0 + best_epoch = epoch + torch.save(model.state_dict(), os.path.join( + output_path, save_model_name)) + else: + stop_round += 1 + if stop_round >= args.early_stop: + pprint('early stop') + break + + pprint('best val score:', best_score, '@', best_epoch) + + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, save_model_name), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=6) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='cos') + parser.add_argument('--station', type=str, default='Dongsi') + parser.add_argument('--data_mode', type=str, + default='tdc') + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=hidden_num) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\dataset/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + args = get_args() + np.random.seed(args.seed) + torch.manual_seed(args.seed) + torch.cuda.manual_seed_all(args.seed) + torch.backends.cudnn.deterministic = True + torch.backends.cudnn.benchmark = False + os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu_id) + main_transfer(args) diff --git a/pytorch_example/RUL/otherIdea/adaRNN/train_weather.py b/pytorch_example/RUL/otherIdea/adaRNN/train_weather.py new file mode 100644 index 0000000..5913df6 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/train_weather.py @@ -0,0 +1,472 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:32 +@Usage : +@Desc : +''' +import torch.nn as nn +import torch +import torch.optim as optim + +import os +import argparse +import datetime +import numpy as np + +from tqdm import tqdm +from RUL.otherIdea.adaRNN.utils import utils +from RUL.otherIdea.adaRNN.model import AdaRNN + + +import RUL.otherIdea.adaRNN.dataset.data_process as data_process +import matplotlib.pyplot as plt + + +def pprint(*text): + # print with UTC+8 time + time = '[' + str(datetime.datetime.utcnow() + + datetime.timedelta(hours=8))[:19] + '] -' + print(time, *text, flush=True) + if args.log_file is None: + return + with open(args.log_file, 'a') as f: + print(time, *text, flush=True, file=f) + + +def get_model(name='AdaRNN'): + n_hiddens = [args.hidden_size for i in range(args.num_layers)] + return AdaRNN(use_bottleneck=True, bottleneck_width=64, n_input=args.d_feat, n_hiddens=n_hiddens, + n_output=args.class_num, dropout=args.dropout, model_type=name, len_seq=args.len_seq, + trans_loss=args.loss_type) + + +def train_AdaRNN(args, model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(args.num_layers, args.len_seq) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].long(), data[2].float() + list_feat.append(feature) + list_label.append(label_reg) + flag = False + index = get_index(len(data_all) - 1) + for temp_index in index: + s1 = temp_index[0] + s2 = temp_index[1] + if list_feat[s1].shape[0] != list_feat[s2].shape[0]: + flag = True + break + if flag: + continue + + total_loss = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + feature_all = torch.cat((feature_s, feature_t), 0) + + if epoch < args.pre_epoch: + pred_all, loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=args.len_win) + else: + pred_all, loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + total_loss = total_loss + loss_s + loss_t + args.dw * loss_transfer + loss_all.append( + [total_loss.item(), (loss_s + loss_t).item(), loss_transfer.item()]) + loss_1_all.append(loss_l1.item()) + optimizer.zero_grad() + total_loss.backward() + # 梯度裁剪,梯度最大范数为3 + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + if epoch >= args.pre_epoch: + if epoch > args.pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + else: + weight_mat = transform_type(out_weight_list) + return loss, loss_l1, weight_mat, None + + +def train_epoch_transfer_Boosting(model, optimizer, train_loader_list, epoch, dist_old=None, weight_mat=None): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + dist_mat = torch.zeros(args.num_layers, args.len_seq) + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].long(), data[2].float() + list_feat.append(feature) + list_label.append(label_reg) + flag = False + index = get_index(len(data_all) - 1) + for temp_index in index: + s1 = temp_index[0] + s2 = temp_index[1] + if list_feat[s1].shape[0] != list_feat[s2].shape[0]: + flag = True + break + if flag: + continue + + total_loss = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + feature_all = torch.cat((feature_s, feature_t), 0) + + pred_all, loss_transfer, dist, weight_mat = model.forward_Boosting( + feature_all, weight_mat) + dist_mat = dist_mat + dist + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + total_loss = total_loss + loss_s + loss_t + args.dw * loss_transfer + + loss_all.append( + [total_loss.item(), (loss_s + loss_t).item(), loss_transfer.item()]) + loss_1_all.append(loss_l1.item()) + optimizer.zero_grad() + total_loss.backward() + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + if epoch > 0: # args.pre_epoch: + weight_mat = model.update_weight_Boosting( + weight_mat, dist_old, dist_mat) + return loss, loss_l1, weight_mat, dist_mat + + +def get_index(num_domain=2): + index = [] + for i in range(num_domain): + for j in range(i + 1, num_domain + 1): + index.append((i, j)) + return index + + +def train_epoch_transfer(args, model, optimizer, train_loader_list): + model.train() + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + loss_all = [] + loss_1_all = [] + len_loader = np.inf + for loader in train_loader_list: + if len(loader) < len_loader: + len_loader = len(loader) + + for data_all in tqdm(zip(*train_loader_list), total=len_loader): + optimizer.zero_grad() + list_feat = [] + list_label = [] + for data in data_all: + feature, label, label_reg = data[0].float( + ), data[1].long(), data[2].float() + list_feat.append(feature) + list_label.append(label_reg) + flag = False + index = get_index(len(data_all) - 1) + for temp_index in index: + s1 = temp_index[0] + s2 = temp_index[1] + if list_feat[s1].shape[0] != list_feat[s2].shape[0]: + flag = True + break + if flag: + continue + + ############### + total_loss = torch.zeros(1) + for i in range(len(index)): + feature_s = list_feat[index[i][0]] + feature_t = list_feat[index[i][1]] + label_reg_s = list_label[index[i][0]] + label_reg_t = list_label[index[i][1]] + feature_all = torch.cat((feature_s, feature_t), 0) + + pred_all, loss_transfer, out_weight_list = model.forward_pre_train( + feature_all, len_win=args.len_win) + pred_s = pred_all[0:feature_s.size(0)] + pred_t = pred_all[feature_s.size(0):] + + loss_s = criterion(pred_s, label_reg_s) + loss_t = criterion(pred_t, label_reg_t) + loss_l1 = criterion_1(pred_s, label_reg_s) + + total_loss = total_loss + loss_s + loss_t + args.dw * loss_transfer + loss_all.append( + [total_loss.item(), (loss_s + loss_t).item(), loss_transfer.item()]) + loss_1_all.append(loss_l1.item()) + optimizer.zero_grad() + total_loss.backward() + torch.nn.utils.clip_grad_value_(model.parameters(), 3.) + optimizer.step() + loss = np.array(loss_all).mean(axis=0) + loss_l1 = np.array(loss_1_all).mean() + return loss, loss_l1, out_weight_list + + +def count_parameters(model): + return sum(p.numel() for p in model.parameters() if p.requires_grad) + + +def test_epoch(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = loss_r / len(test_loader) + return loss, loss_1, loss_r + + +def test_epoch_inference(model, test_loader, prefix='Test'): + model.eval() + total_loss = 0 + total_loss_1 = 0 + total_loss_r = 0 + correct = 0 + criterion = nn.MSELoss() + criterion_1 = nn.L1Loss() + i = 0 + for feature, label, label_reg in tqdm(test_loader, desc=prefix, total=len(test_loader)): + feature, label_reg = feature.float(), label_reg.float() + with torch.no_grad(): + pred = model.predict(feature) + loss = criterion(pred, label_reg) + loss_r = torch.sqrt(loss) + loss_1 = criterion_1(pred, label_reg) + total_loss += loss.item() + total_loss_1 += loss_1.item() + total_loss_r += loss_r.item() + if i == 0: + label_list = label_reg.cpu().numpy() + predict_list = pred.cpu().numpy() + else: + label_list = np.hstack((label_list, label_reg.cpu().numpy())) + predict_list = np.hstack((predict_list, pred.cpu().numpy())) + + i = i + 1 + loss = total_loss / len(test_loader) + loss_1 = total_loss_1 / len(test_loader) + loss_r = total_loss_r / len(test_loader) + return loss, loss_1, loss_r, label_list, predict_list + + +def inference(model, data_loader): + loss, loss_1, loss_r, label_list, predict_list = test_epoch_inference( + model, data_loader, prefix='Inference') + return loss, loss_1, loss_r, label_list, predict_list + + +def inference_all(output_path, model, model_path, loaders): + pprint('inference...') + loss_list = [] + loss_l1_list = [] + loss_r_list = [] + model.load_state_dict(torch.load(model_path)) + i = 0 + list_name = ['train', 'valid', 'test'] + for loader in loaders: + loss, loss_1, loss_r, label_list, predict_list = inference( + model, loader) + loss_list.append(loss) + loss_l1_list.append(loss_1) + loss_r_list.append(loss_r) + i = i + 1 + return loss_list, loss_l1_list, loss_r_list + + +def transform_type(init_weight): + weight = torch.ones(args.num_layers, args.len_seq) + for i in range(args.num_layers): + for j in range(args.len_seq): + weight[i, j] = init_weight[i][j].item() + return weight + + +def main_transfer(args): + print(args) + + output_path = args.outdir + '_' + args.station + '_' + args.model_name + '_weather_' + \ + args.loss_type + '_' + str(args.pre_epoch) + \ + '_' + str(args.dw) + '_' + str(args.lr) + save_model_name = args.model_name + '_' + args.loss_type + \ + '_' + str(args.dw) + '_' + str(args.lr) + '.pkl' + utils.dir_exist(output_path) + pprint('create loaders...') + + train_loader_list, valid_loader, test_loader = data_process.load_weather_data_multi_domain( + args.data_path, args.batch_size, args.station, args.num_domain, args.data_mode) + + args.log_file = os.path.join(output_path, 'run.log') + pprint('create model...') + model = get_model(args.model_name) + num_model = count_parameters(model) + print('#model params:', num_model) + + optimizer = optim.Adam(model.parameters(), lr=args.lr) + + best_score = np.inf + best_epoch, stop_round = 0, 0 + weight_mat, dist_mat = None, None + + for epoch in range(args.n_epochs): + pprint('Epoch:', epoch) + pprint('training...') + if args.model_name in ['Boosting']: + loss, loss1, weight_mat, dist_mat = train_epoch_transfer_Boosting( + model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + elif args.model_name in ['AdaRNN']: + loss, loss1, weight_mat, dist_mat = train_AdaRNN( + args, model, optimizer, train_loader_list, epoch, dist_mat, weight_mat) + else: + print("error in model_name!") + pprint(loss, loss1) + + pprint('evaluating...') + train_loss, train_loss_l1, train_loss_r = test_epoch( + model, train_loader_list[0], prefix='Train') + val_loss, val_loss_l1, val_loss_r = test_epoch( + model, valid_loader, prefix='Valid') + test_loss, test_loss_l1, test_loss_r = test_epoch( + model, test_loader, prefix='Test') + + pprint('valid %.6f, test %.6f' % + (val_loss_l1, test_loss_l1)) + + if val_loss < best_score: + best_score = val_loss + stop_round = 0 + best_epoch = epoch + torch.save(model.state_dict(), os.path.join( + output_path, save_model_name)) + else: + stop_round += 1 + if stop_round >= args.early_stop: + pprint('early stop') + break + + pprint('best val score:', best_score, '@', best_epoch) + + loaders = train_loader_list[0], valid_loader, test_loader + loss_list, loss_l1_list, loss_r_list = inference_all(output_path, model, os.path.join( + output_path, save_model_name), loaders) + pprint('MSE: train %.6f, valid %.6f, test %.6f' % + (loss_list[0], loss_list[1], loss_list[2])) + pprint('L1: train %.6f, valid %.6f, test %.6f' % + (loss_l1_list[0], loss_l1_list[1], loss_l1_list[2])) + pprint('RMSE: train %.6f, valid %.6f, test %.6f' % + (loss_r_list[0], loss_r_list[1], loss_r_list[2])) + pprint('Finished.') + + +def get_args(): + parser = argparse.ArgumentParser() + + # model + parser.add_argument('--model_name', default='AdaRNN') + parser.add_argument('--d_feat', type=int, default=6) + + parser.add_argument('--hidden_size', type=int, default=64) + parser.add_argument('--num_layers', type=int, default=2) + parser.add_argument('--dropout', type=float, default=0.0) + parser.add_argument('--class_num', type=int, default=1) + parser.add_argument('--pre_epoch', type=int, default=40) # 20, 30, 50 + + # training + parser.add_argument('--n_epochs', type=int, default=200) + parser.add_argument('--lr', type=float, default=5e-4) + parser.add_argument('--early_stop', type=int, default=40) + parser.add_argument('--smooth_steps', type=int, default=5) + parser.add_argument('--batch_size', type=int, default=36) + parser.add_argument('--dw', type=float, default=0.5) # 0.01, 0.05, 5.0 + parser.add_argument('--loss_type', type=str, default='adv') + parser.add_argument('--station', type=str, default='Dongsi') + parser.add_argument('--data_mode', type=str, + default='tdc') + parser.add_argument('--num_domain', type=int, default=2) + parser.add_argument('--len_seq', type=int, default=24) + + # other + parser.add_argument('--seed', type=int, default=10) + parser.add_argument('--data_path', default="E:\self_example\pytorch_example\RUL\otherIdea/adaRNN\dataset/") + parser.add_argument('--outdir', default='./outputs') + parser.add_argument('--overwrite', action='store_true') + parser.add_argument('--log_file', type=str, default='run.log') + parser.add_argument('--gpu_id', type=int, default=0) + parser.add_argument('--len_win', type=int, default=0) + args = parser.parse_args() + + return args + + +if __name__ == '__main__': + args = get_args() + np.random.seed(args.seed) + torch.manual_seed(args.seed) + torch.cuda.manual_seed_all(args.seed) + torch.backends.cudnn.deterministic = True + torch.backends.cudnn.benchmark = False + os.environ["CUDA_VISIBLE_DEVICES"] = str(args.gpu_id) + main_transfer(args) \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaRNN/utils/__init__.py b/pytorch_example/RUL/otherIdea/adaRNN/utils/__init__.py new file mode 100644 index 0000000..4e22673 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/utils/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/adaRNN/utils/utils.py b/pytorch_example/RUL/otherIdea/adaRNN/utils/utils.py new file mode 100644 index 0000000..08b396e --- /dev/null +++ b/pytorch_example/RUL/otherIdea/adaRNN/utils/utils.py @@ -0,0 +1,225 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 16:33 +@Usage : +@Desc : +''' + +import collections +import torch +import os +import pandas as pd +import torch.nn as nn +from tqdm import tqdm +import numpy as np + +EPS = 1e-12 + + +class AverageMeter(object): + def __init__(self): + self.reset() + + def reset(self): + self.val = 0 + self.avg = 0 + self.sum = 0 + self.count = 0 + self.list = [] + + def update(self, val, n=1): + self.val = val + self.list.append(val) + self.sum += val * n + self.count += n + self.avg = self.sum / self.count + + +def average_params(params_list): + assert isinstance(params_list, (tuple, list, collections.deque)) + n = len(params_list) + if n == 1: + return params_list[0] + new_params = collections.OrderedDict() + keys = None + for i, params in enumerate(params_list): + if keys is None: + keys = params.keys() + for k, v in params.items(): + if k not in keys: + raise ValueError('the %d-th model has different params' % i) + if k not in new_params: + new_params[k] = v / n + else: + new_params[k] += v / n + return new_params + + +def zscore(x): + return (x - x.mean(dim=0, keepdim=True)) / x.std(dim=0, keepdim=True, unbiased=False) + + +def calc_loss(pred, label): + return torch.mean((zscore(pred) - label) ** 2) + + +def calc_corr(pred, label): + return (zscore(pred) * zscore(label)).mean() + + +def test_ic(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = label_actual.clone().detach().view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_daily(model_list, data_list, device, verbose=True, ic_type='spearman'): + ''' + model_list: [model1, model2, ...] + datalist: [loader1, loader2, ...] + return: unified ic, specific ic (all values + avg), loss + ''' + spec_ic = [] + loss_test = AverageMeter() + loss_fn = torch.nn.MSELoss() + label_true, label_pred = torch.empty(0).to(device), torch.empty(0).to(device) + for i in range(len(model_list)): + label_spec_true, label_spec_pred = torch.empty(0).to(device), torch.empty(0).to(device) + model_list[i].eval() + with torch.no_grad(): + for slc in tqdm(data_list[i].iter_daily(), total=data_list[i].daily_length): + feature, label_actual, _, _ = data_list[i].get(slc) + # for _, (feature, label_actual, _, _) in enumerate(data_list[i]): + # feature = torch.tensor(feature, dtype=torch.float32, device=device) + label_actual = torch.tensor(label_actual, dtype=torch.float32, device=device).view(-1, 1) + label_actual, mask = handle_nan(label_actual) + label_predict = model_list[i].predict(feature).view(-1, 1) + label_predict = label_predict[mask] + loss = loss_fn(label_actual, label_predict) + loss_test.update(loss.item()) + # Concat them for computing IC later + label_true = torch.cat([label_true, label_actual]) + label_pred = torch.cat([label_pred, label_predict]) + label_spec_true = torch.cat([label_spec_true, label_actual]) + label_spec_pred = torch.cat([label_spec_pred, label_predict]) + ic = calc_ic(label_spec_true, label_spec_pred, ic_type) + spec_ic.append(ic.item()) + unify_ic = calc_ic(label_true, label_pred, ic_type).item() + # spec_ic.append(sum(spec_ic) / len(spec_ic)) + loss = loss_test.avg + if verbose: + print('[IC] Unified IC: {:.6f}, specific IC: {}, loss: {:.6f}'.format(unify_ic, spec_ic, loss)) + return unify_ic, spec_ic, loss + + +def test_ic_uni(model, data_loader, model_path=None, ic_type='spearman', verbose=False): + if model_path: + model.load_state_dict(torch.load(model_path)) + model.eval() + loss_all = [] + ic_all = [] + for slc in tqdm(data_loader.iter_daily(), total=data_loader.daily_length): + data, label, _, _ = data_loader.get(slc) + with torch.no_grad(): + pred = model.predict(data) + mask = ~torch.isnan(label) + pred = pred[mask] + label = label[mask] + loss = torch.mean(torch.log(torch.cosh(pred - label))) + if ic_type == 'spearman': + ic = spearman_corr(pred, label) + elif ic_type == 'pearson': + ic = pearson_corr(pred, label) + loss_all.append(loss.item()) + ic_all.append(ic) + loss, ic = np.mean(loss_all), np.mean(ic_all) + if verbose: + print('IC: ', ic) + return loss, ic + + +def calc_ic(x, y, ic_type='pearson'): + ic = -100 + if ic_type == 'pearson': + ic = pearson_corr(x, y) + elif ic_type == 'spearman': + ic = spearman_corr(x, y) + return ic + + +def create_dir(path): + if not os.path.exists(path): + os.makedirs(path) + + +def handle_nan(x): + mask = ~torch.isnan(x) + return x[mask], mask + + +class Log_Loss(nn.Module): + def __init__(self): + super(Log_Loss, self).__init__() + + def forward(self, ytrue, ypred): + delta = ypred - ytrue + return torch.mean(torch.log(torch.cosh(delta))) + + +def spearman_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='spearman') + return spearman + + +def spearman_corr2(x, y): + X = pd.Series(x) + Y = pd.Series(y) + spearman = X.corr(Y, method='spearman') + return spearman + + +def pearson_corr(x, y): + X = pd.Series(x.cpu()) + Y = pd.Series(y.cpu()) + spearman = X.corr(Y, method='pearson') + return spearman + + +def dir_exist(dirs): + if not os.path.exists(dirs): + os.makedirs(dirs) \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/convLSTM/__init__.py b/pytorch_example/RUL/otherIdea/convLSTM/__init__.py new file mode 100644 index 0000000..415d0bc --- /dev/null +++ b/pytorch_example/RUL/otherIdea/convLSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/convLSTM/model2D.py b/pytorch_example/RUL/otherIdea/convLSTM/model2D.py new file mode 100644 index 0000000..f83a314 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/convLSTM/model2D.py @@ -0,0 +1,211 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM 2D基本实现 +''' + +import torch.nn as nn +import torch +from torch.autograd import Variable + + +class ConvLSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, kernel_size, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C, S + B: bacth_size + T: timestamp + C: channel + S: seq + """ + + super(ConvLSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + + self.kernel_size = kernel_size + self.padding = kernel_size // 2 + self.bias = bias + + self.conv = nn.Conv1d(in_channels=self.input_dim + self.hidden_dim, + out_channels=4 * self.hidden_dim, + kernel_size=self.kernel_size, + padding=self.padding, + bias=self.bias) + + def forward(self, input_tensor, cur_state): + # shape :b,c,s + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=1) # concatenate along channel axis + + combined_conv = self.conv(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_conv, self.hidden_dim, dim=1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size, seq): + return (torch.zeros(batch_size, self.hidden_dim, seq, device=self.conv.weight.device), + torch.zeros(batch_size, self.hidden_dim, seq, device=self.conv.weight.device)) + + +class ConvLSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C, S or T, B, C, S + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64, 128)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, kernel_size, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(ConvLSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + kernel_size = self._extend_for_multilayer(kernel_size, num_layers) + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(kernel_size) == len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.kernel_size = kernel_size + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append(ConvLSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + kernel_size=self.kernel_size[i], + bias=self.bias)) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c, s) or (b, t, c, s) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2, 3) + + b, _, _, s = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b, + seq=s) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size, seq): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size, seq)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64, 128)) + convlstm = ConvLSTM(input_dim=64, hidden_dim=16, kernel_size=3, num_layers=1, batch_first=True, bias=True, return_all_layers=False) + _, last_states = convlstm(x) + + + print(last_states[0][0].size()) + h = last_states[0][0] # 0 for layer index, 0 for h index + # target = Variable(torch.randn(1, 32, 64, 32)).double().cuda() diff --git a/pytorch_example/RUL/otherIdea/convLSTM/model3D.py b/pytorch_example/RUL/otherIdea/convLSTM/model3D.py new file mode 100644 index 0000000..c2cbcb9 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/convLSTM/model3D.py @@ -0,0 +1,216 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM3D基本实现 +''' + +import torch.nn as nn +import torch + + +class ConvLSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, kernel_size, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: (int, int) + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + """ + + super(ConvLSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + + self.kernel_size = kernel_size + self.padding = kernel_size[0] // 2, kernel_size[1] // 2 + self.bias = bias + + self.conv = nn.Conv2d(in_channels=self.input_dim + self.hidden_dim, + out_channels=4 * self.hidden_dim, + kernel_size=self.kernel_size, + padding=self.padding, + bias=self.bias) + + def forward(self, input_tensor, cur_state): + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=1) # concatenate along channel axis + + combined_conv = self.conv(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_conv, self.hidden_dim, dim=1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size, image_size): + height, width = image_size + return (torch.zeros(batch_size, self.hidden_dim, height, width, device=self.conv.weight.device), + torch.zeros(batch_size, self.hidden_dim, height, width, device=self.conv.weight.device)) + + +class ConvLSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C, H, W or T, B, C, H, W + B: batch_size + T: timestamp 时间部 + C: channel 特征维度 通道数 + H: 图片的高 + W: 图片的宽 + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64, 128, 128)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, kernel_size, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(ConvLSTM, self).__init__() + + self._check_kernel_size_consistency(kernel_size) + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + kernel_size = self._extend_for_multilayer(kernel_size, num_layers) + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(kernel_size) == len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.kernel_size = kernel_size + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append(ConvLSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + kernel_size=self.kernel_size[i], + bias=self.bias)) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c, h, w) or (b, t, c, h, w) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2, 3, 4) + + b, _, _, h, w = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b, + image_size=(h, w)) + + layer_output_list = [] + last_state_list = [] + + seq_len = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(seq_len): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :, :, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size, image_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size, image_size)) + return init_states + + @staticmethod + def _check_kernel_size_consistency(kernel_size): + if not (isinstance(kernel_size, tuple) or + (isinstance(kernel_size, list) and all([isinstance(elem, tuple) for elem in kernel_size]))): + raise ValueError('`kernel_size` must be tuple or list of tuples') + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +if __name__ == '__main__': + channels = 10 + model = ConvLSTM(input_dim=channels, + hidden_dim=[64, 64, 128], + kernel_size=(3, 3), + num_layers=3, + batch_first=True, + bias=True, + return_all_layers=False) diff --git a/pytorch_example/RUL/otherIdea/convLSTM/model_new3D.py b/pytorch_example/RUL/otherIdea/convLSTM/model_new3D.py new file mode 100644 index 0000000..fd884b2 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/convLSTM/model_new3D.py @@ -0,0 +1,116 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 11:08 +@Usage : +@Desc : +''' + +import torch +import torch.nn as nn +from torch.autograd import Variable + + +class ConvLSTMCell(nn.Module): + def __init__(self, input_channels, hidden_channels, kernel_size): + super(ConvLSTMCell, self).__init__() + + assert hidden_channels % 2 == 0 + + self.input_channels = input_channels + self.hidden_channels = hidden_channels + self.kernel_size = kernel_size + self.num_features = 4 + + self.padding = int((kernel_size - 1) / 2) + + self.Wxi = nn.Conv2d(self.input_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=True) + self.Whi = nn.Conv2d(self.hidden_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=False) + self.Wxf = nn.Conv2d(self.input_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=True) + self.Whf = nn.Conv2d(self.hidden_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=False) + self.Wxc = nn.Conv2d(self.input_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=True) + self.Whc = nn.Conv2d(self.hidden_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=False) + self.Wxo = nn.Conv2d(self.input_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=True) + self.Who = nn.Conv2d(self.hidden_channels, self.hidden_channels, self.kernel_size, 1, self.padding, bias=False) + + self.Wci = None + self.Wcf = None + self.Wco = None + + def forward(self, x, h, c): + ci = torch.sigmoid(self.Wxi(x) + self.Whi(h) + c * self.Wci) + cf = torch.sigmoid(self.Wxf(x) + self.Whf(h) + c * self.Wcf) + cc = cf * c + ci * torch.tanh(self.Wxc(x) + self.Whc(h)) + co = torch.sigmoid(self.Wxo(x) + self.Who(h) + cc * self.Wco) + ch = co * torch.tanh(cc) + return ch, cc + + def init_hidden(self, batch_size, hidden, shape): + if self.Wci is None: + self.Wci = nn.Parameter(torch.zeros(1, hidden, shape[0], shape[1])).cuda() + self.Wcf = nn.Parameter(torch.zeros(1, hidden, shape[0], shape[1])).cuda() + self.Wco = nn.Parameter(torch.zeros(1, hidden, shape[0], shape[1])).cuda() + else: + assert shape[0] == self.Wci.size()[2], 'Input Height Mismatched!' + assert shape[1] == self.Wci.size()[3], 'Input Width Mismatched!' + return (Variable(torch.zeros(batch_size, hidden, shape[0], shape[1])).cuda(), + Variable(torch.zeros(batch_size, hidden, shape[0], shape[1])).cuda()) + + +class ConvLSTM(nn.Module): + # input_channels corresponds to the first input feature map + # hidden state is a list of succeeding lstm layers. + def __init__(self, input_channels, hidden_channels, kernel_size, step=1, effective_step=[1]): + super(ConvLSTM, self).__init__() + self.input_channels = [input_channels] + hidden_channels + self.hidden_channels = hidden_channels + self.kernel_size = kernel_size + self.num_layers = len(hidden_channels) + self.step = step + self.effective_step = effective_step + self._all_layers = [] + for i in range(self.num_layers): + name = 'cell{}'.format(i) + cell = ConvLSTMCell(self.input_channels[i], self.hidden_channels[i], self.kernel_size) + setattr(self, name, cell) + self._all_layers.append(cell) + + def forward(self, input): + internal_state = [] + outputs = [] + for step in range(self.step): + x = input + for i in range(self.num_layers): + # all cells are initialized in the first step + name = 'cell{}'.format(i) + if step == 0: + bsize, _, height, width = x.size() + (h, c) = getattr(self, name).init_hidden(batch_size=bsize, hidden=self.hidden_channels[i], + shape=(height, width)) + internal_state.append((h, c)) + + # do forward + (h, c) = internal_state[i] + x, new_c = getattr(self, name)(x, h, c) + internal_state[i] = (x, new_c) + # only record effective steps + if step in self.effective_step: + outputs.append(x) + + return outputs, (x, new_c) + + +if __name__ == '__main__': + # gradient check + convlstm = ConvLSTM(input_channels=512, hidden_channels=[128, 64, 64, 32, 32], kernel_size=3, step=5, + effective_step=[4]).cuda() + loss_fn = torch.nn.MSELoss() + + input = Variable(torch.randn(1, 512, 64, 32)).cuda() + target = Variable(torch.randn(1, 32, 64, 32)).double().cuda() + + output = convlstm(input) + output = output[0][0].double() + res = torch.autograd.gradcheck(loss_fn, (output, target), eps=1e-6, raise_exception=True) + print(res) \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/__init__.py b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/__init__.py new file mode 100644 index 0000000..5857496 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 20:32 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/loadData.py b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/loadData.py new file mode 100644 index 0000000..3434549 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/loadData.py @@ -0,0 +1,138 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("../../dataset/HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + # todo 解决模型保存时,query无法序列化的问题 + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset diff --git a/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/model.py b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/model.py new file mode 100644 index 0000000..38d5c98 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/model.py @@ -0,0 +1,243 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM 2D基本实现 +''' + +import torch.nn as nn +import torch +from RUL.baseModel.dctChannelAttention import dct_channel_block + + +class dctLSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C + B: bacth_size + T: timestamp + C: channel + """ + + super(dctLSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.bias = bias + + self.hidden = nn.Linear(in_features=self.input_dim + self.hidden_dim, + out_features=4 * self.hidden_dim, + bias=self.bias) + self.attention = dct_channel_block(channel=self.input_dim + self.hidden_dim) + + def forward(self, input_tensor, cur_state): + # shape :b,c + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=-1) # concatenate along channel axis + # 增加一个channelAttention + combined = self.attention(combined) + combined_linear = self.hidden(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_linear, self.hidden_dim, dim=-1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size): + return (torch.zeros(batch_size, 1, self.hidden_dim, device=self.hidden.weight.device), + torch.zeros(batch_size, 1, self.hidden_dim, device=self.hidden.weight.device)) + + +class LSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C or T, B, C + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(LSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append( + dctLSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + bias=self.bias), + ) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c) or (b, t, c) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2) + + b, _, _ = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :].unsqueeze(dim=1), + cur_state=[h, c]) + output_inner.append(h.squeeze(1)) + + layer_output = torch.stack(output_inner, dim=1) + + # TODO 每层之间增加一个dct_attention + # layer_output = self.attention_list[layer_idx](layer_output) + + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h.squeeze(1), c.squeeze(1)]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +class PredictModel(nn.Module): + + def __init__(self, input_dim): + super(PredictModel, self).__init__() + + self.lstm = LSTM(input_dim=input_dim, hidden_dim=[512, 256], num_layers=2, batch_first=True, bias=True, + return_all_layers=False) + self.backbone = nn.Sequential( + nn.Linear(in_features=256, out_features=128), + nn.ReLU(), + nn.Linear(in_features=128, out_features=64), + nn.ReLU(), + nn.Dropout(0.2), + nn.BatchNorm1d(64), + nn.Linear(in_features=64, out_features=32), + nn.ReLU(), + nn.Dropout(0.2), + nn.BatchNorm1d(32), + nn.ReLU(), + nn.Linear(in_features=32, out_features=16), + nn.Linear(in_features=16, out_features=1) + ) + + def forward(self, input_tensor): + input_tensor = input_tensor.to(torch.float32) + layer_output_list, last_states = self.lstm(input_tensor) + last_timestamp = last_states[0][0] + predict = self.backbone(last_timestamp) + return predict + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + lstm = LSTM(input_dim=64, hidden_dim=16, num_layers=1, batch_first=True, bias=True, + return_all_layers=False) + layer_output_list, last_states = lstm(x) + + all = layer_output_list[0] + h = last_states[0][0] + print(all.size()) + print(h.size()) diff --git a/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/test.py b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/test.py new file mode 100644 index 0000000..29032ab --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/test.py @@ -0,0 +1,134 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from RUL.otherIdea.dctChannelEmbedLSTM.loadData import getDataset, getTotalData +from RUL.otherIdea.dctChannelEmbedLSTM.model import PredictModel +from torch.utils.data import DataLoader +import matplotlib.pyplot as plt + + +def plot_prediction(total_data, predicted_data_easy, predicted_data_hard): + pic1 = plt.figure(figsize=(8, 6), dpi=200) + + '''保存的模型参数的路径''' + + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + # 简单预测图 + plt.subplot(2, 1, 1) + plt.plot(total_data) + plt.plot(predicted_data_easy) + plt.title('Easy Prediction') + plt.xlabel('time') + plt.ylabel('loss') + # plt.legend(loc='upper right') + + # 困难预测图 + plt.subplot(2, 1, 2) + plt.plot(total_data) + plt.plot(predicted_data_hard) + plt.title('Easy Prediction') + plt.xlabel('time') + plt.ylabel('loss') + + # plt.legend(loc='upper right') + + + # plt.scatter() + + plt.show() + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model(each_predict_data).cpu().detach().numpy()[-1] # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + a = np.concatenate([each_predict_data[-1, -1, 1:], predicted_data], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.concatenate([each_predict_data[1:, :, :], np.expand_dims(b, axis=0)], axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, save_path, is_single=True, is_norm=False): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + model = PredictModel(input_dim=feature).to(device) + + model.load_state_dict( + torch.load(save_path, map_location=device) + ) + + print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = torch.squeeze(model(data)).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = torch.squeeze(model(data)).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predicted_data_hard = np.concatenate([predicted_data_hard, + predictOneByOne(model, last_train_data, predict_num=predict_num)], axis=0) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "./parameters\dctLSTM_hidden40_feature10_predict50_epoch80_trainLoss0.05818896507844329_valLoss0.21667905896902084.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/train.py b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/train.py new file mode 100644 index 0000000..2bfc48a --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctChannelEmbedLSTM/train.py @@ -0,0 +1,194 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 14:56 +@Usage : +@Desc : 训练LSTM +''' +import os +import time +import random +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F +import matplotlib.pyplot as plt +from torch.utils.data import DataLoader +from RUL.otherIdea.dctChannelEmbedLSTM.model import PredictModel +from RUL.otherIdea.dctChannelEmbedLSTM.loadData import getDataset +from RUL.otherIdea.dctChannelEmbedLSTM.test import test +from RUL.baseModel.CommonFunction import IsStopTraining +import math + +''' +超参数设置: +''' +hidden_num = 40 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 32 +EPOCH = 1000 +predict_num = 50 # 预测个数 +is_norm = False +is_single = True +seed = 334 +model_name = "dctEmbedLSTM" +base_save = r"parameters/{0}_hidden{1}_feature{2}_predict{3}_seed{4}".format(model_name, hidden_num, feature, + predict_num, seed) +if not os.path.exists("parameters"): + os.makedirs("parameters") + + +def get_dataset(): + '''得到数据集''' + train_dataset, val_dataset = getDataset( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_single=is_single, is_norm=is_norm) + '''DataLoader''' + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=True, drop_last=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False, drop_last=False) + return train_loader, val_loader + + +def train(device, lr, lr_patience, early_stop_patience, epochs,seed): + '''预测模型''' + global best_save_path + model = PredictModel(input_dim=feature) + '''得到数据集''' + train_loader, val_loader = get_dataset() + criterion = nn.MSELoss().to(device) + + optimizer_model = torch.optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer_model, mode="min", factor=0.5, + patience=lr_patience) + + def zero_grad_all(): + optimizer_model.zero_grad() + + train_loss_list = [] + val_loss_list = [] + + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss = 0.0 + val_loss = 0.0 + + model.train() + + for (train_batch_idx, (train_data, train_label)) in enumerate(train_loader): + train_data, train_label = train_data.to(device), train_label.to(device) + + zero_grad_all() + + predict_data = torch.squeeze(model(train_data)) + + # MSE损失 + loss = criterion(predict_data, train_label) + + loss.backward() + optimizer_model.step() + + zero_grad_all() + + train_loss += loss.item() + + model.eval() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = torch.squeeze(model(val_data)) + + loss = criterion(val_predict_data, val_label) + val_loss += loss.item() + + scheduler_model.step(val_loss) + + train_loss = train_loss / len(train_loader) + val_loss = val_loss / len(val_loader) + print( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_loss: {:3.9f} | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss, + val_loss, + optimizer_model.state_dict()['param_groups'][0]['lr'])) + + # 保存在验证集上loss最小的模型 + # if val_loss_list.__len__() > 0 and (val_loss / val_dataset.__len__()) < min(val_loss_list): + # 如果精度大于最高精度,则保存 + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + print("保存模型最佳模型成功") + # 保存模型参数 + best_save_path = base_save + "_epoch" + str(epoch) + \ + "_trainLoss" + str(train_loss) + \ + "_valLoss" + str(val_loss) + ".pkl" + torch.save(model.state_dict(), + best_save_path) + + train_loss_list.append(train_loss) + + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + break + + '''保存的模型参数的路径''' + + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + pic1 = plt.figure(figsize=(12, 6), dpi=200) + + plt.plot(np.arange(1, len(train_loss_list) + 1), train_loss_list, 'b', label='Training Loss') + plt.plot(np.arange(1, len(train_loss_list) + 1), val_loss_list, 'r', label='Validation Loss') + # plt.ylim(0, 0.08) # 设置y轴范围 + plt.title('Training & Validation loss') + plt.xlabel('epoch') + plt.ylabel('loss') + plt.legend(loc='upper right') + plt.grid(alpha=0.4) + + # 获取当前时间戳 + timestamp = int(time.time()) + + # 将时间戳转换为字符串 + timestamp_str = str(timestamp) + plt.savefig(timestamp_str, dpi=200) + + return best_save_path + + +if __name__ == '__main__': + + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + '''训练''' + save_path = train(device, lr=0.01, lr_patience=10, early_stop_patience=20, epochs=1000, seed=seed) + + end = time.time() + + '''测试''' + # test1(5, src_condition, tar_condition, G_params_path, LC_params_path) + + test(hidden_num, feature, predict_num=predict_num, + batch_size=batch_size, save_path=save_path, + is_single=is_single, is_norm=is_norm) + + print("训练耗时:{:3.2f}s".format(end - begin)) diff --git a/pytorch_example/RUL/otherIdea/dctEmbedLSTM/__init__.py b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/__init__.py new file mode 100644 index 0000000..5857496 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 20:32 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/dctEmbedLSTM/loadData.py b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/loadData.py new file mode 100644 index 0000000..3434549 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/loadData.py @@ -0,0 +1,138 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("../../dataset/HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + # todo 解决模型保存时,query无法序列化的问题 + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset diff --git a/pytorch_example/RUL/otherIdea/dctEmbedLSTM/model.py b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/model.py new file mode 100644 index 0000000..fb5f411 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/model.py @@ -0,0 +1,243 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM 2D基本实现 +''' + +import torch.nn as nn +import torch +from RUL.baseModel.dctAttention import dct_channel_block + + +class dctLSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C + B: bacth_size + T: timestamp + C: channel + """ + + super(dctLSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.bias = bias + + self.hidden = nn.Linear(in_features=self.input_dim + self.hidden_dim, + out_features=4 * self.hidden_dim, + bias=self.bias) + self.attention = dct_channel_block(channel=self.input_dim + self.hidden_dim) + + def forward(self, input_tensor, cur_state): + # shape :b,c + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=-1) # concatenate along channel axis + # 增加一个channelAttention + combined = self.attention(combined) + combined_linear = self.hidden(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_linear, self.hidden_dim, dim=-1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size): + return (torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device), + torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device)) + + +class LSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C or T, B, C + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(LSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append( + dctLSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + bias=self.bias), + ) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c) or (b, t, c) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2) + + b, _, _ = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + + # TODO 每层之间增加一个dct_attention + # layer_output = self.attention_list[layer_idx](layer_output) + + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +class PredictModel(nn.Module): + + def __init__(self, input_dim): + super(PredictModel, self).__init__() + + self.lstm = LSTM(input_dim=input_dim, hidden_dim=[512, 256], num_layers=2, batch_first=True, bias=True, + return_all_layers=False) + self.backbone = nn.Sequential( + nn.Linear(in_features=256, out_features=128), + nn.ReLU(), + nn.Linear(in_features=128, out_features=64), + nn.ReLU(), + nn.Dropout(0.2), + nn.BatchNorm1d(64), + nn.Linear(in_features=64, out_features=32), + nn.ReLU(), + nn.Dropout(0.2), + nn.BatchNorm1d(32), + nn.ReLU(), + nn.Linear(in_features=32, out_features=16), + nn.Linear(in_features=16, out_features=1) + ) + + def forward(self, input_tensor): + input_tensor = input_tensor.to(torch.float32) + layer_output_list, last_states = self.lstm(input_tensor) + last_timestamp = last_states[0][0] + predict = self.backbone(last_timestamp) + return predict + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + lstm = LSTM(input_dim=64, hidden_dim=16, num_layers=1, batch_first=True, bias=True, + return_all_layers=False) + layer_output_list, last_states = lstm(x) + + all = layer_output_list[0] + h = last_states[0][0] + print(all.size()) + print(h.size()) diff --git a/pytorch_example/RUL/otherIdea/dctEmbedLSTM/modelForEasy.py b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/modelForEasy.py new file mode 100644 index 0000000..74449b0 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/modelForEasy.py @@ -0,0 +1,237 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM 2D基本实现 +''' + +import torch.nn as nn +import torch +from RUL.baseModel.dctAttention import dct_channel_block + + +class dctLSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C + B: bacth_size + T: timestamp + C: channel + """ + + super(dctLSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.bias = bias + + self.hidden = nn.Linear(in_features=self.input_dim + self.hidden_dim, + out_features=4 * self.hidden_dim, + bias=self.bias) + self.attention = dct_channel_block(channel=self.input_dim + self.hidden_dim) + + def forward(self, input_tensor, cur_state): + # shape :b,c + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=-1) # concatenate along channel axis + # 增加一个channelAttention + combined = self.attention(combined) + combined_linear = self.hidden(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_linear, self.hidden_dim, dim=-1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size): + return (torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device), + torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device)) + + +class LSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C or T, B, C + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(LSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append( + dctLSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + bias=self.bias), + ) + + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c) or (b, t, c) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2) + + b, _, _ = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + + # TODO 每层之间增加一个dct_attention + # layer_output = self.attention_list[layer_idx](layer_output) + + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +class PredictModel(nn.Module): + + def __init__(self, input_dim): + super(PredictModel, self).__init__() + + self.lstm = LSTM(input_dim=input_dim, hidden_dim=[64, 64], num_layers=2, batch_first=True, bias=True, + return_all_layers=False) + + self.backbone = nn.Sequential( + nn.Linear(in_features=64, out_features=64), + nn.Linear(in_features=64, out_features=64), + nn.BatchNorm1d(64), + nn.ReLU(), + nn.Dropout(0.5), + nn.Linear(in_features=64, out_features=1) + ) + + def forward(self, input_tensor): + input_tensor = input_tensor.to(torch.float32) + layer_output_list, last_states = self.lstm(input_tensor) + last_timestamp = last_states[0][0] + predict = self.backbone(last_timestamp) + return predict + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + lstm = LSTM(input_dim=64, hidden_dim=16, num_layers=1, batch_first=True, bias=True, + return_all_layers=False) + layer_output_list, last_states = lstm(x) + + all = layer_output_list[0] + h = last_states[0][0] + print(all.size()) + print(h.size()) diff --git a/pytorch_example/RUL/otherIdea/dctEmbedLSTM/test.py b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/test.py new file mode 100644 index 0000000..757ae70 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/test.py @@ -0,0 +1,118 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from RUL.otherIdea.dctEmbedLSTM.loadData import getDataset, getTotalData +from RUL.otherIdea.dctEmbedLSTM.modelForEasy import PredictModel +from torch.utils.data import DataLoader +from RUL.baseModel.plot import plot_prediction, plot_forSelf +from RUL.baseModel.loss.Evaluate import getEvaluate + + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model(each_predict_data).cpu().detach().numpy()[-1] # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + a = np.concatenate([each_predict_data[-1, -1, 1:], predicted_data], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.concatenate([each_predict_data[1:, :, :], np.expand_dims(b, axis=0)], axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, save_path, save_fig_name, is_single=True, is_norm=False): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + model = PredictModel(input_dim=feature).to(device) + + model.load_state_dict( + torch.load(save_path, map_location=device) + ) + + print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + # 衡量矩阵 + train_list = [] + easy_list = [] + val_label = [] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = torch.squeeze(model(data)).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + train_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = torch.squeeze(model(data)).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + easy_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + val_label = np.concatenate( + [val_label, label.cpu().detach().numpy()], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predict_hard = predictOneByOne(model, last_train_data, predict_num=predict_num) + predicted_data_hard = np.concatenate([predicted_data_hard, + predict_hard], axis=0) + ####衡量 + train_evaluate = np.mean(train_list, axis=0) + easy_evaluate = np.mean(easy_list, axis=0) + hard_evaluate = getEvaluate(val_label, predict_hard) + print('train: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (train_evaluate[0], train_evaluate[1], train_evaluate[2], train_evaluate[3])) + print('easy: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (easy_evaluate[0], easy_evaluate[1], easy_evaluate[2], easy_evaluate[3])) + print('hard: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (hard_evaluate[0], hard_evaluate[1], hard_evaluate[2], hard_evaluate[3])) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name, predict_num=predict_num) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "./parameters\dctLSTM_hidden40_feature10_predict50_epoch80_trainLoss0.05818896507844329_valLoss0.21667905896902084.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/dctEmbedLSTM/train.py b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/train.py new file mode 100644 index 0000000..286c1d0 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctEmbedLSTM/train.py @@ -0,0 +1,202 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 14:56 +@Usage : +@Desc : 训练LSTM +''' +import os +import time +import random +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F +import matplotlib.pyplot as plt +from torch.utils.data import DataLoader +from RUL.otherIdea.dctEmbedLSTM.modelForEasy import PredictModel +from RUL.otherIdea.dctEmbedLSTM.loadData import getDataset +from RUL.otherIdea.dctEmbedLSTM.test import test +from RUL.baseModel.CommonFunction import IsStopTraining +import RUL.baseModel.utils.utils as utils +import math + +''' +超参数设置: +''' +hidden_num = 40 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 32 +EPOCH = 1000 +predict_num = 200 # 预测个数 +is_norm = False +is_single = True +seed = 5 +model_name = "dctEmbedLSTM" +base_save = r"parameters/{0}_hidden{1}_feature{2}_predict{3}_seed{4}".format(model_name, hidden_num, feature, + predict_num, seed) +save_fig_name = 'fig/seed{0}_hidden{1}_feature{2}_predict{3}'.format(seed, hidden_num, feature, predict_num) + +if not os.path.exists("parameters"): + os.makedirs("parameters") +if not os.path.exists("fig"): + os.makedirs("fig") + + +def get_dataset(): + '''得到数据集''' + train_dataset, val_dataset = getDataset( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_single=is_single, is_norm=is_norm) + '''DataLoader''' + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=True, drop_last=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False, drop_last=False) + return train_loader, val_loader + + +def train(device, lr, lr_patience, early_stop_patience, epochs,seed): + '''预测模型''' + global best_save_path + model = PredictModel(input_dim=feature) + '''得到数据集''' + train_loader, val_loader = get_dataset() + criterion = nn.MSELoss().to(device) + + optimizer_model = torch.optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer_model, mode="min", factor=0.5, + patience=lr_patience) + + def zero_grad_all(): + optimizer_model.zero_grad() + + train_loss_list = [] + val_loss_list = [] + best_save_path = None + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss = 0.0 + val_loss = 0.0 + + model.train() + + for (train_batch_idx, (train_data, train_label)) in enumerate(train_loader): + train_data, train_label = train_data.to(device), train_label.to(device) + + zero_grad_all() + + predict_data = torch.squeeze(model(train_data)) + + # MSE损失 + loss = criterion(predict_data, train_label) + + loss.backward() + optimizer_model.step() + + zero_grad_all() + + train_loss += loss.item() + + model.eval() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = torch.squeeze(model(val_data)) + + loss = criterion(val_predict_data, val_label) + val_loss += loss.item() + + scheduler_model.step(val_loss) + + train_loss = train_loss / len(train_loader) + val_loss = val_loss / len(val_loader) + print( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_loss: {:3.9f} | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss, + val_loss, + optimizer_model.state_dict()['param_groups'][0]['lr'])) + + # 保存在验证集上loss最小的模型 + # if val_loss_list.__len__() > 0 and (val_loss / val_dataset.__len__()) < min(val_loss_list): + # 如果精度大于最高精度,则保存 + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + print("保存模型最佳模型成功") + # 保存模型参数 + if best_save_path != None: + utils.delete_file(best_save_path) + best_save_path = base_save + "_epoch" + str(epoch) + \ + "_trainLoss" + str(train_loss) + \ + "_valLoss" + str(val_loss) + ".pkl" + torch.save(model.state_dict(), + best_save_path) + + train_loss_list.append(train_loss) + + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + break + + '''保存的模型参数的路径''' + + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + pic1 = plt.figure(figsize=(12, 6), dpi=200) + + plt.plot(np.arange(1, len(train_loss_list) + 1), train_loss_list, 'b', label='Training Loss') + plt.plot(np.arange(1, len(train_loss_list) + 1), val_loss_list, 'r', label='Validation Loss') + # plt.ylim(0, 0.08) # 设置y轴范围 + plt.title('Training & Validation loss') + plt.xlabel('epoch') + plt.ylabel('loss') + plt.legend(loc='upper right') + plt.grid(alpha=0.4) + + # 获取当前时间戳 + timestamp = int(time.time()) + + # 将时间戳转换为字符串 + timestamp_str = str(timestamp) + plt.savefig(timestamp_str, dpi=200) + plt.show() + + return best_save_path + + +if __name__ == '__main__': + + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + '''训练''' + save_path = train(device, lr=0.01, lr_patience=10, early_stop_patience=20, epochs=1000, seed=seed) + + end = time.time() + + '''测试''' + # test1(5, src_condition, tar_condition, G_params_path, LC_params_path) + + test(hidden_num, feature, predict_num=predict_num, + batch_size=batch_size, save_path=save_path, + is_single=is_single, is_norm=is_norm,save_fig_name=save_fig_name) + + print("训练耗时:{:3.2f}s".format(end - begin)) diff --git a/pytorch_example/RUL/otherIdea/dctLSTM/__init__.py b/pytorch_example/RUL/otherIdea/dctLSTM/__init__.py new file mode 100644 index 0000000..5857496 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctLSTM/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 20:32 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/RUL/otherIdea/dctLSTM/loadData.py b/pytorch_example/RUL/otherIdea/dctLSTM/loadData.py new file mode 100644 index 0000000..3434549 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctLSTM/loadData.py @@ -0,0 +1,138 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 15:21 +@Usage : +@Desc : 获取数据集 +''' + +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader + +'''正常Dataset类''' + + +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + + def __len__(self): + return len(self.datas) + + +def standardization(data): + mu = np.mean(data, axis=0) + sigma = np.std(data, axis=0) + return (data - mu) / sigma + + +def normalization(data): + _range = np.max(data) - np.min(data) + return (data - np.min(data)) / _range + + +# LSTM_cell的数目,维度,是否正则化 +def getData(filter_num, dims, if_norm: bool = False): + # 数据读入 + HI_merge_data_origin = np.load("../../dataset/HI_merge_data.npy") + + # plt.plot(HI_merge_data[0:1250, 1]) + # 去除掉退化特征不明显前面的点 + HI_merge_data = HI_merge_data_origin[0:1250, 1] + + # 是否正则化 + if if_norm: + HI_merge_data = normalization(HI_merge_data) + + # plt.plot(HI_merge_data) + # plt.show() + (total_dims,) = HI_merge_data.shape + + # # 将其分成重叠采样状态-滑动窗口函数 + predict_data = np.empty(shape=[total_dims - filter_num, filter_num]) + + # 重叠采样获取时间部和训练次数 + for dim in range(total_dims - filter_num): + predict_data[dim] = HI_merge_data[dim:dim + filter_num] + + train_label = predict_data[dims:, :] + train_label_single = HI_merge_data[dims + filter_num - 1:-1] + + # 再重叠采样获取一个点的维度 + '''train_data.shape:(sample,filter_num) -> (sample,filter_num,dims)''' + + # # 将其分成重叠采样状态-滑动窗口函数 + train_data = np.empty(shape=[dims, total_dims - filter_num - dims, filter_num]) + + for dim in range(dims): + train_data[dim] = predict_data[dim:total_dims - filter_num - dims + dim, :] + + # 转置变成想要的数据 (dims,sample,filter_num) -> (sample,filter_num,dims) + + train_data = np.transpose(train_data, [1, 2, 0]) + + # todo 解决模型保存时,query无法序列化的问题 + total_data = HI_merge_data + + print("total_data.shape:", total_data.shape) + print("train_data.shape:", train_data.shape) # (20, 1200, 30) + print("train_label.shape:", train_label.shape) # (20, 1200) + print("train_label_single.shape:", train_label_single.shape) + + # 所有的原始数据;所有的训练数据;所有的训练标签(预测一个序列);所有的训练标签(预测一个点) + return total_data, train_data, train_label, train_label_single + + +def splitValData(data, label, label_single, predict_num=50): + sample, hidden, feature = data.shape + + train_data = data[:sample - predict_num, :, :] + val_data = data[sample - predict_num:, :, :] + + train_label = label[:sample - predict_num, :] + val_label = label[sample - predict_num:, :] + + train_label_single = label_single[:sample - predict_num, ] + val_label_single = label_single[sample - predict_num:, ] + + return train_data, val_data, train_label, val_label, train_label_single, val_label_single + + +def getTotalData(hidden_num, feature, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + if is_single: + total_dataset = Nor_Dataset(train_data, train_label_single) + else: + total_dataset = Nor_Dataset(train_data, train_label) + return total_data, total_dataset + + +# lstm细胞数,channel数,预测多少个点,是否正则化 +def getDataset(hidden_num, feature, predict_num, is_single=True, is_norm=False): + total_data, train_data, train_label, train_label_single = getData(hidden_num, feature, is_norm) + # 根据预测的点数划分训练集和测试集(验证集) + train_data, val_data, train_label, val_label, train_label_single, val_label_single = splitValData(train_data, + train_label, + train_label_single, + predict_num=predict_num) + if is_single: + train_dataset = Nor_Dataset(train_data, train_label_single) + val_dataset = Nor_Dataset(val_data, val_label_single) + else: + train_dataset = Nor_Dataset(train_data, train_label) + val_dataset = Nor_Dataset(val_data, val_label) + + return train_dataset, val_dataset diff --git a/pytorch_example/RUL/otherIdea/dctLSTM/model.py b/pytorch_example/RUL/otherIdea/dctLSTM/model.py new file mode 100644 index 0000000..7ba4f45 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctLSTM/model.py @@ -0,0 +1,244 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM 2D基本实现 +''' + +import torch.nn as nn +import torch +from RUL.baseModel.dctChannelAttention import dct_channel_block + + +class LSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C + B: bacth_size + T: timestamp + C: channel + """ + + super(LSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.bias = bias + + self.hidden = nn.Linear(in_features=self.input_dim + self.hidden_dim, + out_features=4 * self.hidden_dim, + bias=self.bias) + + def forward(self, input_tensor, cur_state): + # shape :b,c + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=-1) # concatenate along channel axis + + combined_linear = self.hidden(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_linear, self.hidden_dim, dim=1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size): + return (torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device), + torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device)) + + +class LSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C or T, B, C + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(LSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + attention_list = [] + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append( + LSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + bias=self.bias), + ) + attention_list.append( + dct_channel_block(self.hidden_dim[i]) + ) + self.attention_list = nn.ModuleList(attention_list) + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c) or (b, t, c) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2) + + b, _, _ = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + + # TODO 每层之间增加一个dct_attention + layer_output = self.attention_list[layer_idx](layer_output) + + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +class PredictModel(nn.Module): + + def __init__(self, input_dim): + super(PredictModel, self).__init__() + + self.lstm = LSTM(input_dim=input_dim, hidden_dim=[512, 256], num_layers=2, batch_first=True, bias=True, + return_all_layers=False) + self.backbone = nn.Sequential( + nn.Linear(in_features=256, out_features=128), + nn.ReLU(), + nn.Linear(in_features=128, out_features=64), + nn.ReLU(), + nn.Dropout(0.2), + nn.BatchNorm1d(64), + nn.Linear(in_features=64, out_features=32), + nn.ReLU(), + nn.Dropout(0.2), + nn.BatchNorm1d(32), + nn.ReLU(), + nn.Linear(in_features=32, out_features=16), + nn.Linear(in_features=16, out_features=1) + ) + + def forward(self, input_tensor): + input_tensor = input_tensor.to(torch.float32) + layer_output_list, last_states = self.lstm(input_tensor) + last_timestamp = last_states[0][0] + predict = self.backbone(last_timestamp) + return predict + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + lstm = LSTM(input_dim=64, hidden_dim=16, num_layers=1, batch_first=True, bias=True, + return_all_layers=False) + layer_output_list, last_states = lstm(x) + + all = layer_output_list[0] + h = last_states[0][0] + print(all.size()) + print(h.size()) diff --git a/pytorch_example/RUL/otherIdea/dctLSTM/modelForEasy.py b/pytorch_example/RUL/otherIdea/dctLSTM/modelForEasy.py new file mode 100644 index 0000000..e0af5a7 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctLSTM/modelForEasy.py @@ -0,0 +1,237 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 10:46 +@Usage : +@Desc : convLSTM 2D基本实现 +''' + +import torch.nn as nn +import torch +from RUL.baseModel.dctChannelAttention import dct_channel_block + + +class LSTMCell(nn.Module): + + def __init__(self, input_dim, hidden_dim, bias): + """ + Initialize ConvLSTM cell. + + Parameters + ---------- + input_dim: int + Number of channels of input tensor. + hidden_dim: int + Number of channels of hidden state. + kernel_size: int + Size of the convolutional kernel. + bias: bool + Whether or not to add the bias. + + Input: + A tensor of size B, T, C + B: bacth_size + T: timestamp + C: channel + """ + + super(LSTMCell, self).__init__() + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.bias = bias + + self.hidden = nn.Linear(in_features=self.input_dim + self.hidden_dim, + out_features=4 * self.hidden_dim, + bias=self.bias) + + def forward(self, input_tensor, cur_state): + # shape :b,c + h_cur, c_cur = cur_state + + combined = torch.cat([input_tensor, h_cur], dim=-1) # concatenate along channel axis + + combined_linear = self.hidden(combined) + cc_i, cc_f, cc_o, cc_g = torch.split(combined_linear, self.hidden_dim, dim=1) + i = torch.sigmoid(cc_i) + f = torch.sigmoid(cc_f) + o = torch.sigmoid(cc_o) + g = torch.tanh(cc_g) + + c_next = f * c_cur + i * g + h_next = o * torch.tanh(c_next) + + return h_next, c_next + + def init_hidden(self, batch_size): + return (torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device), + torch.zeros(batch_size, self.hidden_dim, device=self.hidden.weight.device)) + + +class LSTM(nn.Module): + """ + + Parameters: + input_dim: Number of channels in input + hidden_dim: Number of hidden channels + kernel_size: Size of kernel in convolutions + num_layers: Number of LSTM layers stacked on each other + batch_first: Whether or not dimension 0 is the batch or not + bias: Bias or no bias in Convolution + return_all_layers: Return the list of computations for all layers + Note: Will do same padding. + + Input: + A tensor of size B, T, C or T, B, C + Output: + A tuple of two lists of length num_layers (or length 1 if return_all_layers is False). + 0 - layer_output_list is the list of lists of length T of each output + 1 - last_state_list is the list of last states + each element of the list is a tuple (h, c) for hidden state and memory + Example: + >> x = torch.rand((32, 10, 64)) + >> convlstm = ConvLSTM(64, 16, 3, 1, True, True, False) + >> _, last_states = convlstm(x) + >> h = last_states[0][0] # 0 for layer index, 0 for h index + """ + + def __init__(self, input_dim, hidden_dim, num_layers, + batch_first=False, bias=True, return_all_layers=False): + super(LSTM, self).__init__() + + # Make sure that both `kernel_size` and `hidden_dim` are lists having len == num_layers + hidden_dim = self._extend_for_multilayer(hidden_dim, num_layers) + if not len(hidden_dim) == num_layers: + raise ValueError('Inconsistent list length.') + + self.input_dim = input_dim + self.hidden_dim = hidden_dim + self.num_layers = num_layers + self.batch_first = batch_first + self.bias = bias + self.return_all_layers = return_all_layers + + cell_list = [] + attention_list = [] + for i in range(0, self.num_layers): + cur_input_dim = self.input_dim if i == 0 else self.hidden_dim[i - 1] + + cell_list.append( + LSTMCell(input_dim=cur_input_dim, + hidden_dim=self.hidden_dim[i], + bias=self.bias), + ) + attention_list.append( + dct_channel_block(self.hidden_dim[i]) + ) + self.attention_list = nn.ModuleList(attention_list) + self.cell_list = nn.ModuleList(cell_list) + + def forward(self, input_tensor, hidden_state=None): + """ + + Parameters + ---------- + input_tensor: todo + 5-D Tensor either of shape (t, b, c) or (b, t, c) + hidden_state: todo + None. todo implement stateful + + Returns + ------- + last_state_list, layer_output + """ + + if not self.batch_first: + # 等同于transpose + # (t, b, c, h, w) -> (b, t, c, h, w) + input_tensor = input_tensor.permute(1, 0, 2) + + b, _, _ = input_tensor.size() + + # Implement stateful ConvLSTM + if hidden_state is not None: + raise NotImplementedError() + else: + # Since the init is done in forward. Can send image size here + hidden_state = self._init_hidden(batch_size=b) + + layer_output_list = [] + last_state_list = [] + + timestamp = input_tensor.size(1) + cur_layer_input = input_tensor + + for layer_idx in range(self.num_layers): + + h, c = hidden_state[layer_idx] + output_inner = [] + for t in range(timestamp): + h, c = self.cell_list[layer_idx](input_tensor=cur_layer_input[:, t, :], + cur_state=[h, c]) + output_inner.append(h) + + layer_output = torch.stack(output_inner, dim=1) + + # TODO 每层之间增加一个dct_attention + layer_output = self.attention_list[layer_idx](layer_output) + + cur_layer_input = layer_output + + layer_output_list.append(layer_output) + last_state_list.append([h, c]) + + if not self.return_all_layers: + layer_output_list = layer_output_list[-1:] + last_state_list = last_state_list[-1:] + + return layer_output_list, last_state_list + + def _init_hidden(self, batch_size): + init_states = [] + for i in range(self.num_layers): + init_states.append(self.cell_list[i].init_hidden(batch_size)) + return init_states + + @staticmethod + def _extend_for_multilayer(param, num_layers): + if not isinstance(param, list): + param = [param] * num_layers + return param + + +class PredictModel(nn.Module): + + def __init__(self, input_dim): + super(PredictModel, self).__init__() + + self.lstm = LSTM(input_dim=input_dim, hidden_dim=[64, 64], num_layers=2, batch_first=True, bias=True, + return_all_layers=False) + self.backbone = nn.Sequential( + nn.Linear(in_features=64, out_features=64), + nn.Linear(in_features=64, out_features=64), + nn.BatchNorm1d(64), + nn.ReLU(), + nn.Dropout(0.5), + nn.Linear(in_features=64, out_features=1) + ) + + def forward(self, input_tensor): + input_tensor = input_tensor.to(torch.float32) + layer_output_list, last_states = self.lstm(input_tensor) + last_timestamp = last_states[0][0] + predict = self.backbone(last_timestamp) + return predict + + +if __name__ == '__main__': + x = torch.rand((32, 10, 64)) + lstm = LSTM(input_dim=64, hidden_dim=16, num_layers=1, batch_first=True, bias=True, + return_all_layers=False) + layer_output_list, last_states = lstm(x) + + all = layer_output_list[0] + h = last_states[0][0] + print(all.size()) + print(h.size()) diff --git a/pytorch_example/RUL/otherIdea/dctLSTM/test.py b/pytorch_example/RUL/otherIdea/dctLSTM/test.py new file mode 100644 index 0000000..e9e9892 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctLSTM/test.py @@ -0,0 +1,119 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 16:27 +@Usage : +@Desc : +''' + +import numpy as np +import torch +from RUL.otherIdea.dctLSTM.loadData import getDataset, getTotalData +from RUL.otherIdea.dctLSTM.modelForEasy import PredictModel +from torch.utils.data import DataLoader +import matplotlib.pyplot as plt +from RUL.baseModel.plot import plot_prediction, plot_forSelf +from RUL.baseModel.loss.Evaluate import getEvaluate + +# 仅使用预测出来的最新的一个点预测以后 +def predictOneByOne(model, train_data, predict_num=50): + # 取出训练数据的最后一条 + each_predict_data = train_data + predicted_list = np.empty(shape=(predict_num, 1)) # (5,filter_num,30) + # all_data = total_data # (1201,) + for each_predict in range(predict_num): + # predicted_data.shape : (1,1) + predicted_data = model(each_predict_data).cpu().detach().numpy()[-1] # (batch_size,filer_num,1) + predicted_list[each_predict] = predicted_data + each_predict_data = each_predict_data.numpy() + # (1,1) => (10,1) + # 中间拼接过程: (1) => (10) => (40,10) => (30,40,10) + a = np.concatenate([each_predict_data[-1, -1, 1:], predicted_data], axis=0) + b = np.concatenate([each_predict_data[-1, 1:, :], np.expand_dims(a, axis=0)], axis=0) + c = np.concatenate([each_predict_data[1:, :, :], np.expand_dims(b, axis=0)], axis=0) + + each_predict_data = torch.tensor(c) + + return np.squeeze(predicted_list) + + +def test(hidden_num, feature, predict_num, batch_size, save_path, save_fig_name, is_single=True, is_norm=False): + total_data, total_dataset = getTotalData(hidden_num, feature, is_single=is_single, is_norm=is_norm) + train_dataset, val_dataset = getDataset(hidden_num, feature, predict_num=predict_num, is_single=is_single, + is_norm=is_norm) + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + model = PredictModel(input_dim=feature).to(device) + + model.load_state_dict( + torch.load(save_path, map_location=device) + ) + + print(model) + params_num = sum(param.numel() for param in model.parameters()) + print('参数数量:{}'.format(params_num)) + + model.eval() + + predicted_data_easy = total_data[:hidden_num + feature, ] + predicted_data_hard = total_data[:hidden_num + feature, ] + + + # 衡量矩阵 + train_list = [] + easy_list = [] + val_label = [] + + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(train_loader): + data, label = data.to(device), label.to(device) + last_train_data = data + each_predicted_data = torch.squeeze(model(data)).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + predicted_data_hard = np.concatenate( + [predicted_data_hard, each_predicted_data], + axis=0) + train_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + + # 简单版的,每次预测重新用已知的 + for batch_idx, (data, label) in enumerate(val_loader): + data, label = data.to(device), label.to(device) + each_predicted_data = torch.squeeze(model(data)).cpu().detach().numpy() + predicted_data_easy = np.concatenate( + [predicted_data_easy, each_predicted_data], + axis=0) + easy_list.append(getEvaluate(label.cpu().detach().numpy(), each_predicted_data)) + val_label = np.concatenate( + [val_label, label.cpu().detach().numpy()], + axis=0) + + # 困难版的,每次预测基于上次的预测 + predict_hard = predictOneByOne(model, last_train_data, predict_num=predict_num) + predicted_data_hard = np.concatenate([predicted_data_hard, + predict_hard], axis=0) + ####衡量 + train_evaluate = np.mean(train_list, axis=0) + easy_evaluate = np.mean(easy_list, axis=0) + hard_evaluate = getEvaluate(val_label, predict_hard) + print('train: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (train_evaluate[0], train_evaluate[1], train_evaluate[2], train_evaluate[3])) + print('easy: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (easy_evaluate[0], easy_evaluate[1], easy_evaluate[2], easy_evaluate[3])) + print('hard: RMSE %.6f, MAE %.6f, MAPE %.6f, Score %.6f' % + (hard_evaluate[0], hard_evaluate[1], hard_evaluate[2], hard_evaluate[3])) + + plot_prediction(total_data, predicted_data_easy, predicted_data_hard, save_fig_name, predict_num=predict_num) + plot_forSelf(total_data, predicted_data_easy, predicted_data_hard) + + +if __name__ == '__main__': + test(40, 10, 50, 32, + "./parameters\dctLSTM_hidden40_feature10_predict50_epoch80_trainLoss0.05818896507844329_valLoss0.21667905896902084.pkl" + ) diff --git a/pytorch_example/RUL/otherIdea/dctLSTM/train.py b/pytorch_example/RUL/otherIdea/dctLSTM/train.py new file mode 100644 index 0000000..7c24af4 --- /dev/null +++ b/pytorch_example/RUL/otherIdea/dctLSTM/train.py @@ -0,0 +1,203 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/10 14:56 +@Usage : +@Desc : 训练LSTM +''' +import os +import time +import random +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F +import matplotlib.pyplot as plt +from torch.utils.data import DataLoader +from RUL.otherIdea.dctLSTM.modelForEasy import PredictModel +from RUL.otherIdea.dctLSTM.loadData import getDataset +from RUL.otherIdea.dctLSTM.test import test +from RUL.baseModel.CommonFunction import IsStopTraining +import RUL.baseModel.utils.utils as utils +import math + +''' +超参数设置: +''' +hidden_num = 40 # LSTM细胞个数 +feature = 10 # 一个点的维度 +batch_size = 32 +EPOCH = 1000 +predict_num = 200 # 预测个数 +seed = 250 +is_norm = False +is_single = True +model_name = "dctLSTM" +base_save = r"parameters/{0}_hidden{1}_feature{2}_predict{3}".format(model_name, hidden_num, feature, + predict_num) +save_fig_name = 'fig/seed{0}_hidden{1}_feature{2}_predict{3}'.format(seed, hidden_num, feature, predict_num) + +if not os.path.exists("parameters"): + os.makedirs("parameters") +if not os.path.exists("fig"): + os.makedirs("fig") + + +def get_dataset(): + '''得到数据集''' + train_dataset, val_dataset = getDataset( + hidden_num=hidden_num, feature=feature, predict_num=predict_num, is_single=is_single, is_norm=is_norm) + '''DataLoader''' + + train_loader = DataLoader(dataset=train_dataset, batch_size=batch_size, shuffle=True, drop_last=False) + val_loader = DataLoader(dataset=val_dataset, batch_size=batch_size, shuffle=False, drop_last=False) + return train_loader, val_loader + + +def train(device, lr, lr_patience, early_stop_patience, epochs): + '''预测模型''' + global best_save_path + model = PredictModel(input_dim=feature) + '''得到数据集''' + train_loader, val_loader = get_dataset() + criterion = nn.MSELoss().to(device) + + optimizer_model = torch.optim.SGD(model.parameters(), lr=lr) + + scheduler_model = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer_model, mode="min", factor=0.5, + patience=lr_patience) + + def zero_grad_all(): + optimizer_model.zero_grad() + + train_loss_list = [] + val_loss_list = [] + best_save_path = None + for epoch in range(epochs): + epoch_start_time = time.time() + train_loss = 0.0 + val_loss = 0.0 + + model.train() + + for (train_batch_idx, (train_data, train_label)) in enumerate(train_loader): + train_data, train_label = train_data.to(device), train_label.to(device) + + zero_grad_all() + + predict_data = torch.squeeze(model(train_data)) + + # MSE损失 + loss = criterion(predict_data, train_label) + + loss.backward() + optimizer_model.step() + + zero_grad_all() + + train_loss += loss.item() + + model.eval() + + with torch.no_grad(): + for val_batch_idx, (val_data, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + val_predict_data = torch.squeeze(model(val_data)) + + loss = criterion(val_predict_data, val_label) + val_loss += loss.item() + + scheduler_model.step(val_loss) + + train_loss = train_loss / len(train_loader) + val_loss = val_loss / len(val_loader) + print( + "[{:03d}/{:03d}] {:2.2f} sec(s) train_loss: {:3.9f} | val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, + train_loss, + val_loss, + optimizer_model.state_dict()['param_groups'][0]['lr'])) + + # 保存在验证集上loss最小的模型 + # if val_loss_list.__len__() > 0 and (val_loss / val_dataset.__len__()) < min(val_loss_list): + # 如果精度大于最高精度,则保存 + + if len(val_loss_list) == 0 or val_loss < min(val_loss_list): + print("保存模型最佳模型成功") + # 保存模型参数 + if best_save_path != None: + utils.delete_file(best_save_path) + best_save_path = base_save + "_epoch" + str(epoch) + \ + "_trainLoss" + str(train_loss) + \ + "_valLoss" + str(val_loss) + ".pkl" + torch.save(model.state_dict(), + best_save_path) + + train_loss_list.append(train_loss) + + val_loss_list.append(val_loss) + + if IsStopTraining(history_loss=val_loss_list, patience=early_stop_patience): + break + + '''保存的模型参数的路径''' + + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + pic1 = plt.figure(figsize=(12, 6), dpi=200) + + plt.plot(np.arange(1, len(train_loss_list) + 1), train_loss_list, 'b', label='Training Loss') + plt.plot(np.arange(1, len(train_loss_list) + 1), val_loss_list, 'r', label='Validation Loss') + # plt.ylim(0, 0.08) # 设置y轴范围 + plt.title('Training & Validation loss') + plt.xlabel('epoch') + plt.ylabel('loss') + plt.legend(loc='upper right') + plt.grid(alpha=0.4) + + # 获取当前时间戳 + timestamp = int(time.time()) + + # 将时间戳转换为字符串 + timestamp_str = str(timestamp) + plt.savefig(timestamp_str, dpi=200) + plt.show() + + return best_save_path + + +if __name__ == '__main__': + + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + '''训练''' + save_path = train(device, lr=0.01, lr_patience=10, early_stop_patience=20, epochs=1000) + + end = time.time() + + '''测试''' + # test1(5, src_condition, tar_condition, G_params_path, LC_params_path) + + test(hidden_num, feature, predict_num=predict_num, + batch_size=batch_size, save_path=save_path, + is_single=is_single, is_norm=is_norm,save_fig_name=save_fig_name) + + print("训练耗时:{:3.2f}s".format(end - begin)) diff --git a/pytorch_example/__init__.py b/pytorch_example/__init__.py new file mode 100644 index 0000000..090d185 --- /dev/null +++ b/pytorch_example/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 21:32 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/example/__init__.py b/pytorch_example/example/__init__.py new file mode 100644 index 0000000..0a7fc33 --- /dev/null +++ b/pytorch_example/example/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/9 21:28 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/example/load_data.py b/pytorch_example/example/load_data.py new file mode 100644 index 0000000..1e4b4eb --- /dev/null +++ b/pytorch_example/example/load_data.py @@ -0,0 +1,111 @@ +""" +@Author: miykah +@Email: miykah@163.com +@FileName: load_data.py +@DateTime: 2022/7/20 16:40 +""" +import matplotlib.pyplot as plt +import torch +import numpy as np +from torch.utils.data import Dataset, DataLoader +import torchvision.transforms as transforms +import random + +'''正常Dataset类''' +class Nor_Dataset(Dataset): + def __init__(self, datas, labels=None): + self.datas = torch.tensor(datas) + if labels is not None: + self.labels = torch.tensor(labels) + else: + self.labels = None + def __getitem__(self, index): + data = self.datas[index] + if self.labels is not None: + label = self.labels[index] + return data, label + return data + def __len__(self): + return len(self.datas) + +'''未标记目标数据的Dataset类''' +class Tar_U_Dataset(Dataset): + def __init__(self, datas): + self.datas = torch.tensor(datas) + def __getitem__(self, index): + data = self.datas[index] + data_bar = data.clone().detach() + data_bar2 = data.clone().detach() + mu = 0 + sigma = 0.1 + '''对未标记目标数据加噪,得到data'和data'' ''' + for i, j in zip(range(data_bar[0].shape[0]), range(data_bar2[0].shape[0])): + data_bar[0, i] += random.gauss(mu, sigma) + data_bar2[0, j] += random.gauss(mu, sigma) + return data, data_bar, data_bar2 + def __len__(self): + return len(self.datas) + +def draw_signal_img(data, data_bar, data_bar2): + pic = plt.figure(figsize=(12, 6), dpi=100) + plt.rcParams['font.family'] = ['Arial Unicode MS', 'Microsoft YaHei', 'SimHei', 'sans-serif'] + plt.rcParams['axes.unicode_minus'] = False + plt.subplot(3, 1, 1) + plt.plot(data, 'b') + plt.subplot(3, 1, 2) + plt.plot(data_bar, 'b') + plt.subplot(3, 1, 3) + plt.plot(data_bar2, 'b') + plt.show() + +def get_dataset(src_condition, tar_condition): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + + src_data = np.load(root_dir + src_condition + '\\src\\' + 'data.npy') + src_label = np.load(root_dir + src_condition + '\\src\\' + 'label.npy') + + tar_data = np.load(root_dir + tar_condition + '\\tar\\' + 'data.npy') + + val_data = np.load(root_dir + tar_condition + '\\val\\' + 'data.npy') + val_label = np.load(root_dir + tar_condition + '\\val\\' + 'label.npy') + + test_data = np.load(root_dir + tar_condition + '\\test\\' + 'data.npy') + test_label = np.load(root_dir + tar_condition + '\\test\\' + 'label.npy') + + src_dataset = Nor_Dataset(src_data, src_label) + tar_dataset = Nor_Dataset(tar_data) + val_dataset = Nor_Dataset(val_data, val_label) + test_dataset = Nor_Dataset(test_data, test_label) + + return src_dataset, tar_dataset, val_dataset, test_dataset + + + + +if __name__ == '__main__': + # pass + # tar_data = np.load("E:\\DataSet\\DDS_data_CDAC\\processed_data\\A\\tar\\data.npy") + # tar_dataset = Nor_Dataset(datas=tar_data) + # tar_loader = DataLoader(dataset=tar_dataset, batch_size=len(tar_dataset), shuffle=False) + # + # for batch_idx, (data) in enumerate(tar_loader): + # print(data[0][0]) + # # print(data_bar[0][0]) + # # print(data_bar2[0][0]) + # if batch_idx == 0: + # break + src_data = np.load("E:\\DataSet\\DDS_data_CDAC\\processed_data\\A\\src\\data.npy") + src_label = np.load("E:\\DataSet\\DDS_data_CDAC\\processed_data\\A\\src\\label.npy") + src_dataset = Nor_Dataset(datas=src_data, labels=src_label) + src_loader = DataLoader(dataset=src_dataset, batch_size=len(src_dataset), shuffle=False) + + for batch_idx, (data, label) in enumerate(src_loader): + print(data[10][0]) + print(label[10]) + # print(data_bar[0][0]) + # print(data_bar2[0][0]) + if batch_idx == 0: + break \ No newline at end of file diff --git a/pytorch_example/example/loss.py b/pytorch_example/example/loss.py new file mode 100644 index 0000000..faef623 --- /dev/null +++ b/pytorch_example/example/loss.py @@ -0,0 +1,127 @@ +""" +@Author: miykah +@Email: miykah@163.com +@FileName: loss.py +@DateTime: 2022/7/21 14:31 +""" + +import torch +import numpy as np +import torch.nn.functional as functional +import torch.nn as nn +import example.mmd as mmd + +''' + 计算条件概率分布的差异 + mmdc = mmd_condition +''' +def cal_mmdc_loss(src_data_mmd1, src_data_mmd2, tar_data_mmd1, tar_data_mmd2): + src_cls_10 = src_data_mmd1[3 * 0: 3 * 1] + src_cls_11 = src_data_mmd1[3 * 1: 3 * 2] + src_cls_12 = src_data_mmd1[3 * 2: 3 * 3] + src_cls_13 = src_data_mmd1[3 * 3: 3 * 4] + src_cls_14 = src_data_mmd1[3 * 4: 3 * 5] + src_cls_15 = src_data_mmd1[3 * 5: 3 * 6] + src_cls_16 = src_data_mmd1[3 * 6: 3 * 7] + src_cls_17 = src_data_mmd1[3 * 7: 3 * 8] + src_cls_18 = src_data_mmd1[3 * 8: 3 * 9] + src_cls_19 = src_data_mmd1[3 * 9: 3 * 10] + + tar_cls_10 = tar_data_mmd1[3 * 0: 3 * 1] + tar_cls_11 = tar_data_mmd1[3 * 1: 3 * 2] + tar_cls_12 = tar_data_mmd1[3 * 2: 3 * 3] + tar_cls_13 = tar_data_mmd1[3 * 3: 3 * 4] + tar_cls_14 = tar_data_mmd1[3 * 4: 3 * 5] + tar_cls_15 = tar_data_mmd1[3 * 5: 3 * 6] + tar_cls_16 = tar_data_mmd1[3 * 6: 3 * 7] + tar_cls_17 = tar_data_mmd1[3 * 7: 3 * 8] + tar_cls_18 = tar_data_mmd1[3 * 8: 3 * 9] + tar_cls_19 = tar_data_mmd1[3 * 9: 3 * 10] + + + src_cls_20 = src_data_mmd2[3 * 0: 3 * 1] + src_cls_21 = src_data_mmd2[3 * 1: 3 * 2] + src_cls_22 = src_data_mmd2[3 * 2: 3 * 3] + src_cls_23 = src_data_mmd2[3 * 3: 3 * 4] + src_cls_24 = src_data_mmd2[3 * 4: 3 * 5] + src_cls_25 = src_data_mmd2[3 * 5: 3 * 6] + src_cls_26 = src_data_mmd2[3 * 6: 3 * 7] + src_cls_27 = src_data_mmd2[3 * 7: 3 * 8] + src_cls_28 = src_data_mmd2[3 * 8: 3 * 9] + src_cls_29 = src_data_mmd2[3 * 9: 3 * 10] + + tar_cls_20 = tar_data_mmd2[3 * 0: 3 * 1] + tar_cls_21 = tar_data_mmd2[3 * 1: 3 * 2] + tar_cls_22 = tar_data_mmd2[3 * 2: 3 * 3] + tar_cls_23 = tar_data_mmd2[3 * 3: 3 * 4] + tar_cls_24 = tar_data_mmd2[3 * 4: 3 * 5] + tar_cls_25 = tar_data_mmd2[3 * 5: 3 * 6] + tar_cls_26 = tar_data_mmd2[3 * 6: 3 * 7] + tar_cls_27 = tar_data_mmd2[3 * 7: 3 * 8] + tar_cls_28 = tar_data_mmd2[3 * 8: 3 * 9] + tar_cls_29 = tar_data_mmd2[3 * 9: 3 * 10] + + mmd_10 = mmd.mmd_linear(src_cls_10, tar_cls_10) + mmd_11 = mmd.mmd_linear(src_cls_11, tar_cls_11) + mmd_12 = mmd.mmd_linear(src_cls_12, tar_cls_12) + mmd_13 = mmd.mmd_linear(src_cls_13, tar_cls_13) + mmd_14 = mmd.mmd_linear(src_cls_14, tar_cls_14) + mmd_15 = mmd.mmd_linear(src_cls_15, tar_cls_15) + mmd_16 = mmd.mmd_linear(src_cls_16, tar_cls_16) + mmd_17 = mmd.mmd_linear(src_cls_17, tar_cls_17) + mmd_18 = mmd.mmd_linear(src_cls_18, tar_cls_18) + mmd_19 = mmd.mmd_linear(src_cls_19, tar_cls_19) + + mmd_20 = mmd.mmd_linear(src_cls_20, tar_cls_20) + mmd_21 = mmd.mmd_linear(src_cls_21, tar_cls_21) + mmd_22 = mmd.mmd_linear(src_cls_22, tar_cls_22) + mmd_23 = mmd.mmd_linear(src_cls_23, tar_cls_23) + mmd_24 = mmd.mmd_linear(src_cls_24, tar_cls_24) + mmd_25 = mmd.mmd_linear(src_cls_25, tar_cls_25) + mmd_26 = mmd.mmd_linear(src_cls_26, tar_cls_26) + mmd_27 = mmd.mmd_linear(src_cls_27, tar_cls_27) + mmd_28 = mmd.mmd_linear(src_cls_28, tar_cls_28) + mmd_29 = mmd.mmd_linear(src_cls_29, tar_cls_29) + + mmdc1 = mmd_10 + mmd_11 + mmd_12 + mmd_13 + mmd_14 + mmd_15 + mmd_16 + mmd_17 + mmd_18 + mmd_19 + mmdc2 = mmd_20 + mmd_21 + mmd_22 + mmd_23 + mmd_24 + mmd_25 + mmd_26 + mmd_27 + mmd_28 + mmd_29 + + return (mmdc2) / 10 + # return (mmdc1 + mmdc2) / 20 + +'''得到源域每类特征,用于计算mmdc''' +def get_src_mean_feature(src_feature, shot, cls): + src_feature_list = [] + for i in range(cls): + src_feature_cls = torch.mean(src_feature[shot * i: shot * (i + 1)], dim=0) + src_feature_list.append(src_feature_cls) + return src_feature_list + +def get_mmdc(src_feature, tar_feature, tar_pseudo_label, batch_size, shot, cls): + src_feature_list = get_src_mean_feature(src_feature, shot, cls) + pseudo_label = tar_pseudo_label.cpu().detach().numpy() + mmdc = 0.0 + for i in range(batch_size): + # mmdc += mmd.mmd_linear(src_feature_list[pseudo_label[i]].reshape(1, -1), tar_feature[i].reshape(1, -1)) + mmdc += mmd.mmd_linear(src_feature_list[pseudo_label[i]].reshape(1, -1), tar_feature[i].reshape(1, -1)) + return mmdc / batch_size + +class BCE(nn.Module): + eps = 1e-7 + def forward(self, prob1, prob2, simi): + P = prob1.mul_(prob2) + P = P.sum(1) + P.mul_(simi).add_(simi.eq(-1).type_as(P)) + neglogP = -P.add_(BCE.eps).log_() + return neglogP.mean() + +class BinaryCrossEntropyLoss(nn.Module): + """ Construct binary cross-entropy loss.""" + eps = 1e-7 + def forward(self, prob): + # ds = torch.ones([bs, 1]).to(device) # domain label for source + # dt = torch.zeros([bs, 1]).to(device) # domain label for target + # di = torch.cat((ds, dt), dim=0).to(device) + # neglogP = - (di * torch.log(prob + BCE.eps) + (1. - di) * torch.log(1. - prob + BCE.eps)) + neglogP = - (prob * torch.log(prob + BCE.eps) + (1. - prob) * torch.log(1. - prob + BCE.eps)) + return neglogP.mean() \ No newline at end of file diff --git a/pytorch_example/example/mmd.py b/pytorch_example/example/mmd.py new file mode 100644 index 0000000..65ed811 --- /dev/null +++ b/pytorch_example/example/mmd.py @@ -0,0 +1,56 @@ +#!/usr/bin/env python +# encoding: utf-8 + +import torch + +# Consider linear time MMD with a linear kernel: +# K(f(x), f(y)) = f(x)^Tf(y) +# h(z_i, z_j) = k(x_i, x_j) + k(y_i, y_j) - k(x_i, y_j) - k(x_j, y_i) +# = [f(x_i) - f(y_i)]^T[f(x_j) - f(y_j)] +# +# f_of_X: batch_size * k +# f_of_Y: batch_size * k +def mmd_linear(f_of_X, f_of_Y): + delta = f_of_X - f_of_Y + loss = torch.mean(torch.mm(delta, torch.transpose(delta, 0, 1))) + return loss + +def guassian_kernel(source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None): + n_samples = int(source.size()[0])+int(target.size()[0]) + total = torch.cat([source, target], dim=0) + total0 = total.unsqueeze(0).expand(int(total.size(0)), int(total.size(0)), int(total.size(1))) + total1 = total.unsqueeze(1).expand(int(total.size(0)), int(total.size(0)), int(total.size(1))) + L2_distance = ((total0-total1)**2).sum(2) + if fix_sigma: + bandwidth = fix_sigma + else: + bandwidth = torch.sum(L2_distance.data) / (n_samples**2-n_samples) + bandwidth /= kernel_mul ** (kernel_num // 2) + bandwidth_list = [bandwidth * (kernel_mul**i) for i in range(kernel_num)] + kernel_val = [torch.exp(-L2_distance / bandwidth_temp) for bandwidth_temp in bandwidth_list] + return sum(kernel_val)#/len(kernel_val) + + +def mmd_rbf_accelerate(source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None): + batch_size = int(source.size()[0]) + kernels = guassian_kernel(source, target, + kernel_mul=kernel_mul, kernel_num=kernel_num, fix_sigma=fix_sigma) + loss = 0 + for i in range(batch_size): + s1, s2 = i, (i+1)%batch_size + t1, t2 = s1+batch_size, s2+batch_size + loss += kernels[s1, s2] + kernels[t1, t2] + loss -= kernels[s1, t2] + kernels[s2, t1] + return loss / float(batch_size) + +def mmd_rbf_noaccelerate(source, target, kernel_mul=2.0, kernel_num=5, fix_sigma=None): + batch_size = int(source.size()[0]) + kernels = guassian_kernel(source, target, + kernel_mul=kernel_mul, kernel_num=kernel_num, fix_sigma=fix_sigma) + XX = kernels[:batch_size, :batch_size] + YY = kernels[batch_size:, batch_size:] + XY = kernels[:batch_size, batch_size:] + YX = kernels[batch_size:, :batch_size] + loss = torch.mean(XX + YY - XY -YX) + return loss + diff --git a/pytorch_example/example/model.py b/pytorch_example/example/model.py new file mode 100644 index 0000000..42af880 --- /dev/null +++ b/pytorch_example/example/model.py @@ -0,0 +1,109 @@ +""" +@Author: miykah +@Email: miykah@163.com +@FileName: model.py +@DateTime: 2022/7/20 21:18 +""" + +import torch +import torch.nn as nn +import torch.nn.functional as F +from torch.autograd import Function + +class GradReverse(Function): + def __init__(self): + self.lambd = 1.0 + + def forward(self, x): + return x.view_as(x) + + def backward(self, grad_output): + return (grad_output * - 1.0) + +def grad_reverse(x): + return GradReverse.apply(x) + # return GradReverse(lambd)(x) + +'''特征提取器''' +class Extractor(nn.Module): + def __init__(self): + super(Extractor, self).__init__() + self.conv1 = nn.Sequential( + nn.Conv1d(in_channels=1, out_channels=32, kernel_size=13, padding='same'), + nn.BatchNorm1d(32), + nn.ReLU(), + nn.MaxPool1d(2) # (32 * 1024) + ) + self.conv2 = nn.Sequential( + nn.Conv1d(in_channels=32, out_channels=32, kernel_size=13, padding='same'), + nn.BatchNorm1d(32), + nn.ReLU(), + nn.MaxPool1d(2) # (32 * 512) + ) + self.conv3 = nn.Sequential( + nn.Conv1d(in_channels=32, out_channels=32, kernel_size=13, padding='same'), + nn.BatchNorm1d(32), + nn.ReLU(), + nn.MaxPool1d(2) # (32 * 256) + ) + + def forward(self, src_data, tar_data): + src_data = self.conv1(src_data) + src_data = self.conv2(src_data) + src_feature = self.conv3(src_data) + + tar_data = self.conv1(tar_data) + tar_data = self.conv2(tar_data) + tar_feature = self.conv3(tar_data) + return src_feature, tar_feature + +'''标签分类器''' +class LabelClassifier(nn.Module): + def __init__(self, cls_num): + super(LabelClassifier, self).__init__() + self.fc1 = nn.Sequential( + nn.Flatten(), # (8192,) + nn.Linear(in_features=8192, out_features=256), + ) + self.fc2 = nn.Sequential( + nn.ReLU(), + nn.Linear(in_features=256, out_features=cls_num) + ) + def forward(self, src_feature, tar_feature): + src_data_mmd1 = self.fc1(src_feature) + src_output = self.fc2(src_data_mmd1) + + tar_data_mmd1 = self.fc1(tar_feature) + tar_output = self.fc2(tar_data_mmd1) + return src_data_mmd1, src_output, tar_data_mmd1, tar_output + +'''分类器''' +class DomainClassifier(nn.Module): + def __init__(self, temp=0.05): + super(DomainClassifier, self).__init__() + self.fc = nn.Sequential( + nn.Flatten(), + nn.Linear(in_features=8192, out_features=512), + nn.ReLU(), + nn.Linear(in_features=512, out_features=128), + nn.ReLU(), + nn.Linear(in_features=128, out_features=1), + nn.Sigmoid() + ) + self.temp = temp + def forward(self, x, reverse=False): + if reverse: + x = grad_reverse(x) + output = self.fc(x) + return output + +'''初始化网络权重''' +def weights_init_Extractor(m): + if isinstance(m, nn.Conv1d): + nn.init.kaiming_normal_(m.weight, mode='fan_in', nonlinearity='relu') + nn.init.constant_(m.bias, 0) + +def weights_init_Classifier(m): + if isinstance(m, nn.Linear): + nn.init.xavier_normal_(m.weight) + nn.init.constant_(m.bias, 0) \ No newline at end of file diff --git a/pytorch_example/example/read_data.py b/pytorch_example/example/read_data.py new file mode 100644 index 0000000..2b70b71 --- /dev/null +++ b/pytorch_example/example/read_data.py @@ -0,0 +1,298 @@ +""" +@Author: miykah +@Email: miykah@163.com +@FileName: read_data_cwru.py +@DateTime: 2022/7/20 15:58 +""" +import math +import os +import scipy.io as scio +import numpy as np +import PIL.Image as Image +import matplotlib.pyplot as plt +import torch + +def dat_to_numpy(samples_num, sample_length): + '''根据每个类别需要的样本数和样本长度计算采样步长''' + stride = math.floor((204800 * 4 - sample_length) / (samples_num - 1)) + + conditions = ['A', 'B', 'C'] + for condition in conditions: + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_11\\' + condition + save_dir = 'D:\\DataSet\\DDS_data\\5cls_11\\raw_data\\' + condition + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_11\\' + condition + save_dir = 'E:\\DataSet\\DDS_data\\5cls_11\\raw_data\\' + condition + + if condition == 'A': + start_idx = 1 + end_idx = 5 + # start_idx = 13 + # end_idx = 17 + # start_idx = 25 + # end_idx = 29 + # start_idx = 9 + # end_idx = 13 + elif condition == 'B': + start_idx = 5 + end_idx = 9 + # start_idx = 17 + # end_idx = 21 + # start_idx = 29 + # end_idx = 33 + elif condition == 'C': + start_idx = 9 + end_idx = 13 + # start_idx = 21 + # end_idx = 25 + # start_idx = 33 + # end_idx = 37 + # start_idx = 25 + # end_idx = 29 + + dir_names = os.listdir(root_dir) + print(dir_names) + ''' + 故障类型 + ['平行齿轮箱轴承内圈故障恒速', '平行齿轮箱轴承外圈故障恒速', + '平行齿轮箱轴承滚动体故障恒速', '平行齿轮箱齿轮偏心故障恒速', + '平行齿轮箱齿轮断齿故障恒速', '平行齿轮箱齿轮缺齿故障恒速', + '平行齿轮箱齿轮表面磨损故障恒速', '平行齿轮箱齿轮齿根裂纹故障恒速'] + ''' + if not os.path.exists(save_dir): + os.makedirs(save_dir) + for dir_name in dir_names: + data_list = [] + for i in range(start_idx, end_idx): + if i < 10: + path = root_dir + '\\' + dir_name + '\dds测试故障库4.6#000' + str(i) + '.dat' + else: + path = root_dir + '\\' + dir_name + '\dds测试故障库4.6#00' + str(i) + '.dat' + data = np.fromfile(path, dtype='float32')[204800 * 2: 204800 * 3] + data_list.append(data) + # data_one_cls = np.array(data_list).reshape(-1).reshape(-1, 1024) + # data_one_cls = np.array(data_list).reshape(-1).reshape(-1, 1, 2048) #(400, 1, 2048) + data_one_cls = np.array(data_list).reshape(-1) + n = math.floor((204800 * 4 - sample_length) / stride + 1) + list = [] + for i in range(n): + start = i * stride + end = i * stride + sample_length + list.append(data_one_cls[start: end]) + data_one_cls = np.array(list).reshape(-1, 1, sample_length) + # 打乱数据 + shuffle_ix = np.random.permutation(np.arange(len(data_one_cls))) + data_one_cls = data_one_cls[shuffle_ix] + print(data_one_cls.shape) + np.save(save_dir + '\\' + dir_name + '.npy', data_one_cls) + + +def draw_signal_img(condition): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\4cls_speed30\\raw_data\\' + condition + else: + root_dir = 'E:\\DataSet\\DDS_data\\4cls_speed30\\raw_data\\' + condition + file_names = os.listdir(root_dir) + pic = plt.figure(figsize=(12, 6), dpi=200) + # plt.rcParams['font.family'] = ['Arial Unicode MS', 'Microsoft YaHei', 'SimHei', 'sans-serif'] + # plt.rcParams['axes.unicode_minus'] = False + plt.rc('font',family='Times New Roman') + clses = ['(a)', '(b)', '(c)', '(d)'] + for file_name, i, cls in zip(file_names, range(4), clses): + data = np.load(root_dir + '\\' + file_name)[0].reshape(-1) + print(data.shape, file_name) + plt.tick_params(top='on', right='on', which='both') # 设置上面和右面也有刻度 + plt.rcParams['xtick.direction'] = 'in' # 将x周的刻度线方向设置向内 + plt.rcParams['ytick.direction'] = 'in' #将y轴的刻度方向设置向内 + plt.subplot(2, 2, i + 1) + plt.title(cls, fontsize=20) + plt.xlabel("Time (s)", fontsize=20) + plt.ylabel("Amplitude (m/s²)", fontsize=20) + plt.xlim(0, 0.16) + plt.ylim(-3, 3) + plt.yticks(np.array([-2, 0, 2]), fontsize=20) + plt.xticks(np.array([0, 640, 1280, 1920, 2048]), np.array(['0', 0.05, 0.1, 0.15]), fontsize=20) + plt.plot(data) + plt.show() + +def draw_signal_img2(): + conditions = ['A', 'B', 'C'] + pic = plt.figure(figsize=(12, 6), dpi=600) + plt.text(x=1, y=3, s='A') + i = 1 + for condition in conditions: + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne\\raw_data\\' + condition + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne\\raw_data\\' + condition + file_names = os.listdir(root_dir) + # plt.rcParams['font.family'] = ['Arial Unicode MS', 'Microsoft YaHei', 'SimHei', 'sans-serif'] + # plt.rcParams['axes.unicode_minus'] = False + plt.rc('font',family='Times New Roman') + clses = ['(a)', '(b)', '(c)', '(d)', '(e)'] + for file_name, cls in zip(file_names, clses): + data = np.load(root_dir + '\\' + file_name)[3].reshape(-1) + print(data.shape, file_name) + plt.tick_params(top='on', right='on', which='both') # 设置上面和右面也有刻度 + plt.rcParams['xtick.direction'] = 'in' # 将x周的刻度线方向设置向内 + plt.rcParams['ytick.direction'] = 'in' #将y轴的刻度方向设置向内 + plt.subplot(3, 5, i) + plt.title(cls, fontsize=15) + plt.xlabel("Time (s)", fontsize=15) + plt.ylabel("Amplitude (m/s²)", fontsize=15) + plt.xlim(0, 0.16) + plt.ylim(-5, 5) + plt.yticks(np.array([-3, 0, 3]), fontsize=15) + plt.xticks(np.array([0, 640, 1280, 1920, 2048]), np.array(['0', 0.05, 0.1, 0.15]), fontsize=15) + plt.plot(data) + i += 1 + plt.show() + +'''得到源域数据和标签''' +def get_src_data(src_condition, shot): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + src_condition + save_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + src_condition + '\\src' + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + src_condition + save_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + src_condition + '\\src' + + file_names = os.listdir(root_dir) + # print(file_names) + datas = [] + labels = [] + for i in range(600 // shot): + for file_name, cls in zip(file_names, range(5)): + data = np.load(root_dir + '\\' + file_name) + data_cut = data[shot * i: shot * (i + 1), :, :] + label_cut = np.array([cls] * shot, dtype='int64') + datas.append(data_cut) + labels.append(label_cut) + datas = np.array(datas).reshape(-1, 1, 2048) + labels = np.array(labels).reshape(-1) + print(datas.shape, labels.shape) + if not os.path.exists(save_dir): + os.makedirs(save_dir) + np.save(save_dir + '\\' + 'data.npy', datas) + np.save(save_dir + '\\' + 'label.npy', labels) + +'''得到没有标签的目标域数据''' +def get_tar_data(tar_condition): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + tar_condition + save_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + tar_condition + '\\tar' + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + tar_condition + save_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + tar_condition + '\\tar' + file_names = os.listdir(root_dir) + datas = [] + for file_name in file_names: + data = np.load(root_dir + '\\' + file_name) + data_cut = data[0: 600, :, :] + datas.append(data_cut) + datas = np.array(datas).reshape(-1, 1, 2048) + print("datas.shape: {}".format(datas.shape)) + if not os.path.exists(save_dir): + os.makedirs(save_dir) + np.save(save_dir + '\\' + 'data.npy', datas) + +def get_tar_data2(tar_condition, shot): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + tar_condition + save_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + tar_condition + '\\tar1' + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + tar_condition + save_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + tar_condition + '\\tar1' + file_names = os.listdir(root_dir) + datas = [] + labels = [] + for i in range(600 // shot): + for file_name, cls in zip(file_names, range(5)): + data = np.load(root_dir + '\\' + file_name) + data_cut = data[shot * i: shot * (i + 1), :, :] + label_cut = np.array([cls] * shot, dtype='int64') + datas.append(data_cut) + labels.append(label_cut) + datas = np.array(datas).reshape(-1, 1, 2048) + labels = np.array(labels).reshape(-1) + print(datas.shape, labels.shape) + if not os.path.exists(save_dir): + os.makedirs(save_dir) + np.save(save_dir + '\\' + 'data.npy', datas) + np.save(save_dir + '\\' + 'label.npy', labels) + +'''得到验证集(每个类别100个样本)''' +def get_val_data(tar_condition): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + tar_condition + save_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + tar_condition + '\\val' + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + tar_condition + save_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + tar_condition + '\\val' + file_names = os.listdir(root_dir) + datas = [] + labels = [] + for file_name, cls in zip(file_names, range(5)): + data = np.load(root_dir + '\\' + file_name) + data_cut = data[600: 700, :, :] + label_cut = np.array([cls] * 100, dtype='int64') + datas.append(data_cut) + labels.append(label_cut) + datas = np.array(datas).reshape(-1, 1, 2048) + labels = np.array(labels).reshape(-1) + print("datas.shape: {}, labels.shape: {}".format(datas.shape, labels.shape)) + if not os.path.exists(save_dir): + os.makedirs(save_dir) + np.save(save_dir + '\\' + 'data.npy', datas) + np.save(save_dir + '\\' + 'label.npy', labels) + +'''得到测试集(100个样本)''' +def get_test_data(tar_condition): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + tar_condition + save_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + tar_condition + '\\test' + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\raw_data\\' + tar_condition + save_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + tar_condition + '\\test' + file_names = os.listdir(root_dir) + datas = [] + labels = [] + for file_name, cls in zip(file_names, range(5)): + data = np.load(root_dir + '\\' + file_name) + data_cut = data[700: , :, :] + label_cut = np.array([cls] * 100, dtype='int64') + datas.append(data_cut) + labels.append(label_cut) + datas = np.array(datas).reshape(-1, 1, 2048) + labels = np.array(labels).reshape(-1) + print("datas.shape: {}, labels.shape: {}".format(datas.shape, labels.shape)) + if not os.path.exists(save_dir): + os.makedirs(save_dir) + np.save(save_dir + '\\' + 'data.npy', datas) + np.save(save_dir + '\\' + 'label.npy', labels) + + +if __name__ == '__main__': + # dat_to_numpy(samples_num=800, sample_length=2048) + # draw_signal_img('C') + # draw_signal_img2() + # get_src_data('A', shot=10) + # get_src_data('B', shot=10) + # get_src_data('C', shot=10) + get_tar_data('A') + get_tar_data('B') + get_tar_data('C') + get_val_data('A') + get_val_data('B') + get_val_data('C') + get_test_data('A') + get_test_data('B') + get_test_data('C') + + get_src_data('A', shot=10) + get_src_data('B', shot=10) + get_src_data('C', shot=10) + get_tar_data2('A', shot=10) + get_tar_data2('B', shot=10) + get_tar_data2('C', shot=10) diff --git a/pytorch_example/example/test.py b/pytorch_example/example/test.py new file mode 100644 index 0000000..a6ca108 --- /dev/null +++ b/pytorch_example/example/test.py @@ -0,0 +1,226 @@ +""" +@Author: miykah +@Email: miykah@163.com +@FileName: test.py +@DateTime: 2022/7/9 14:15 +""" + +import numpy as np +import torch +from torch.utils.data import DataLoader +from DDS_GADAN.load_data import get_dataset +from DDS_GADAN.load_data import Nor_Dataset +from DDS_GADAN.model import Extractor, LabelClassifier +from sklearn.metrics import confusion_matrix +from sklearn.manifold import TSNE +import seaborn as sns +import matplotlib.pyplot as plt + +def load_data(tar_condition): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_6\\processed_data\\800EachCls_shot10\\' + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_6\\processed_data\\800EachCls_shot10\\' + + test_data = np.load(root_dir + tar_condition + '\\val\\' + 'data.npy') + test_label = np.load(root_dir + tar_condition + '\\val\\' + 'label.npy') + + return test_data, test_label + +def tsne_2d_generate(cls, data, labels, pic_title): + tsne2D = TSNE(n_components=2, verbose=2, perplexity=30).fit_transform(data) + x, y = tsne2D[:, 0], tsne2D[:, 1] + pic = plt.figure() + ax1 = pic.add_subplot() + ax1.scatter(x, y, c=labels, cmap=plt.cm.get_cmap("jet", cls)) # 9为9种颜色,因为标签有9类 + plt.title(pic_title) + plt.show() + +def tsne_2d_generate1(cls, data, labels, pic_title): + parameters = {'figure.dpi': 600, + 'figure.figsize': (4, 3), + 'savefig.dpi': 600, + 'xtick.direction': 'in', + 'ytick.direction': 'in', + 'xtick.labelsize': 10, + 'ytick.labelsize': 10, + 'legend.fontsize': 11.3, + } + plt.rcParams.update(parameters) + plt.rc('font', family='Times New Roman') # 全局字体样式 + tsne2D = TSNE(n_components=2, verbose=2, perplexity=30, random_state=3407, init='random', learning_rate=200).fit_transform(data) + tsne2D_min, tsne2D_max = tsne2D.min(0), tsne2D.max(0) + tsne2D_final = (tsne2D - tsne2D_min) / (tsne2D_max - tsne2D_min) + s1, s2 = tsne2D_final[:1000, :], tsne2D_final[1000:, :] + pic = plt.figure() + # ax1 = pic.add_subplot() + plt.scatter(s1[:, 0], s1[:, 1], c=labels[:1000], cmap=plt.cm.get_cmap("jet", cls), marker='o', alpha=0.3) # 9为9种颜色,因为标签有9类 + plt.scatter(s2[:, 0], s2[:, 1], c=labels[1000:], cmap=plt.cm.get_cmap("jet", cls), marker='x', alpha=0.3) # 9为9种颜色,因为标签有9类 + plt.title(pic_title, fontsize=10) + # plt.xticks([]) + # plt.yticks([]) + plt.show() + +def plot_confusion_matrix_accuracy(cls, true_labels, predict_labels): + # # 画混淆矩阵 + # confusion = confusion_matrix(true_labels, predict_labels) + # # confusion = confusion.astype('float') / confusion.sum(axis=1)[:, np.newaxis] + # plt.figure(figsize=(6.4,6.4), dpi=100) + # sns.heatmap(confusion, annot=True, fmt="d", cmap="Greens") + # # sns.heatmap(confusion_matrix, annot=True, fmt="d", cmap="Blues") + # indices = range(len(confusion)) + # classes = ['N', 'IF', 'OF', 'TRC', 'TSP'] + # # for i in range(cls): + # # classes.append(str(i)) + # # 第一个是迭代对象,表示坐标的显示顺序,第二个参数是坐标轴显示列表 + # # plt.xticks(indices, classes, rotation=45) # 设置横坐标方向,rotation=45为45度倾斜 + # # plt.yticks(indices, classes, rotation=45) + # plt.xticks([index + 0.5 for index in indices], classes, rotation=45) # 设置横坐标方向,rotation=45为45度倾斜 + # plt.yticks([index + 0.5 for index in indices], classes, rotation=45) + # plt.ylabel('Actual label') + # plt.xlabel('Predicted label') + # plt.title('confusion matrix') + # plt.show() + sns.set(font_scale=1.5) + parameters = {'figure.dpi': 600, + 'figure.figsize': (5, 5), + 'savefig.dpi': 600, + 'xtick.direction': 'in', + 'ytick.direction': 'in', + 'xtick.labelsize': 20, + 'ytick.labelsize': 20, + 'legend.fontsize': 11.3, + } + plt.rcParams.update(parameters) + plt.figure() + plt.rc('font', family='Times New Roman') # 全局字体样式 + # 画混淆矩阵 + confusion = confusion_matrix(true_labels, predict_labels) + # confusion = confusion.astype('float') / confusion.sum(axis=1)[:, np.newaxis] + plt.figure() + # sns.heatmap(confusion, annot=True, fmt="d", cmap="Greens") + sns.heatmap(confusion, annot=True, fmt="d", cmap="Blues", vmax=100, vmin=0, cbar=None, square=True) + indices = range(len(confusion)) + classes = ['N', 'IF', 'OF', 'TRC', 'TSP'] + # for i in range(cls): + # classes.append(str(i)) + # 第一个是迭代对象,表示坐标的显示顺序,第二个参数是坐标轴显示列表 + # plt.xticks(indices, classes, rotation=45) # 设置横坐标方向,rotation=45为45度倾斜 + # plt.yticks(indices, classes, rotation=45) + plt.xticks([index + 0.5 for index in indices], classes, rotation=45) # 设置横坐标方向,rotation=45为45度倾斜 + plt.yticks([index + 0.5 for index in indices], classes, rotation=45) + plt.ylabel('Actual label', fontsize=20) + plt.xlabel('Predicted label', fontsize=20) + # plt.tight_layout() + plt.show() + + +def test(cls, tar_condition, G_params_path, LC_params_path): + test_data, test_label = load_data(tar_condition) + test_dataset = Nor_Dataset(test_data, test_label) + + batch_size = len(test_dataset) + + test_loader = DataLoader(dataset=test_dataset, batch_size=batch_size, shuffle=True) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + G = Extractor().to(device) + LC = LabelClassifier(cls_num=cls).to(device) + G.load_state_dict( + torch.load(G_params_path, map_location=device) + ) + LC.load_state_dict( + torch.load(LC_params_path, map_location=device) + ) + # print(net) + # params_num = sum(param.numel() for param in net.parameters_bak()) + # print('参数数量:{}'.format(params_num)) + + test_acc = 0.0 + + G.eval() + LC.eval() + with torch.no_grad(): + for batch_idx, (data, label) in enumerate(test_loader): + data, label = data.to(device), label.to(device) + _, feature = G(data, data) + _, _, _, output = LC(feature, feature) + test_acc += np.sum(np.argmax(output.cpu().detach().numpy(), axis=1) == label.cpu().numpy()) + + predict_labels = np.argmax(output.cpu().detach().numpy(), axis=1) + labels = label.cpu().numpy() + + predictions = output.cpu().detach().numpy() + + tsne_2d_generate(cls, predictions, labels, "output of neural network") + + plot_confusion_matrix_accuracy(cls, labels, predict_labels) + + print("测试集大小为{}, 成功{},准确率为{:.6f}".format(test_dataset.__len__(), test_acc, test_acc / test_dataset.__len__())) + +def test1(cls, src_condition, tar_condition, G_params_path, LC_params_path): + if torch.cuda.is_available(): + root_dir = 'D:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + else: + root_dir = 'E:\\DataSet\\DDS_data\\5cls_tsne_2\\processed_data\\800EachCls_shot10\\' + + src_data = np.load(root_dir + src_condition + '\\src\\' + 'data.npy') + src_label = np.load(root_dir + src_condition + '\\src\\' + 'label.npy') + + tar_data = np.load(root_dir + tar_condition + '\\tar1\\' + 'data.npy') + tar_label = np.load(root_dir + tar_condition + '\\tar1\\' + 'label.npy') + + src_dataset = Nor_Dataset(src_data, src_label) + tar_dataset = Nor_Dataset(tar_data, tar_label) + src_loader = DataLoader(dataset=src_dataset, batch_size=1000, shuffle=False, drop_last=True) + tar_loader = DataLoader(dataset=tar_dataset, batch_size=1000, shuffle=False, drop_last=True) + + # 加载网络 + device = torch.device("cuda:0" if torch.cuda.is_available() else "cpu") + G = Extractor().to(device) + LC = LabelClassifier(cls_num=cls).to(device) + G.load_state_dict( + torch.load(G_params_path, map_location=device) + ) + LC.load_state_dict( + torch.load(LC_params_path, map_location=device) + ) + # print(net) + # params_num = sum(param.numel() for param in net.parameters_bak()) + # print('参数数量:{}'.format(params_num)) + + test_acc = 0.0 + + G.eval() + LC.eval() + with torch.no_grad(): + for (src_batch_idx, (src_data, src_label)), (tar_batch_idx, (tar_data, tar_label)) in zip(enumerate(src_loader), enumerate(tar_loader)): + src_data, src_label = src_data.to(device), src_label.to(device) + tar_data, tar_label = tar_data.to(device), tar_label.to(device) + data = torch.concat((src_data, tar_data), dim=0) + label = torch.concat((src_label, tar_label), dim=0) + _, feature = G(data, data) + _, _, fc1, output = LC(feature, feature) + test_acc += np.sum(np.argmax(output.cpu().detach().numpy(), axis=1) == label.cpu().numpy()) + + predict_labels = np.argmax(output.cpu().detach().numpy(), axis=1) + labels = label.cpu().numpy() + + outputs = output.cpu().detach().numpy() + fc1_outputs = fc1.cpu().detach().numpy() + break + + tsne_2d_generate1(cls, fc1_outputs, labels, "GADAN") + + plot_confusion_matrix_accuracy(cls, labels, predict_labels) + + print("准确率为{:.6f}".format(test_acc / (src_dataset.__len__() + tar_dataset.__len__()))) + +if __name__ == '__main__': + # pass + test(5, 'B', 'parameters/A_to_B/G/G_shot10_epoch200_lr0.002_miu0.5.pkl', + 'parameters/A_to_B/LC/LC_shot10_epoch200_lr0.002_miu0.5.pkl') + + # test1(5, 'A', 'B', 'parameters_bak/A_to_B/G/G_shot10_epoch200_lr0.002_miu0.5.pkl', + # 'parameters_bak/A_to_B/LC/LC_shot10_epoch200_lr0.002_miu0.5.pkl') \ No newline at end of file diff --git a/pytorch_example/example/train.py b/pytorch_example/example/train.py new file mode 100644 index 0000000..6a60c6e --- /dev/null +++ b/pytorch_example/example/train.py @@ -0,0 +1,357 @@ +""" +@Author: miykah +@Email: miykah@163.com +@FileName: train.py +@DateTime: 2022/7/20 20:22 +""" +import os +import time +import random +import numpy as np +import torch +import torch.nn as nn +import torch.nn.functional as F +import matplotlib.pyplot as plt +from torch.utils.data import DataLoader +from example.load_data import get_dataset, draw_signal_img +from example.model import Extractor, LabelClassifier, DomainClassifier, weights_init_Classifier, weights_init_Extractor +from example.loss import cal_mmdc_loss, BinaryCrossEntropyLoss, get_mmdc +import example.mmd as mmd +from example.test import test, test1 +from scipy.spatial.distance import cdist +import math + +def obtain_label(feature, output, bs): + with torch.no_grad(): + all_fea = feature.reshape(bs, -1).float().cpu() + all_output = output.float().cpu() + # all_label = label.float() + all_output = nn.Softmax(dim=1)(all_output) + _, predict = torch.max(all_output, 1) + # accuracy = torch.sum(torch.squeeze(predict).float() == all_label).item() / float(all_label.size()[0]) + + all_fea = torch.cat((all_fea, torch.ones(all_fea.size(0), 1)), 1) + all_fea = (all_fea.t() / torch.norm(all_fea, p=2, dim=1)).t() + all_fea = all_fea.float().cpu().numpy() + + K = all_output.size(1) + aff = all_output.float().cpu().numpy() + initc = aff.transpose().dot(all_fea) + initc = initc / (1e-8 + aff.sum(axis=0)[:, None]) + dd = cdist(all_fea, initc, 'cosine') + pred_label = dd.argmin(axis=1) + # acc = np.sum(pred_label == all_label.float().numpy()) / len(all_fea) + + for round in range(1): + aff = np.eye(K)[pred_label] + initc = aff.transpose().dot(all_fea) + initc = initc / (1e-8 + aff.sum(axis=0)[:, None]) + dd = cdist(all_fea, initc, 'cosine') + pred_label = dd.argmin(axis=1) + # acc = np.sum(pred_label == all_label.float().numpy()) / len(all_fea) + + # log_str = 'Accuracy = {:.2f}% -> {:.2f}%'.format(accuracy * 100, acc * 100) + # args.out_file.write(log_str + '\n') + # args.out_file.flush() + # print(log_str + '\n') + return pred_label.astype('int') + + +def train(device, src_condition, tar_condition, cls, epochs, bs, shot, lr, patience, gamma, miu): + '''特征提取器''' + G = Extractor() + G.apply(weights_init_Extractor) + G.to(device) + '''标签分类器''' + LC = LabelClassifier(cls_num=cls) + LC.apply(weights_init_Classifier) + LC.to(device) + '''域分类器''' + DC = DomainClassifier() + DC.apply(weights_init_Classifier) + DC.to(device) + + '''得到数据集''' + src_dataset, tar_dataset, val_dataset, test_dataset \ + = get_dataset(src_condition, tar_condition) + '''DataLoader''' + src_loader = DataLoader(dataset=src_dataset, batch_size=bs, shuffle=False, drop_last=True) + tar_loader = DataLoader(dataset=tar_dataset, batch_size=bs, shuffle=True, drop_last=True) + val_loader = DataLoader(dataset=val_dataset, batch_size=bs, shuffle=True, drop_last=False) + test_loader = DataLoader(dataset=test_dataset, batch_size=len(test_dataset), shuffle=True, drop_last=False) + + criterion = nn.CrossEntropyLoss().to(device) + BCE = BinaryCrossEntropyLoss().to(device) + + optimizer_g = torch.optim.Adam(G.parameters(), lr=lr) + optimizer_lc = torch.optim.Adam(LC.parameters(), lr=lr) + optimizer_dc = torch.optim.Adam(DC.parameters(), lr=lr) + scheduler_g = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer_g, mode="min", factor=0.5, patience=patience) + scheduler_lc = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer_lc, mode="min", factor=0.5, patience=patience) + scheduler_dc = torch.optim.lr_scheduler.ReduceLROnPlateau(optimizer_dc, mode="min", factor=0.5, patience=patience) + + def zero_grad_all(): + optimizer_g.zero_grad() + optimizer_lc.zero_grad() + optimizer_dc.zero_grad() + + src_acc_list = [] + train_loss_list = [] + val_acc_list = [] + val_loss_list = [] + + for epoch in range(epochs): + epoch_start_time = time.time() + src_acc = 0.0 + train_loss = 0.0 + val_acc = 0.0 + val_loss = 0.0 + + G.train() + LC.train() + DC.train() + + for (src_batch_idx, (src_data, src_label)), (tar_batch_idx, (tar_data)) in zip(enumerate(src_loader), enumerate(tar_loader)): + src_data, src_label = src_data.to(device), src_label.to(device) + tar_data = tar_data.to(device) + zero_grad_all() + + T1 = (int)(0.2 * epochs) + T2 = (int)(0.5 * epochs) + + src_feature, tar_feature = G(src_data, tar_data) + src_data_mmd1, src_output, tar_data_mmd1, tar_output = LC(src_feature, tar_feature) + if epoch < T1: + pseudo_label = torch.argmax(F.softmax(tar_output, dim=1), dim=1) # 伪标签 + else: + pseudo_label = torch.tensor(obtain_label(tar_feature, tar_output, bs), dtype=torch.int64).cuda() + + # pseudo_label = torch.argmax(F.softmax(tar_output, dim=1), dim=1) # 伪标签 + # mmdc权重 + if epoch < T1: + miu_f = 0 + # elif epoch > T1 and epoch < T2: + # miu_f = miu * (epoch - T1) / (T2 - T1) + else: + miu_f = miu + + # 源数据的交叉熵损失 + loss_src = criterion(src_output, src_label) + # 目标数据的伪标签交叉熵损失 + loss_tar_pseudo = criterion(tar_output, pseudo_label) + # mmd损失 + loss_mmdm = mmd.mmd_rbf_noaccelerate(src_data_mmd1, tar_data_mmd1) + if epoch < T1: + loss_mmdc = 0 + else: + loss_mmdc = get_mmdc(src_data_mmd1, tar_data_mmd1, pseudo_label, bs, shot, cls) + # loss_mmdc = cal_mmdc_loss(src_data_mmd1, src_output, tar_data_mmd1, tar_output) + # loss_mmdc = get_mmdc(src_data_mmd1, tar_data_mmd1, pseudo_label, bs, shot, cls) + # loss_jmmd = miu_f * loss_mmdc + (1 - miu_f) * loss_mmdm + + # 伪标签损失的权重 + # if epoch < T1: + # beta_f = 0 + # elif epoch > T1 and epoch < T2: + # beta_f = beta * (epoch - T1) / (T2 - T1) + # else: + # beta_f = beta + + p = epoch / epochs + lamda = (2 / (1 + math.exp(-10 * p))) - 1 + # gamma = (2 / (1 + math.exp(-10 * p))) - 1 + # miu_f = (2 / (1 + math.exp(-10 * p))) - 1 + + loss_jmmd = miu_f * loss_mmdc + (1 - miu_f) * loss_mmdm + + loss_G_LC = loss_src + gamma * loss_jmmd + # loss_G_LC = loss_src + beta_f * loss_tar_pseudo + gamma * loss_jmmd + loss_G_LC.backward() + optimizer_g.step() + optimizer_lc.step() + zero_grad_all() +#----------------------------------------------- + # 对抗域适应的损失 + src_feature, tar_feature = G(src_data, tar_data) + src_data_mmd1, src_output, tar_data_mmd1, tar_output = LC(src_feature, tar_feature) + # pseudo_label = torch.argmax(F.softmax(tar_output, dim=1), dim=1) # 伪标签 + # 源数据的交叉熵损失 + loss_src = criterion(src_output, src_label) + # 目标数据的伪标签交叉熵损失 + loss_tar_pseudo = criterion(tar_output, pseudo_label) + + gradient_src = \ + torch.autograd.grad(outputs=loss_src, inputs=src_feature, create_graph=True, retain_graph=True, + only_inputs=True)[0] + gradient_tar = \ + torch.autograd.grad(outputs=loss_tar_pseudo, inputs=tar_feature, create_graph=True, retain_graph=True, + only_inputs=True)[0] + gradients_adv = torch.cat((gradient_src, gradient_tar), dim=0) + + domain_label_reverse = DC(gradients_adv, reverse=True) + loss_adv_r = BCE(domain_label_reverse) + loss_G_adv = lamda * loss_adv_r + # 更新特征提取器G参数 + loss_G_adv.backward() + optimizer_g.step() + zero_grad_all() +#--------------------------------------------------------------------- + src_feature, tar_feature = G(src_data, tar_data) + src_data_mmd1, src_output, tar_data_mmd1, tar_output = LC(src_feature, tar_feature) + # pseudo_label = torch.argmax(F.softmax(tar_output, dim=1), dim=1) # 伪标签 + # 源数据的交叉熵损失 + loss_src = criterion(src_output, src_label) + # 目标数据的伪标签交叉熵损失 + loss_tar_pseudo = criterion(tar_output, pseudo_label) + + gradient_src = \ + torch.autograd.grad(outputs=loss_src, inputs=src_feature, create_graph=True, retain_graph=True, + only_inputs=True)[0] + gradient_tar = \ + torch.autograd.grad(outputs=loss_tar_pseudo, inputs=tar_feature, create_graph=True, retain_graph=True, + only_inputs=True)[0] + + gradients = torch.cat((gradient_src, gradient_tar), dim=0) + domain_label = DC(gradients, reverse=False) + loss_adv = BCE(domain_label) + loss_DC = lamda * loss_adv + # 更新域分类器的参数 + loss_DC.backward() + optimizer_dc.step() + zero_grad_all() + + src_acc += np.sum(np.argmax(src_output.cpu().detach().numpy(), axis=1) == src_label.cpu().numpy()) + train_loss += (loss_G_LC + loss_G_adv + loss_DC).item() + + G.eval() + LC.eval() + DC.eval() + with torch.no_grad(): + for batch_idx, (val_data, val_label) in enumerate(val_loader): + val_data, val_label = val_data.to(device), val_label.to(device) + _, val_feature = G(val_data, val_data) + _, _, _, val_output = LC(val_feature, val_feature) + loss = criterion(val_output, val_label) + + val_acc += np.sum(np.argmax(val_output.cpu().detach().numpy(), axis=1) == val_label.cpu().numpy()) + val_loss += loss.item() + + scheduler_g.step(val_loss) + scheduler_lc.step(val_loss) + scheduler_dc.step(val_loss) + + print("[{:03d}/{:03d}] {:2.2f} sec(s) src_acc: {:3.6f} train_loss: {:3.9f} | val_acc: {:3.6f} val_loss: {:3.9f} | Learning rate : {:3.6f}".format( + epoch + 1, epochs, time.time() - epoch_start_time, \ + src_acc / src_dataset.__len__(), train_loss / src_dataset.__len__(), + val_acc / val_dataset.__len__(), val_loss / val_dataset.__len__(), + optimizer_g.state_dict()['param_groups'][0]['lr'])) + + # 保存在验证集上loss最小的模型 + # if val_loss_list.__len__() > 0 and (val_loss / val_dataset.__len__()) < min(val_loss_list): + # 如果精度大于最高精度,则保存 + if val_acc_list.__len__() > 0 : + # if (val_acc / val_dataset.__len__()) >= max(val_acc_list): + if (val_acc / val_dataset.__len__()) > max(val_acc_list) or (val_loss / val_dataset.__len__()) < min(val_loss_list): + print("保存模型最佳模型成功") + G_path = "parameters_bak/" + src_condition + "_to_" + tar_condition + "/G" + LC_path = "parameters_bak/" + src_condition + "_to_" + tar_condition + "/LC" + DC_path = "parameters_bak/" + src_condition + "_to_" + tar_condition + "/DC" + if not os.path.exists(G_path): + os.makedirs(G_path) + if not os.path.exists(LC_path): + os.makedirs(LC_path) + if not os.path.exists(DC_path): + os.makedirs(DC_path) + # 保存模型参数 + torch.save(G.state_dict(), G_path + "/G_" + "shot" + str(shot) + "_epoch" + str(epochs) + "_lr" + str(lr) + "_miu" + str(miu) + ".pkl") + torch.save(LC.state_dict(), LC_path + "/LC_" + "shot" + str(shot) + "_epoch" + str(epochs) + "_lr" + str(lr) + "_miu" + str(miu) + ".pkl") + torch.save(DC.state_dict(), DC_path + "/DC_" + "shot" + str(shot) + "_epoch" + str(epochs) + "_lr" + str(lr) + "_miu" + str(miu) + ".pkl") + + src_acc_list.append(src_acc / src_dataset.__len__()) + train_loss_list.append(train_loss / src_dataset.__len__()) + val_acc_list.append(val_acc / val_dataset.__len__()) + val_loss_list.append(val_loss / val_dataset.__len__()) + + '''保存的模型参数的路径''' + G_params_path = G_path + "/G_" + "shot" + str(shot) + "_epoch" + str(epochs) + "_lr" + str(lr) + "_miu" + str(miu) + ".pkl" + LC_params_path = LC_path + "/LC_" + "shot" + str(shot) + "_epoch" + str(epochs) + "_lr" + str(lr) + "_miu" + str(miu) + ".pkl" + + + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + + # pic1 = plt.figure(figsize=(8, 6), dpi=200) + # plt.subplot(211) + # plt.plot(np.arange(1, epochs + 1), src_acc_list, 'b', label='TrainAcc') + # plt.plot(np.arange(1, epochs + 1), val_acc_list, 'r', label='ValAcc') + # plt.ylim(0.3, 1.0) # 设置y轴范围 + # plt.title('Training & Validation accuracy') + # plt.xlabel('epoch') + # plt.ylabel('accuracy') + # plt.legend(loc='lower right') + # plt.grid(alpha=0.4) + # + # plt.subplot(212) + # plt.plot(np.arange(1, epochs + 1), train_loss_list, 'b', label='TrainLoss') + # plt.plot(np.arange(1, epochs + 1), val_loss_list, 'r', label='ValLoss') + # plt.ylim(0, 0.08) # 设置y轴范围 + # plt.title('Training & Validation loss') + # plt.xlabel('epoch') + # plt.ylabel('loss') + # plt.legend(loc='upper right') + # plt.grid(alpha=0.4) + + pic1 = plt.figure(figsize=(12, 6), dpi=200) + + plt.plot(np.arange(1, epochs + 1), train_loss_list, 'b', label='Training Loss') + plt.plot(np.arange(1, epochs + 1), val_loss_list, 'r', label='Validation Loss') + plt.ylim(0, 0.08) # 设置y轴范围 + plt.title('Training & Validation loss') + plt.xlabel('epoch') + plt.ylabel('loss') + plt.legend(loc='upper right') + plt.grid(alpha=0.4) + + # 获取当前时间戳 + timestamp = int(time.time()) + + # 将时间戳转换为字符串 + timestamp_str = str(timestamp) + plt.savefig(timestamp_str, dpi=200) + + return G_params_path, LC_params_path + + +if __name__ == '__main__': + + begin = time.time() + + if torch.cuda.is_available(): + device = torch.device("cuda:0") + else: + device = torch.device("cpu") + + seed = 2 + torch.manual_seed(seed) + random.seed(seed) + np.random.seed(seed) + + src_condition = 'A' + tar_condition = 'B' + '''训练''' + G_params_path, LC_params_path = train(device, src_condition, tar_condition, cls=5, + epochs=200, bs=50, shot=10, lr=0.002, patience=40, gamma=1, miu=0.5) + + end = time.time() + + '''测试''' + # test1(5, src_condition, tar_condition, G_params_path, LC_params_path) + test(5, tar_condition, G_params_path, LC_params_path) + + print("训练耗时:{:3.2f}s".format(end - begin)) \ No newline at end of file diff --git a/pytorch_example/temp/MSETest.py b/pytorch_example/temp/MSETest.py new file mode 100644 index 0000000..03ade45 --- /dev/null +++ b/pytorch_example/temp/MSETest.py @@ -0,0 +1,130 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/12/27 16:52 +@Usage : +@Desc : 测试MSE三点不足 +''' +import numpy as np +import matplotlib.pyplot as plt +import torch_dct as dct + + +def plot(x, y): + font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + plt.figure(1) + y[-1] = 0.00832 + + '''保存的模型参数的路径''' + + from matplotlib import rcParams + + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + predict1 = y[-1] + 0.2 + predict2 = y[-1] - 0.2 + + # 简单预测图 + plt.scatter(x, y, c='blue', s=16, label='Actual value') + plt.plot(x, y, linewidth=2, color='red', + label='Traning value') + plt.scatter([x[-1]], [predict1], c='black', + s=18, label='Predict data1') + plt.scatter([x[-1]], [predict2], c='black', + s=18, label='Predict data2') + plt.xlabel('Serial number of the fusion feature point', font=font1) + plt.ylabel('Virtual health indicator', font=font1) + plt.legend(loc='upper left', prop=font2) + + plt.show() + + a = np.hstack([y[:-1], predict1]) + + b = np.hstack([y[:-1], predict2]) + return y, a, b + + +def fft(x, a, b): + from matplotlib import rcParams + + # 幅值 + amp_y0 = np.abs(x / len(x)) + amp_y1 = np.abs(a / len(a)) + amp_y2 = np.abs(b / len(b)) + # 相角 + angle_y0 = np.angle(x) + angle_y1 = np.angle(a) + angle_y2 = np.angle(b) + + plt.figure(2) + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + + plt.plot(amp_y1, linewidth=2, color='green', + label='Predict data1') + plt.plot(amp_y2, linewidth=2, color='red', + label='Predict data2') + plt.plot(amp_y0, linewidth=2, color='blue', + label='Original data') + plt.legend(loc='upper left', prop=font2) + plt.xlabel('Serial number of the fusion feature point', font=font1) + plt.ylabel('Amplitude', font=font1) + plt.show() + + plt.figure(3) + config = { + "font.family": 'Times New Roman', # 设置字体类型 + "axes.unicode_minus": False, # 解决负号无法显示的问题 + "axes.labelsize": 13 + } + rcParams.update(config) + font1 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + font2 = {'family': 'Times New Roman', 'weight': 'normal', 'size': 15} # 设置坐标标签的字体大小,字体 + + plt.plot(angle_y1, linewidth=2, color='green', + label='Predict data1') + plt.plot(angle_y2, linewidth=2, color='red', + label='Predict data2') + plt.plot(angle_y0, linewidth=2, color='blue', + label='Original data') + plt.legend(loc='upper left', prop=font2) + plt.xlabel('Serial number of the fusion feature point', font=font1) + plt.ylabel('Angle', font=font1) + plt.show() + pass + + +length = 30 + +# y = np.array([-0.029078494757, +# -0.33095228672, +# -0.12124221772, +# 0.553512275219, +# -0.158036053181, +# 0.268739402294, +# -0.638222515583, +# 0.233140587807, +# -0.173265621066, +# 0.467218101025, +# -0.372010827065, +# -0.136630430818, +# 0.343256533146, +# 0.008932195604]) + +y = np.random.random([length, ]) +x = list(range(0, len(y))) +print(y) +y, a, b = plot(x, y) +fft(y, a, b) diff --git a/pytorch_example/temp/__init__.py b/pytorch_example/temp/__init__.py new file mode 100644 index 0000000..4ff6fef --- /dev/null +++ b/pytorch_example/temp/__init__.py @@ -0,0 +1,8 @@ +#-*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 13:18 +@Usage : +@Desc : +''' \ No newline at end of file diff --git a/pytorch_example/temp/dctTest.py b/pytorch_example/temp/dctTest.py new file mode 100644 index 0000000..9b80dbb --- /dev/null +++ b/pytorch_example/temp/dctTest.py @@ -0,0 +1,32 @@ +# -*- encoding:utf-8 -*- + +''' +@Author : dingjiawen +@Date : 2023/11/15 13:18 +@Usage : +@Desc : +''' + +import torch_dct as dct +import numpy as np +import torch + +a = np.load("a.npy") +b = np.load("b.npy") + +a = torch.tensor(a) + +c = dct.dct(x=a) + +d = [] + +for i in range(a.shape[1]): + d.append(dct.dct(a[:,i,:])) +d = torch.stack(d,dim=1) + +torch.nn.Linear() +print("a.shape:",a.shape) +print("a:",a) +print("b:",b) +print("c:",c) +print("d:",d)