wcf123 1 gadu atpakaļ
revīzija
eade09e497
100 mainītis faili ar 2584 papildinājumiem un 0 dzēšanām
  1. 797 0
      20200404123王春富/day2王春富20200404123/Jupyter_test.ipynb
  2. 601 0
      20200404123王春富/day3王春富20200404123/6月14日作业代码.ipynb
  3. 423 0
      20200404123王春富/day4王春富20200404123/全部代码21期.ipynb
  4. BIN
      20200404123王春富/day5王春富20200404123/登录界面/.DS_Store
  5. 8 0
      20200404123王春富/day5王春富20200404123/登录界面/.idea/.gitignore
  6. 6 0
      20200404123王春富/day5王春富20200404123/登录界面/.idea/inspectionProfiles/profiles_settings.xml
  7. 7 0
      20200404123王春富/day5王春富20200404123/登录界面/.idea/misc.xml
  8. 8 0
      20200404123王春富/day5王春富20200404123/登录界面/.idea/modules.xml
  9. 6 0
      20200404123王春富/day5王春富20200404123/登录界面/.idea/vcs.xml
  10. 12 0
      20200404123王春富/day5王春富20200404123/登录界面/.idea/手写数字识别.iml
  11. BIN
      20200404123王春富/day5王春富20200404123/登录界面/2.bmp
  12. 67 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitAI.py
  13. 17 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitApp.py
  14. 36 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitDev.py
  15. 84 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitForm.py
  16. 21 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitModule.py
  17. 82 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitUI.py
  18. 15 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/Main.py
  19. 0 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/__init__.py
  20. 0 0
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/data/__init__.py
  21. BIN
      20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/data/models.lenet
  22. 2 0
      20200404123王春富/day5王春富20200404123/登录界面/build/scripts-3.6/digit.bat
  23. 2 0
      20200404123王春富/day5王春富20200404123/登录界面/digit.bat
  24. 1 0
      20200404123王春富/day5王春富20200404123/登录界面/digit.py
  25. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/.DS_Store
  26. 16 0
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/DigitApp.py
  27. 34 0
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/DigitForm.py
  28. 68 0
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/DigitUI1.py
  29. 143 0
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/DigitUI1.ui
  30. 15 0
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/Main.py
  31. 0 0
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__init__.py
  32. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitAI.cpython-311.pyc
  33. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitAI.cpython-36.pyc
  34. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitApp.cpython-310.pyc
  35. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitApp.cpython-311.pyc
  36. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitApp.cpython-36.pyc
  37. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitDev.cpython-311.pyc
  38. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitDev.cpython-36.pyc
  39. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitForm.cpython-310.pyc
  40. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitForm.cpython-311.pyc
  41. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitForm.cpython-36.pyc
  42. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitModule.cpython-311.pyc
  43. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitModule.cpython-36.pyc
  44. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitUI.cpython-311.pyc
  45. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitUI.cpython-36.pyc
  46. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitUI1.cpython-310.pyc
  47. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitUI1.cpython-311.pyc
  48. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/Main.cpython-310.pyc
  49. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/Main.cpython-311.pyc
  50. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/Main.cpython-36.pyc
  51. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/__init__.cpython-310.pyc
  52. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/__init__.cpython-311.pyc
  53. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/__init__.cpython-36.pyc
  54. BIN
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/loginUI.cpython-311.pyc
  55. 1 0
      20200404123王春富/day5王春富20200404123/登录界面/digitapp/tool.bat
  56. BIN
      20200404123王春富/day5王春富20200404123/登录界面/项目文件的关系.pptx
  57. 8 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/.gitignore
  58. 6 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/inspectionProfiles/profiles_settings.xml
  59. 4 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/misc.xml
  60. 8 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/modules.xml
  61. 10 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/卷积神经网络训练--每行代码注释版本.iml
  62. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-images-idx3-ubyte
  63. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-images-idx3-ubyte.gz
  64. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-labels-idx1-ubyte
  65. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-labels-idx1-ubyte.gz
  66. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-images-idx3-ubyte
  67. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-images-idx3-ubyte.gz
  68. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-labels-idx1-ubyte
  69. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-labels-idx1-ubyte.gz
  70. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.DS_Store
  71. 8 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/.gitignore
  72. 8 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/conv_demo.iml
  73. 6 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/encodings.xml
  74. 27 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/inspectionProfiles/Project_Default.xml
  75. 6 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/inspectionProfiles/profiles_settings.xml
  76. 7 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/misc.xml
  77. 8 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/modules.xml
  78. 6 0
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/vcs.xml
  79. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/00_5.jpg
  80. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/01_0.jpg
  81. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/02_4.jpg
  82. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/03_1.jpg
  83. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/04_9.jpg
  84. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/05_2.jpg
  85. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/06_1.jpg
  86. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/07_3.jpg
  87. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/08_1.jpg
  88. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/09_4.jpg
  89. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/lenet5.cpython-310.pyc
  90. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/lenet5.cpython-311.pyc
  91. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/lenet5.cpython-36.pyc
  92. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/lenet5.cpython-38.pyc
  93. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/train.cpython-311.pyc
  94. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/train_new.cpython-311.pyc
  95. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-images-idx3-ubyte
  96. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-images-idx3-ubyte.gz
  97. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-labels-idx1-ubyte
  98. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-labels-idx1-ubyte.gz
  99. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-images-idx3-ubyte
  100. BIN
      20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-images-idx3-ubyte.gz

+ 797 - 0
20200404123王春富/day2王春富20200404123/Jupyter_test.ipynb

@@ -0,0 +1,797 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "print('你好 Python')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "print('test')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "0\n",
+      "1\n",
+      "2\n",
+      "3\n",
+      "4\n",
+      "5\n",
+      "6\n",
+      "7\n",
+      "8\n",
+      "9\n"
+     ]
+    }
+   ],
+   "source": [
+    "for i in range(10):\n",
+    "    print(i)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "x = 3.14"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# 一级标题\n",
+    "## 二级标题\n",
+    "### 三级标题"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# 魔法命令"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## %run"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "大家好,很高兴认识你\n"
+     ]
+    }
+   ],
+   "source": [
+    "%run ./My_Test.py"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## %load"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# %load ./My_Test.py\n",
+    "print('大家好,很高兴认识你')\n",
+    "\n",
+    "def my_print(x):\n",
+    "\tprint(x*2)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Python好,大家好\n"
+     ]
+    }
+   ],
+   "source": [
+    "my_print('Python好,大家好')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 9,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "大家好,很高兴认识你\n",
+      "xixi\n"
+     ]
+    }
+   ],
+   "source": [
+    "from My_Test import my_print\n",
+    "my_print('xixi')"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "大家好,很高兴认识你\n"
+     ]
+    }
+   ],
+   "source": [
+    "# notebook对同一个文件只会导入一次\n",
+    "%run ./My_Test.py"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Python好,大家好Python好,大家好\n"
+     ]
+    }
+   ],
+   "source": [
+    "my_print('Python好,大家好')"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "# %timeit"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "415 µs ± 16.7 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "%timeit li = [i**2 for i in range(1000)]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "469 ms ± 21.4 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "%timeit li = [i**2 for i in range(1000000)]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "5.44 µs ± 421 ns per loop (mean ± std. dev. of 7 runs, 100000 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "%timeit li = [i**2 for i in range(10)]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# %timeit 后面只跟一句代码\n",
+    "# 测试代码块 用%%timit"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 20,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "742 µs ± 71.2 µs per loop (mean ± std. dev. of 7 runs, 1000 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "%%timeit\n",
+    "li = []\n",
+    "for i in range(1000):\n",
+    "    li.append(i**2)\n",
+    "# 在python中使用列表生成式比for高效    "
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## %time"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 21,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "# %time 只会测量一次代码的执行时间"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 22,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "CPU times: user 662 µs, sys: 2 µs, total: 664 µs\n",
+      "Wall time: 678 µs\n"
+     ]
+    }
+   ],
+   "source": [
+    "%time li = [i**2 for i in range(1000)]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 23,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "CPU times: user 953 µs, sys: 60 µs, total: 1.01 ms\n",
+      "Wall time: 1.23 ms\n"
+     ]
+    }
+   ],
+   "source": [
+    "%%time\n",
+    "li = []\n",
+    "for i in range(1000):\n",
+    "    li.append(i**2)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 24,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "3.18 ms ± 403 µs per loop (mean ± std. dev. of 7 runs, 100 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "import random\n",
+    "li = [random.random() for i in range(100000)]\n",
+    "%timeit li.sort()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 25,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "CPU times: user 27.1 ms, sys: 2.68 ms, total: 29.8 ms\n",
+      "Wall time: 31 ms\n"
+     ]
+    }
+   ],
+   "source": [
+    "li = [random.random() for i in range(100000)]\n",
+    "%time li.sort()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 26,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "CPU times: user 3.61 ms, sys: 133 µs, total: 3.74 ms\n",
+      "Wall time: 4.09 ms\n"
+     ]
+    }
+   ],
+   "source": [
+    "%time li.sort()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 27,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "CPU times: user 3.3 ms, sys: 14 µs, total: 3.31 ms\n",
+      "Wall time: 3.4 ms\n"
+     ]
+    }
+   ],
+   "source": [
+    "%time li.sort()"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 28,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "CPU times: user 4.06 ms, sys: 137 µs, total: 4.19 ms\n",
+      "Wall time: 4.28 ms\n"
+     ]
+    }
+   ],
+   "source": [
+    "%time li.sort()"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## %%html"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 31,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/html": [
+       "<div class='mytest' style='color:red'>html content</div>"
+      ],
+      "text/plain": [
+       "<IPython.core.display.HTML object>"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "%%html\n",
+    "<div class='mytest' style='color:red'>html content</div>"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## %%js"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 32,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "application/javascript": [
+       "document.querySelector('.mytest').innerHTML='我成功了'"
+      ],
+      "text/plain": [
+       "<IPython.core.display.Javascript object>"
+      ]
+     },
+     "metadata": {},
+     "output_type": "display_data"
+    }
+   ],
+   "source": [
+    "%%js\n",
+    "document.querySelector('.mytest').innerHTML='我成功了'"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## %%writefile "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 34,
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "Writing haha.py\n"
+     ]
+    }
+   ],
+   "source": [
+    "%%writefile haha.py\n",
+    "import random\n",
+    "li = [random.random() for i in range(100000)]\n",
+    "%timeit li.sort()\n"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "metadata": {},
+   "source": [
+    "## numpy"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 2,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "import numpy as np"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 3,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "numpy.ndarray"
+      ]
+     },
+     "execution_count": 3,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a = np.array([1, 2, 3])\n",
+    "type(a)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 4,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(3,)"
+      ]
+     },
+     "execution_count": 4,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a.shape"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 5,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "b = np.array([[1,2,3],\n",
+    "              [4,5,6]]) "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 6,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(2, 3)"
+      ]
+     },
+     "execution_count": 6,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b.shape"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 10,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "a = np.zeros((5,5,4)) "
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 11,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[[0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.]],\n",
+       "\n",
+       "       [[0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.]],\n",
+       "\n",
+       "       [[0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.]],\n",
+       "\n",
+       "       [[0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.]],\n",
+       "\n",
+       "       [[0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.],\n",
+       "        [0., 0., 0., 0.]]])"
+      ]
+     },
+     "execution_count": 11,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 12,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "a = np.array([[1,2,3,4], [5,6,7,8], [9,10,11,12]])"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 13,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[ 1,  2,  3,  4],\n",
+       "       [ 5,  6,  7,  8],\n",
+       "       [ 9, 10, 11, 12]])"
+      ]
+     },
+     "execution_count": 13,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "a"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 14,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "b = a[:2, 1:3]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 15,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[2, 3],\n",
+       "       [6, 7]])"
+      ]
+     },
+     "execution_count": 15,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "b"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 16,
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "x = np.array([[1,2],[3,4]], dtype=np.float64)\n",
+    "y = np.array([[5,6],[7,8]], dtype=np.float64)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 17,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[ 6.,  8.],\n",
+       "       [10., 12.]])"
+      ]
+     },
+     "execution_count": 17,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "x + y"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 18,
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[ 6.,  8.],\n",
+       "       [10., 12.]])"
+      ]
+     },
+     "execution_count": 18,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "np.add(x, y)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.11.3"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 2
+}

+ 601 - 0
20200404123王春富/day3王春富20200404123/6月14日作业代码.ipynb

@@ -0,0 +1,601 @@
+{
+ "cells": [
+  {
+   "cell_type": "code",
+   "execution_count": 41,
+   "id": "fd50f54d",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([37.2, 37.6, 36.8])"
+      ]
+     },
+     "execution_count": 41,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "import numpy as np \n",
+    "\n",
+    "X = np.array([[1.2, 1.5, 1.8],\n",
+    "             [1.3, 1.4, 1.9],\n",
+    "             [1.1, 1.6, 1.7]])\n",
+    "\n",
+    "Y = np.array([5,10,9]).T\n",
+    "\n",
+    "X.dot(Y)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 42,
+   "id": "8b22cb4a",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(3, 3)"
+      ]
+     },
+     "execution_count": 42,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "X.shape"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 43,
+   "id": "bbef7ab3",
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "963 ns ± 20.9 ns per loop (mean ± std. dev. of 7 runs, 1,000,000 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "%timeit X.dot(Y)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 37,
+   "id": "33143bac",
+   "metadata": {},
+   "outputs": [
+    {
+     "name": "stdout",
+     "output_type": "stream",
+     "text": [
+      "16.3 µs ± 173 ns per loop (mean ± std. dev. of 7 runs, 100,000 loops each)\n"
+     ]
+    }
+   ],
+   "source": [
+    "%%timeit\n",
+    "total = []\n",
+    "for i in range(X.shape[0]):\n",
+    "    each_price = 0\n",
+    "    for j in range(X.shape[1]):\n",
+    "        each_price += X[i,j] * Y[j]\n",
+    "#         each_price = each_price + X[i,j] * y[j]\n",
+    "    total.append(round(each_price, 1))\n",
+    "total"
+   ]
+  },
+  {
+   "cell_type": "markdown",
+   "id": "531e04e3",
+   "metadata": {},
+   "source": [
+    "# 第二题"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 47,
+   "id": "e8c1b618",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([6, 9, 6, 1, 1, 2, 8, 7, 3, 5, 6, 3, 5, 3, 5, 8, 8, 2, 8, 1, 7, 8,\n",
+       "       7, 2, 1, 2, 9, 9, 4, 9])"
+      ]
+     },
+     "execution_count": 47,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "np.random.seed(1)\n",
+    "X = np.random.randint(1, 10, size=30)\n",
+    "X"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 48,
+   "id": "42e4691b",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[6, 9, 6],\n",
+       "       [1, 1, 2],\n",
+       "       [8, 7, 3],\n",
+       "       [5, 6, 3],\n",
+       "       [5, 3, 5],\n",
+       "       [8, 8, 2],\n",
+       "       [8, 1, 7],\n",
+       "       [8, 7, 2],\n",
+       "       [1, 2, 9],\n",
+       "       [9, 4, 9]])"
+      ]
+     },
+     "execution_count": 48,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "X.reshape(-1,3)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 49,
+   "id": "2fcdc70b",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[6, 9, 6],\n",
+       "       [1, 1, 2],\n",
+       "       [8, 7, 3],\n",
+       "       [5, 6, 3],\n",
+       "       [5, 3, 5],\n",
+       "       [8, 8, 2],\n",
+       "       [8, 1, 7],\n",
+       "       [8, 7, 2],\n",
+       "       [1, 2, 9],\n",
+       "       [9, 4, 9]])"
+      ]
+     },
+     "execution_count": 49,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "X1 = X.reshape(-1 ,3)\n",
+    "X1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 50,
+   "id": "dd6264eb",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([6, 2, 3, 3, 5, 2, 7, 2, 9, 9])"
+      ]
+     },
+     "execution_count": 50,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "last1 = X1[:, 2]\n",
+    "last1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 51,
+   "id": "5c08677b",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([False,  True,  True,  True, False,  True, False,  True, False,\n",
+       "       False])"
+      ]
+     },
+     "execution_count": 51,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "last1 <= 3"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 52,
+   "id": "3a0ab05d",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([2, 3, 3, 2, 2])"
+      ]
+     },
+     "execution_count": 52,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "temp1 = last1[last1 <= 3]\n",
+    "temp1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 53,
+   "id": "2c55c6d4",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "(array([1, 2, 3, 5, 7], dtype=int64),)"
+      ]
+     },
+     "execution_count": 53,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "np.where(last1 <= 3)"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 54,
+   "id": "09e25915",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([6, 2, 3, 3, 5, 2, 7, 2, 9, 9])"
+      ]
+     },
+     "execution_count": 54,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "last1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 55,
+   "id": "5733adf3",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([6, 5])"
+      ]
+     },
+     "execution_count": 55,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "temp2 =  last1[(last1 > 3) & (last1 <= 6)]\n",
+    "temp2"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 56,
+   "id": "390d173f",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([7, 9, 9])"
+      ]
+     },
+     "execution_count": 56,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "temp3 =  last1[last1 > 6]\n",
+    "temp3"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 57,
+   "id": "da7b652b",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "last1[last1 <= 3] = 0"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 58,
+   "id": "d830c247",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([6, 0, 0, 0, 5, 0, 7, 0, 9, 9])"
+      ]
+     },
+     "execution_count": 58,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "last1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 59,
+   "id": "945ad281",
+   "metadata": {},
+   "outputs": [],
+   "source": [
+    "last1[(last1 > 3) & (last1 <= 6)] = 1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 60,
+   "id": "732374a9",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([1, 0, 0, 0, 1, 0, 7, 0, 9, 9])"
+      ]
+     },
+     "execution_count": 60,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "last1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 61,
+   "id": "85719b27",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([1, 0, 0, 0, 1, 0, 2, 0, 2, 2])"
+      ]
+     },
+     "execution_count": 61,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "last1[last1 > 6] = 2\n",
+    "last1"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 62,
+   "id": "e0b3baa5",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[6, 9],\n",
+       "       [1, 1],\n",
+       "       [8, 7],\n",
+       "       [5, 6],\n",
+       "       [5, 3],\n",
+       "       [8, 8],\n",
+       "       [8, 1],\n",
+       "       [8, 7],\n",
+       "       [1, 2],\n",
+       "       [9, 4]])"
+      ]
+     },
+     "execution_count": 62,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "X_train = X1[:, 0:2]\n",
+    "X_train"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 63,
+   "id": "05e1907c",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([1, 0, 0, 0, 1, 0, 2, 0, 2, 2])"
+      ]
+     },
+     "execution_count": 63,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "Y_train = last1\n",
+    "Y_train"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 65,
+   "id": "130a4dda",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[1, 1],\n",
+       "       [8, 7],\n",
+       "       [5, 6],\n",
+       "       [8, 8],\n",
+       "       [8, 7]])"
+      ]
+     },
+     "execution_count": 65,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "X_train[Y_train == 0]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 66,
+   "id": "c33848c9",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([False,  True,  True,  True, False,  True, False,  True, False,\n",
+       "       False])"
+      ]
+     },
+     "execution_count": 66,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "Y_train == 0"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 67,
+   "id": "a56448cb",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[6, 9],\n",
+       "       [5, 3]])"
+      ]
+     },
+     "execution_count": 67,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "X_train[Y_train == 1]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": 68,
+   "id": "ac8a7b14",
+   "metadata": {},
+   "outputs": [
+    {
+     "data": {
+      "text/plain": [
+       "array([[8, 1],\n",
+       "       [1, 2],\n",
+       "       [9, 4]])"
+      ]
+     },
+     "execution_count": 68,
+     "metadata": {},
+     "output_type": "execute_result"
+    }
+   ],
+   "source": [
+    "X_train[Y_train == 2]"
+   ]
+  },
+  {
+   "cell_type": "code",
+   "execution_count": null,
+   "id": "b497e945",
+   "metadata": {},
+   "outputs": [],
+   "source": []
+  }
+ ],
+ "metadata": {
+  "kernelspec": {
+   "display_name": "Python 3 (ipykernel)",
+   "language": "python",
+   "name": "python3"
+  },
+  "language_info": {
+   "codemirror_mode": {
+    "name": "ipython",
+    "version": 3
+   },
+   "file_extension": ".py",
+   "mimetype": "text/x-python",
+   "name": "python",
+   "nbconvert_exporter": "python",
+   "pygments_lexer": "ipython3",
+   "version": "3.10.11"
+  }
+ },
+ "nbformat": 4,
+ "nbformat_minor": 5
+}

Failā izmaiņas netiks attēlotas, jo tās ir par lielu
+ 423 - 0
20200404123王春富/day4王春富20200404123/全部代码21期.ipynb


BIN
20200404123王春富/day5王春富20200404123/登录界面/.DS_Store


+ 8 - 0
20200404123王春富/day5王春富20200404123/登录界面/.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 6 - 0
20200404123王春富/day5王春富20200404123/登录界面/.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 7 - 0
20200404123王春富/day5王春富20200404123/登录界面/.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JavaScriptSettings">
+    <option name="languageLevel" value="ES6" />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
20200404123王春富/day5王春富20200404123/登录界面/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/手写数字识别.iml" filepath="$PROJECT_DIR$/.idea/手写数字识别.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
20200404123王春富/day5王春富20200404123/登录界面/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/.." vcs="Git" />
+  </component>
+</project>

+ 12 - 0
20200404123王春富/day5王春富20200404123/登录界面/.idea/手写数字识别.iml

@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+  <component name="PyDocumentationSettings">
+    <option name="format" value="PLAIN" />
+    <option name="myDocStringFormat" value="Plain" />
+  </component>
+</module>

BIN
20200404123王春富/day5王春富20200404123/登录界面/2.bmp


+ 67 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitAI.py

@@ -0,0 +1,67 @@
+import cv2
+import numpy as np
+import torch
+from .DigitModule import LeNet
+import os
+
+cur_dir = os.path.dirname(__file__)
+mod_file = os.path.join(cur_dir,"data/models.lenet")
+
+class DigitRecognizier:
+    def __init__(self):
+        super(DigitRecognizier, self).__init__()
+        self.CUDA = torch.cuda.is_available()
+        self.net = LeNet(10)
+        if self.CUDA:
+            self.net.cuda()
+        state = torch.load(mod_file)
+        self.net.load_state_dict(state)
+    
+
+    def pre_image(self, img):
+        # 大小
+        img = cv2.resize(img, (28,28))
+        # 灰度
+        img = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
+        # 小数类型
+        img = img.astype("float32")
+        # 逆转(F-> B, B->F)
+        img = 255.0 -img
+        # 去噪
+        img[img <= 150] = 0
+        cv2.imwrite("g.png", img.astype("uint8"))
+        # 转换为张量
+        img = torch.from_numpy(img).clone()
+        # 转换为N C H W
+        
+        return img
+
+    
+    def recognize(self, img):
+        result = []  # (数字,概率)
+        # 根据模型计算输出
+        p_img = self.pre_image(img)
+        if self.CUDA:
+            p_img = p_img.cuda()
+
+        predict = self.net.forward(p_img.view(1, 1, 28, 28))
+
+        pred_prob = torch.nn.functional.softmax(predict, dim=1)
+        # 计算在gpu,速度快
+        pred_prob = pred_prob[0]
+        # pred_prob = torch.squeeze(pred_prob, 0)
+        # pred_prob = pred_prob.view((pred_prob.shape[1]))
+        # 找出最大概率及其下标,判定概率
+        top1 = torch.argmax(pred_prob)
+        pro1 = pred_prob[top1]
+        result.append((top1.cpu().detach().numpy(), pro1.cpu().detach().numpy()))
+        if pro1 < 1.0:
+            # 把top1置为0,再找最大值
+            pred_prob[top1] = 0.0
+            top2 = torch.argmax(pred_prob)
+            pro2 = pred_prob[top2]
+            result.append((top2.cpu().detach().numpy(), pro2.cpu().detach().numpy()))
+
+
+        return result # 返回长度为10的概率向量
+

+ 17 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitApp.py

@@ -0,0 +1,17 @@
+"""
+"""
+from PyQt5.QtWidgets import QApplication
+from .DigitForm import DigitForm
+import sys 
+
+class DigitApp(QApplication):
+    """
+    """
+    def __init__(self):
+        """
+        """
+        super(DigitApp, self).__init__(sys.argv)
+        # 创建应用主窗体
+        self.dlg = DigitForm()
+        self.dlg.show()
+    

+ 36 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitDev.py

@@ -0,0 +1,36 @@
+from PyQt5.QtCore import QThread, pyqtSignal
+import cv2
+
+class DigitDev(QThread):
+    
+    signal_video = pyqtSignal(int, int, int, bytes)
+
+    def __init__(self):
+        super(DigitDev, self).__init__()
+        self.is_over = False
+        # 初始化设备
+        self.dev = cv2.VideoCapture(0, cv2.CAP_DSHOW)
+
+
+    def run(self):
+        while not self.is_over:
+            # 图像抓取
+            status, image = self.dev.read()
+            # 状态判定
+            if not status:
+                self.dev.release()
+                self.exit(0)
+            # 如果抓取图像成功,发送
+            shape = image.shape
+            image = cv2.cvtColor(image, cv2.COLOR_BGR2RGB)
+            self.signal_video.emit(shape[0], shape[1], shape[2], image.tobytes())
+            # 视觉暂停
+            QThread.usleep(100000)
+
+    def close(self):
+        self.is_over = True
+        while self.isRunning():
+            pass
+        # 释放设备
+        if self.dev.isOpened():
+            self.dev.release()

+ 84 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitForm.py

@@ -0,0 +1,84 @@
+from PyQt5.QtWidgets import QDialog
+from PyQt5.QtGui import QImage, QPixmap
+import sys
+from .DigitUI import Ui_Digit
+from .DigitDev import DigitDev
+from .DigitAI import DigitRecognizier
+import cv2
+import numpy as np
+
+class DigitForm(QDialog):
+    def __init__(self):
+        super(DigitForm, self).__init__()
+        # 加载UI(先设计好)
+        # 创建对象
+        self.ui = Ui_Digit()
+        # 使用setupUi绑定对话框(父窗体)
+        self.ui.setupUi(self)
+        # AI识别对象
+        self.reco = DigitRecognizier()
+        # 创建视频对象
+        self.dev = DigitDev()
+        self.dev.signal_video.connect(self.show_video)
+        self.dev.start()
+
+
+
+    # 覆盖QDialog原来两个我们不需要的默认功能
+    def keyPressEvent(self, e):
+        pass
+
+
+    def closeEvent(self, e):
+        # 完成一些需要的释放工作
+        self.dev.close()
+        sys.exit(0)
+
+    # UI中的两个槽函数
+    def capture_image(self):
+        # 抓取图像
+        self.capture_data = self.buffer_data
+        self.capture_shape = self.buffer_shape
+        # 显示抓取的图像
+        # byte -> QImage
+        h, w, ch = self.capture_shape
+        image = QImage(self.capture_data, w, h, w*ch, QImage.Format_BGR888)
+        # QImage -> QPixmap
+        pixmap = QPixmap.fromImage(image)
+        # QPixmap -> QLabel 
+        self.ui.lbl_image.setPixmap(pixmap)
+        self.ui.lbl_image.setScaledContents(True)
+
+    def digit_recognize(self):
+        # 已知
+        # self.capture_data
+        # self.capture_shape
+        # 准备:训练好的手写字符模型:models.lenet:LeNet-5
+        # 实现与模型一致的 神经网络结构(层数,层类型,每层参数一致)
+        # 利用神经网络结构,识别图片
+        image = np.ndarray(
+            shape=self.capture_shape,    # 构建图像矩阵的形状
+            dtype=np.uint8,
+            buffer=self.buffer_data
+        )
+
+        result = self.reco.recognize(image)
+        self.ui.lbl_top1.setText(F"<font size=20 color=red><b><strong>{result[0][0]}</strong><b></font>")
+        self.ui.lbl_prob1.setText(F"{result[0][1]:3.2f}")
+        if len(result) == 2:
+            self.ui.lbl_top2.setText(F"{result[1][0]}")
+            self.ui.lbl_prob2.setText(F"{result[1][1]:3.2f}")
+        else:
+            self.ui.lbl_top2.setText("--")
+            self.ui.lbl_prob2.setText("--")
+
+    def show_video(self, h, w, ch, data):
+        self.buffer_data = data
+        self.buffer_shape = (h, w, ch)
+        # byte -> QImage
+        image = QImage(data, w, h, w*ch, QImage.Format_RGB888)
+        # QImage -> QPixmap
+        pixmap = QPixmap.fromImage(image)
+        # QPixmap -> QLabel 
+        self.ui.lbl_video.setPixmap(pixmap)
+        self.ui.lbl_video.setScaledContents(True)

+ 21 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitModule.py

@@ -0,0 +1,21 @@
+import torch.nn as nn     # 神经网络的层的实现:卷积层
+import torch.nn.functional as fu
+
+class LeNet(nn.Module):
+    def __init__(self, cls_num=10):
+        super(LeNet, self).__init__()
+        self.conv1 = nn.Conv2d(1, 6, 5, padding=2)  
+        self.conv2 = nn.Conv2d(6, 16, 5)
+        self.fc1 = nn.Linear(16 * 5 * 5,  120)
+        self.fc2 = nn.Linear(120, 84) 
+        self.fc3 = nn.Linear(84, cls_num)
+    
+    def forward(self, x):
+        y = fu.max_pool2d(fu.relu(self.conv1(x)), (2, 2))
+        y = fu.max_pool2d(fu.relu(self.conv2(y)), (2, 2))
+        # 格式转换
+        y = y.view(y.size()[0], -1)
+        y = fu.relu(self.fc1(y))
+        y = fu.relu(self.fc2(y))
+        y = self.fc3(y)
+        return y

+ 82 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/DigitUI.py

@@ -0,0 +1,82 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'Digit.ui'
+#
+# Created by: PyQt5 UI code generator 5.14.1
+#
+# WARNING! All changes made in this file will be lost!
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+
+class Ui_Digit(object):
+    def setupUi(self, Digit):
+        Digit.setObjectName("Digit")
+        Digit.resize(921, 259)
+        Digit.setStyleSheet("QPushButton{\n"
+"    border-style:solid;\n"
+"    border-width:1px;\n"
+"    border-radius:8px;\n"
+"    border-top-color:#FFFFFF;\n"
+"    border-bottom-color:#888888;\n"
+"    border-left-color:#FFFFFF;\n"
+"    border-right-color:#888888;\n"
+"}\n"
+"QLabel#lbl_top1,#lbl_top2{\n"
+"    color:red;\n"
+"    font-size:24px;\n"
+"}\n"
+"QLabel#lbl_prob1,#lbl_prob2{\n"
+"    color:blue;\n"
+"}")
+        self.lbl_video = QtWidgets.QLabel(Digit)
+        self.lbl_video.setGeometry(QtCore.QRect(10, 10, 320, 240))
+        self.lbl_video.setFrameShape(QtWidgets.QFrame.Box)
+        self.lbl_video.setFrameShadow(QtWidgets.QFrame.Raised)
+        self.lbl_video.setAlignment(QtCore.Qt.AlignCenter)
+        self.lbl_video.setObjectName("lbl_video")
+        self.btn_capture = QtWidgets.QPushButton(Digit)
+        self.btn_capture.setGeometry(QtCore.QRect(340, 120, 93, 28))
+        self.btn_capture.setObjectName("btn_capture")
+        self.lbl_image = QtWidgets.QLabel(Digit)
+        self.lbl_image.setGeometry(QtCore.QRect(450, 77, 160, 120))
+        self.lbl_image.setFrameShape(QtWidgets.QFrame.Box)
+        self.lbl_image.setAlignment(QtCore.Qt.AlignCenter)
+        self.lbl_image.setObjectName("lbl_image")
+        self.btn_recognize = QtWidgets.QPushButton(Digit)
+        self.btn_recognize.setGeometry(QtCore.QRect(630, 120, 92, 28))
+        self.btn_recognize.setObjectName("btn_recognize")
+        self.lbl_top1 = QtWidgets.QLabel(Digit)
+        self.lbl_top1.setGeometry(QtCore.QRect(740, 60, 60, 60))
+        self.lbl_top1.setAlignment(QtCore.Qt.AlignCenter)
+        self.lbl_top1.setObjectName("lbl_top1")
+        self.lbl_top2 = QtWidgets.QLabel(Digit)
+        self.lbl_top2.setGeometry(QtCore.QRect(740, 150, 60, 60))
+        self.lbl_top2.setAlignment(QtCore.Qt.AlignCenter)
+        self.lbl_top2.setObjectName("lbl_top2")
+        self.lbl_prob1 = QtWidgets.QLabel(Digit)
+        self.lbl_prob1.setGeometry(QtCore.QRect(830, 74, 80, 28))
+        self.lbl_prob1.setAlignment(QtCore.Qt.AlignCenter)
+        self.lbl_prob1.setObjectName("lbl_prob1")
+        self.lbl_prob2 = QtWidgets.QLabel(Digit)
+        self.lbl_prob2.setGeometry(QtCore.QRect(830, 165, 80, 26))
+        self.lbl_prob2.setAlignment(QtCore.Qt.AlignCenter)
+        self.lbl_prob2.setObjectName("lbl_prob2")
+
+        self.retranslateUi(Digit)
+        self.btn_capture.clicked.connect(Digit.capture_image)
+        self.btn_recognize.clicked.connect(Digit.digit_recognize)
+        QtCore.QMetaObject.connectSlotsByName(Digit)
+
+    def retranslateUi(self, Digit):
+        _translate = QtCore.QCoreApplication.translate
+        Digit.setWindowTitle(_translate("Digit", "手写数字识别程序"))
+        self.lbl_video.setText(_translate("Digit", "<font size=20 color=blue><b>视频显示区域</b></font>"))
+        self.btn_capture.setText(_translate("Digit", "抓取图像"))
+        self.lbl_image.setText(_translate("Digit", "抓取的图像"))
+        self.btn_recognize.setText(_translate("Digit", "数组识别"))
+        self.lbl_top1.setText(_translate("Digit", "top1"))
+        self.lbl_top2.setText(_translate("Digit", "top2"))
+        self.lbl_prob1.setText(_translate("Digit", "prob1"))
+        self.lbl_prob2.setText(_translate("Digit", "prob2"))

+ 15 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/Main.py

@@ -0,0 +1,15 @@
+"""
+Date: 2020-05-22
+Author: Louis Young
+Usage: 主程序(抓取视频,并截图,然后调用数字识别模块,完成手写数字的智能识别)
+"""
+
+from .DigitApp import DigitApp
+import sys
+
+# 1. 创建应用
+app_digit = DigitApp() 
+# 2. 启动应用的消息监控循环
+status = app_digit.exec()
+# 3. 应用结束的时候,返回状态码给系统
+sys.exit(status)

+ 0 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/__init__.py


+ 0 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/data/__init__.py


BIN
20200404123王春富/day5王春富20200404123/登录界面/build/lib/digitapp/data/models.lenet


+ 2 - 0
20200404123王春富/day5王春富20200404123/登录界面/build/scripts-3.6/digit.bat

@@ -0,0 +1,2 @@
+@python -m digitapp.Main
+

+ 2 - 0
20200404123王春富/day5王春富20200404123/登录界面/digit.bat

@@ -0,0 +1,2 @@
+@python -m digitapp.Main
+

+ 1 - 0
20200404123王春富/day5王春富20200404123/登录界面/digit.py

@@ -0,0 +1 @@
+import digitapp.Main

BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/.DS_Store


+ 16 - 0
20200404123王春富/day5王春富20200404123/登录界面/digitapp/DigitApp.py

@@ -0,0 +1,16 @@
+"""
+"""
+from PyQt5.QtWidgets import QApplication
+from .DigitForm import DigitForm
+import sys
+
+class DigitApp(QApplication):
+    """
+    """
+    def __init__(self):
+        """
+        """
+        super(DigitApp, self).__init__(sys.argv)
+        # 创建应用主窗体
+        self.dlg = DigitForm()
+        self.dlg.show()

+ 34 - 0
20200404123王春富/day5王春富20200404123/登录界面/digitapp/DigitForm.py

@@ -0,0 +1,34 @@
+from PyQt5.QtWidgets import QDialog
+from PyQt5.QtGui import QImage, QPixmap
+import sys
+from .DigitUI1 import Ui_Digit
+
+import numpy as np
+
+class DigitForm(QDialog):
+    def __init__(self):
+        super(DigitForm, self).__init__()
+        # 加载UI(先设计好)
+        # 创建对象
+        self.ui = Ui_Digit()
+        # 使用setupUi绑定对话框(父窗体)
+        self.ui.setupUi(self)
+
+
+
+
+
+    def capture_image(self):
+        if (self.ui.lbl_user.toPlainText() == 'wcf') & (self.ui.lbl_pwd.toPlainText() == '123456') :
+            self.ui.lbl_result.setText('欢迎:' + self.ui.lbl_user.toPlainText())
+        else:
+            self.ui.lbl_result.setText('用户名或者密码错误')
+
+
+
+
+
+
+
+
+

+ 68 - 0
20200404123王春富/day5王春富20200404123/登录界面/digitapp/DigitUI1.py

@@ -0,0 +1,68 @@
+# -*- coding: utf-8 -*-
+
+# Form implementation generated from reading ui file 'DigitUI1.ui'
+#
+# Created by: PyQt5 UI code generator 5.15.9
+#
+# WARNING: Any manual changes made to this file will be lost when pyuic5 is
+# run again.  Do not edit this file unless you know what you are doing.
+
+
+from PyQt5 import QtCore, QtGui, QtWidgets
+
+
+class Ui_Digit(object):
+    def setupUi(self, Digit):
+        Digit.setObjectName("Digit")
+        Digit.resize(653, 166)
+        Digit.setStyleSheet("QPushButton{\n"
+"    border-style:solid;\n"
+"    border-width:1px;\n"
+"    border-radius:8px;\n"
+"    border-top-color:#FFFFFF;\n"
+"    border-bottom-color:#888888;\n"
+"    border-left-color:#FFFFFF;\n"
+"    border-right-color:#888888;\n"
+"}\n"
+"QLabel#lbl_top1,#lbl_top2{\n"
+"    color:red;\n"
+"    font-size:24px;\n"
+"}\n"
+"QLabel#lbl_prob1,#lbl_prob2{\n"
+"    color:blue;\n"
+"}")
+        self.btn_recognize = QtWidgets.QPushButton(Digit)
+        self.btn_recognize.setGeometry(QtCore.QRect(300, 200, 92, 28))
+        self.btn_recognize.setObjectName("btn_recognize")
+        self.label = QtWidgets.QLabel(Digit)
+        self.label.setGeometry(QtCore.QRect(220, 10, 81, 41))
+        self.label.setObjectName("label")
+        self.lbl_user = QtWidgets.QTextEdit(Digit)
+        self.lbl_user.setGeometry(QtCore.QRect(300, 20, 111, 31))
+        self.lbl_user.setObjectName("lbl_user")
+        self.label_2 = QtWidgets.QLabel(Digit)
+        self.label_2.setGeometry(QtCore.QRect(230, 70, 60, 16))
+        self.label_2.setObjectName("label_2")
+        self.lbl_pwd = QtWidgets.QTextEdit(Digit)
+        self.lbl_pwd.setGeometry(QtCore.QRect(300, 60, 111, 31))
+        self.lbl_pwd.setObjectName("lbl_pwd")
+        self.btn_login = QtWidgets.QPushButton(Digit)
+        self.btn_login.setGeometry(QtCore.QRect(270, 110, 113, 32))
+        self.btn_login.setObjectName("btn_login")
+        self.lbl_result = QtWidgets.QLabel(Digit)
+        self.lbl_result.setGeometry(QtCore.QRect(500, 50, 111, 41))
+        self.lbl_result.setText("")
+        self.lbl_result.setObjectName("lbl_result")
+        # self.lbl_result.
+
+        self.retranslateUi(Digit)
+        self.btn_login.clicked.connect(Digit.capture_image) # type: ignore
+        QtCore.QMetaObject.connectSlotsByName(Digit)
+
+    def retranslateUi(self, Digit):
+        _translate = QtCore.QCoreApplication.translate
+        Digit.setWindowTitle(_translate("Digit", "登录程序"))
+        self.btn_recognize.setText(_translate("Digit", "登录"))
+        self.label.setText(_translate("Digit", "用户名:"))
+        self.label_2.setText(_translate("Digit", "密  码:"))
+        self.btn_login.setText(_translate("Digit", "登录"))

+ 143 - 0
20200404123王春富/day5王春富20200404123/登录界面/digitapp/DigitUI1.ui

@@ -0,0 +1,143 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<ui version="4.0">
+ <class>Digit</class>
+ <widget class="QDialog" name="Digit">
+  <property name="geometry">
+   <rect>
+    <x>0</x>
+    <y>0</y>
+    <width>653</width>
+    <height>166</height>
+   </rect>
+  </property>
+  <property name="windowTitle">
+   <string>手写数字识别程序</string>
+  </property>
+  <property name="styleSheet">
+   <string notr="true">QPushButton{
+	border-style:solid;
+	border-width:1px;
+	border-radius:8px;
+	border-top-color:#FFFFFF;
+	border-bottom-color:#888888;
+	border-left-color:#FFFFFF;
+	border-right-color:#888888;
+}
+QLabel#lbl_top1,#lbl_top2{
+	color:red;
+	font-size:24px;
+}
+QLabel#lbl_prob1,#lbl_prob2{
+	color:blue;
+}</string>
+  </property>
+  <widget class="QPushButton" name="btn_recognize">
+   <property name="geometry">
+    <rect>
+     <x>300</x>
+     <y>200</y>
+     <width>92</width>
+     <height>28</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>数组识别</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label">
+   <property name="geometry">
+    <rect>
+     <x>220</x>
+     <y>10</y>
+     <width>81</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>用户名:</string>
+   </property>
+  </widget>
+  <widget class="QTextEdit" name="lbl_user">
+   <property name="geometry">
+    <rect>
+     <x>300</x>
+     <y>20</y>
+     <width>111</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QLabel" name="label_2">
+   <property name="geometry">
+    <rect>
+     <x>230</x>
+     <y>70</y>
+     <width>60</width>
+     <height>16</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>密  码:</string>
+   </property>
+  </widget>
+  <widget class="QTextEdit" name="lbl_pwd">
+   <property name="geometry">
+    <rect>
+     <x>300</x>
+     <y>60</y>
+     <width>111</width>
+     <height>31</height>
+    </rect>
+   </property>
+  </widget>
+  <widget class="QPushButton" name="btn_login">
+   <property name="geometry">
+    <rect>
+     <x>270</x>
+     <y>110</y>
+     <width>113</width>
+     <height>32</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string>登录</string>
+   </property>
+  </widget>
+  <widget class="QLabel" name="lbl_result">
+   <property name="geometry">
+    <rect>
+     <x>500</x>
+     <y>50</y>
+     <width>111</width>
+     <height>41</height>
+    </rect>
+   </property>
+   <property name="text">
+    <string/>
+   </property>
+  </widget>
+ </widget>
+ <resources/>
+ <connections>
+  <connection>
+   <sender>btn_login</sender>
+   <signal>clicked()</signal>
+   <receiver>Digit</receiver>
+   <slot>capture_image()</slot>
+   <hints>
+    <hint type="sourcelabel">
+     <x>326</x>
+     <y>125</y>
+    </hint>
+    <hint type="destinationlabel">
+     <x>326</x>
+     <y>82</y>
+    </hint>
+   </hints>
+  </connection>
+ </connections>
+ <slots>
+  <slot>capture_image()</slot>
+  <slot>digit_recognize()</slot>
+ </slots>
+</ui>

+ 15 - 0
20200404123王春富/day5王春富20200404123/登录界面/digitapp/Main.py

@@ -0,0 +1,15 @@
+"""
+Date: 2020-05-22
+Author: Louis Young
+Usage: 主程序(抓取视频,并截图,然后调用数字识别模块,完成手写数字的智能识别)
+"""
+
+from .DigitApp import DigitApp
+import sys
+
+# 1. 创建应用
+app_digit = DigitApp() 
+# 2. 启动应用的消息监控循环
+status = app_digit.exec()
+# 3. 应用结束的时候,返回状态码给系统
+sys.exit(status)

+ 0 - 0
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__init__.py


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitAI.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitAI.cpython-36.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitApp.cpython-310.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitApp.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitApp.cpython-36.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitDev.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitDev.cpython-36.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitForm.cpython-310.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitForm.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitForm.cpython-36.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitModule.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitModule.cpython-36.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitUI.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitUI.cpython-36.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitUI1.cpython-310.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/DigitUI1.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/Main.cpython-310.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/Main.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/Main.cpython-36.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/__init__.cpython-310.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/__init__.cpython-311.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/__init__.cpython-36.pyc


BIN
20200404123王春富/day5王春富20200404123/登录界面/digitapp/__pycache__/loginUI.cpython-311.pyc


+ 1 - 0
20200404123王春富/day5王春富20200404123/登录界面/digitapp/tool.bat

@@ -0,0 +1 @@
+@pyuic5 -o DigitUI.py  Digit.ui

BIN
20200404123王春富/day5王春富20200404123/登录界面/项目文件的关系.pptx


+ 8 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 6 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 4 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/misc.xml

@@ -0,0 +1,4 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.10 (卷积神经网络训练--每行代码注释版本)" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/卷积神经网络训练--每行代码注释版本.iml" filepath="$PROJECT_DIR$/.idea/卷积神经网络训练--每行代码注释版本.iml" />
+    </modules>
+  </component>
+</project>

+ 10 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/.idea/卷积神经网络训练--每行代码注释版本.iml

@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$">
+      <excludeFolder url="file://$MODULE_DIR$/venv" />
+    </content>
+    <orderEntry type="jdk" jdkName="Python 3.10 (卷积神经网络训练--每行代码注释版本)" jdkType="Python SDK" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-images-idx3-ubyte


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-images-idx3-ubyte.gz


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-labels-idx1-ubyte


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-labels-idx1-ubyte.gz


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-images-idx3-ubyte


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-images-idx3-ubyte.gz


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-labels-idx1-ubyte


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-labels-idx1-ubyte.gz


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.DS_Store


+ 8 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml
+# Editor-based HTTP Client requests
+/httpRequests/

+ 8 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/conv_demo.iml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="PYTHON_MODULE" version="4">
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 6 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/encodings.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="Encoding">
+    <file url="file://$PROJECT_DIR$/lenet5.pt" charset="UTF-8" />
+  </component>
+</project>

+ 27 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/inspectionProfiles/Project_Default.xml

@@ -0,0 +1,27 @@
+<component name="InspectionProjectProfileManager">
+  <profile version="1.0">
+    <option name="myName" value="Project Default" />
+    <inspection_tool class="PyPackageRequirementsInspection" enabled="true" level="WARNING" enabled_by_default="true">
+      <option name="ignoredPackages">
+        <value>
+          <list size="14">
+            <item index="0" class="java.lang.String" itemvalue="opencv-contrib-python" />
+            <item index="1" class="java.lang.String" itemvalue="networkx" />
+            <item index="2" class="java.lang.String" itemvalue="opencv-python" />
+            <item index="3" class="java.lang.String" itemvalue="PyQt5-sip" />
+            <item index="4" class="java.lang.String" itemvalue="torch" />
+            <item index="5" class="java.lang.String" itemvalue="MarkupSafe" />
+            <item index="6" class="java.lang.String" itemvalue="numpy" />
+            <item index="7" class="java.lang.String" itemvalue="Jinja2" />
+            <item index="8" class="java.lang.String" itemvalue="PyQt5-Qt5" />
+            <item index="9" class="java.lang.String" itemvalue="filelock" />
+            <item index="10" class="java.lang.String" itemvalue="mpmath" />
+            <item index="11" class="java.lang.String" itemvalue="PyQt5" />
+            <item index="12" class="java.lang.String" itemvalue="typing_extensions" />
+            <item index="13" class="java.lang.String" itemvalue="sympy" />
+          </list>
+        </value>
+      </option>
+    </inspection_tool>
+  </profile>
+</component>

+ 6 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/inspectionProfiles/profiles_settings.xml

@@ -0,0 +1,6 @@
+<component name="InspectionProjectProfileManager">
+  <settings>
+    <option name="USE_PROJECT_PROFILE" value="false" />
+    <version value="1.0" />
+  </settings>
+</component>

+ 7 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/misc.xml

@@ -0,0 +1,7 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="JavaScriptSettings">
+    <option name="languageLevel" value="ES6" />
+  </component>
+  <component name="ProjectRootManager" version="2" project-jdk-name="Python 3.7" project-jdk-type="Python SDK" />
+</project>

+ 8 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/conv_demo.iml" filepath="$PROJECT_DIR$/.idea/conv_demo.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="$PROJECT_DIR$/../.." vcs="Git" />
+  </component>
+</project>

BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/00_5.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/01_0.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/02_4.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/03_1.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/04_9.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/05_2.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/06_1.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/07_3.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/08_1.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/09_4.jpg


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/lenet5.cpython-310.pyc


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/lenet5.cpython-311.pyc


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/lenet5.cpython-36.pyc


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/lenet5.cpython-38.pyc


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/train.cpython-311.pyc


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/__pycache__/train_new.cpython-311.pyc


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-images-idx3-ubyte


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-images-idx3-ubyte.gz


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-labels-idx1-ubyte


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/t10k-labels-idx1-ubyte.gz


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-images-idx3-ubyte


BIN
20200404123王春富/day6王春富20200404123/卷积神经网络训练--每行代码注释版本/卷积神经网络训练--每行代码注释版本/datasets/MNIST/raw/train-images-idx3-ubyte.gz


Daži faili netika attēloti, jo izmaiņu fails ir pārāk liels