scient 0.2.0__tar.gz → 0.3.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (235) hide show
  1. {scient-0.2.0 → scient-0.3.0}/MANIFEST.in +1 -0
  2. scient-0.3.0/PKG-INFO +304 -0
  3. scient-0.3.0/README.md +290 -0
  4. {scient-0.2.0 → scient-0.3.0}/scient/image/threshold.c +2 -10
  5. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/__init__.py +1 -1
  6. scient-0.2.0/scient/neuralnet/train.c → scient-0.3.0/scient/neuralnet/fit.c +6065 -6938
  7. scient-0.3.0/scient/test/data/i05.bmp +0 -0
  8. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00000907.JPEG +0 -0
  9. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00001244.JPEG +0 -0
  10. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00001393.JPEG +0 -0
  11. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00002769.JPEG +0 -0
  12. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00004049.JPEG +0 -0
  13. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00004359.JPEG +0 -0
  14. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00004557.JPEG +0 -0
  15. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00005898.JPEG +0 -0
  16. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00007958.JPEG +0 -0
  17. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00008206.JPEG +0 -0
  18. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00010805.JPEG +0 -0
  19. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00011754.JPEG +0 -0
  20. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00011869.JPEG +0 -0
  21. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00012394.JPEG +0 -0
  22. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00014174.JPEG +0 -0
  23. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00015738.JPEG +0 -0
  24. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00017268.JPEG +0 -0
  25. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00020379.JPEG +0 -0
  26. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00021998.JPEG +0 -0
  27. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00022799.JPEG +0 -0
  28. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00023653.JPEG +0 -0
  29. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00024776.JPEG +0 -0
  30. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00027703.JPEG +0 -0
  31. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00031419.JPEG +0 -0
  32. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00033199.JPEG +0 -0
  33. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00035293.JPEG +0 -0
  34. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00036888.JPEG +0 -0
  35. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00040043.JPEG +0 -0
  36. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00040864.JPEG +0 -0
  37. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00042523.JPEG +0 -0
  38. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00042556.JPEG +0 -0
  39. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00044224.JPEG +0 -0
  40. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00047457.JPEG +0 -0
  41. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/ILSVRC2012_val_00049405.JPEG +0 -0
  42. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/n02086240_13.JPEG +0 -0
  43. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/n02086240_34.JPEG +0 -0
  44. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/n02086240_35.JPEG +0 -0
  45. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/n02086240_37.JPEG +0 -0
  46. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/n02086240_7.JPEG +0 -0
  47. scient-0.3.0/scient/test/data/imagewoof/train/n02086240/n02086240_9.JPEG +0 -0
  48. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00000077.JPEG +0 -0
  49. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00000948.JPEG +0 -0
  50. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00001047.JPEG +0 -0
  51. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00003154.JPEG +0 -0
  52. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00003615.JPEG +0 -0
  53. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00003837.JPEG +0 -0
  54. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00004074.JPEG +0 -0
  55. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00005054.JPEG +0 -0
  56. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00005215.JPEG +0 -0
  57. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00005364.JPEG +0 -0
  58. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00008104.JPEG +0 -0
  59. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00010038.JPEG +0 -0
  60. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00010057.JPEG +0 -0
  61. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00010385.JPEG +0 -0
  62. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00010643.JPEG +0 -0
  63. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00018629.JPEG +0 -0
  64. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00018933.JPEG +0 -0
  65. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00019209.JPEG +0 -0
  66. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00021365.JPEG +0 -0
  67. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00021666.JPEG +0 -0
  68. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00024789.JPEG +0 -0
  69. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00027669.JPEG +0 -0
  70. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00032716.JPEG +0 -0
  71. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00032859.JPEG +0 -0
  72. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00034616.JPEG +0 -0
  73. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00035893.JPEG +0 -0
  74. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00036088.JPEG +0 -0
  75. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00036907.JPEG +0 -0
  76. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00037577.JPEG +0 -0
  77. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00038227.JPEG +0 -0
  78. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00043077.JPEG +0 -0
  79. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00044094.JPEG +0 -0
  80. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00044227.JPEG +0 -0
  81. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00044285.JPEG +0 -0
  82. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/ILSVRC2012_val_00047173.JPEG +0 -0
  83. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/n02087394_103.JPEG +0 -0
  84. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/n02087394_24.JPEG +0 -0
  85. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/n02087394_36.JPEG +0 -0
  86. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/n02087394_37.JPEG +0 -0
  87. scient-0.3.0/scient/test/data/imagewoof/train/n02087394/n02087394_46.JPEG +0 -0
  88. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00000599.JPEG +0 -0
  89. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00002079.JPEG +0 -0
  90. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00008435.JPEG +0 -0
  91. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00008675.JPEG +0 -0
  92. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00009664.JPEG +0 -0
  93. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00011384.JPEG +0 -0
  94. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00011719.JPEG +0 -0
  95. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00012235.JPEG +0 -0
  96. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00016656.JPEG +0 -0
  97. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00017873.JPEG +0 -0
  98. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00018916.JPEG +0 -0
  99. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00019187.JPEG +0 -0
  100. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00019283.JPEG +0 -0
  101. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00020553.JPEG +0 -0
  102. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00023357.JPEG +0 -0
  103. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00025393.JPEG +0 -0
  104. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00025613.JPEG +0 -0
  105. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00027347.JPEG +0 -0
  106. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00027804.JPEG +0 -0
  107. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00027989.JPEG +0 -0
  108. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00030567.JPEG +0 -0
  109. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00032527.JPEG +0 -0
  110. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00032594.JPEG +0 -0
  111. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00034275.JPEG +0 -0
  112. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00035414.JPEG +0 -0
  113. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00037353.JPEG +0 -0
  114. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00039659.JPEG +0 -0
  115. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00042258.JPEG +0 -0
  116. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00044978.JPEG +0 -0
  117. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00047125.JPEG +0 -0
  118. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00047309.JPEG +0 -0
  119. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00048167.JPEG +0 -0
  120. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00048273.JPEG +0 -0
  121. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00049354.JPEG +0 -0
  122. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/ILSVRC2012_val_00049604.JPEG +0 -0
  123. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/n02088364_15.JPEG +0 -0
  124. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/n02088364_6.JPEG +0 -0
  125. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/n02088364_79.JPEG +0 -0
  126. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/n02088364_83.JPEG +0 -0
  127. scient-0.3.0/scient/test/data/imagewoof/train/n02088364/n02088364_99.JPEG +0 -0
  128. scient-0.3.0/scient/test/data/imagewoof/val/n02086240/ILSVRC2012_val_00002701.JPEG +0 -0
  129. scient-0.3.0/scient/test/data/imagewoof/val/n02086240/ILSVRC2012_val_00003841.JPEG +0 -0
  130. scient-0.3.0/scient/test/data/imagewoof/val/n02086240/ILSVRC2012_val_00004081.JPEG +0 -0
  131. scient-0.3.0/scient/test/data/imagewoof/val/n02086240/ILSVRC2012_val_00010550.JPEG +0 -0
  132. scient-0.3.0/scient/test/data/imagewoof/val/n02086240/ILSVRC2012_val_00014050.JPEG +0 -0
  133. scient-0.3.0/scient/test/data/imagewoof/val/n02087394/ILSVRC2012_val_00000102.JPEG +0 -0
  134. scient-0.3.0/scient/test/data/imagewoof/val/n02087394/ILSVRC2012_val_00001651.JPEG +0 -0
  135. scient-0.3.0/scient/test/data/imagewoof/val/n02087394/ILSVRC2012_val_00004992.JPEG +0 -0
  136. scient-0.3.0/scient/test/data/imagewoof/val/n02087394/ILSVRC2012_val_00006900.JPEG +0 -0
  137. scient-0.3.0/scient/test/data/imagewoof/val/n02087394/ILSVRC2012_val_00009200.JPEG +0 -0
  138. scient-0.3.0/scient/test/data/imagewoof/val/n02088364/ILSVRC2012_val_00005291.JPEG +0 -0
  139. scient-0.3.0/scient/test/data/imagewoof/val/n02088364/ILSVRC2012_val_00005922.JPEG +0 -0
  140. scient-0.3.0/scient/test/data/imagewoof/val/n02088364/ILSVRC2012_val_00009542.JPEG +0 -0
  141. scient-0.3.0/scient/test/data/imagewoof/val/n02088364/ILSVRC2012_val_00010420.JPEG +0 -0
  142. scient-0.3.0/scient/test/data/imagewoof/val/n02088364/ILSVRC2012_val_00013381.JPEG +0 -0
  143. scient-0.3.0/scient/test/neuralnet.fit.py +181 -0
  144. scient-0.3.0/scient.egg-info/PKG-INFO +304 -0
  145. scient-0.3.0/scient.egg-info/SOURCES.txt +230 -0
  146. {scient-0.2.0 → scient-0.3.0}/setup.py +6 -7
  147. scient-0.2.0/PKG-INFO +0 -11
  148. scient-0.2.0/scient.egg-info/PKG-INFO +0 -11
  149. scient-0.2.0/scient.egg-info/SOURCES.txt +0 -92
  150. {scient-0.2.0 → scient-0.3.0}/scient/__init__.py +0 -0
  151. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/__init__.py +0 -0
  152. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/binning.c +0 -0
  153. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/correlate.c +0 -0
  154. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/distance.c +0 -0
  155. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/entropy.c +0 -0
  156. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/gene.c +0 -0
  157. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/kdtree.c +0 -0
  158. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/linear_regression.c +0 -0
  159. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/metric.c +0 -0
  160. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/pca.c +0 -0
  161. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/similar.c +0 -0
  162. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/trie.c +0 -0
  163. {scient-0.2.0 → scient-0.3.0}/scient/algorithm/weight.c +0 -0
  164. {scient-0.2.0 → scient-0.3.0}/scient/associate/__init__.py +0 -0
  165. {scient-0.2.0 → scient-0.3.0}/scient/associate/apriori.c +0 -0
  166. {scient-0.2.0 → scient-0.3.0}/scient/associate/rule_merge.c +0 -0
  167. {scient-0.2.0 → scient-0.3.0}/scient/associate/sbar.c +0 -0
  168. {scient-0.2.0 → scient-0.3.0}/scient/calc_expr.c +0 -0
  169. {scient-0.2.0 → scient-0.3.0}/scient/cluster/__init__.py +0 -0
  170. {scient-0.2.0 → scient-0.3.0}/scient/cluster/bestkmeans.c +0 -0
  171. {scient-0.2.0 → scient-0.3.0}/scient/cluster/fourstep.c +0 -0
  172. {scient-0.2.0 → scient-0.3.0}/scient/cluster/seqsim.c +0 -0
  173. {scient-0.2.0 → scient-0.3.0}/scient/data/brand.json +0 -0
  174. {scient-0.2.0 → scient-0.3.0}/scient/data/division.json +0 -0
  175. {scient-0.2.0 → scient-0.3.0}/scient/data/ethnic.json +0 -0
  176. {scient-0.2.0 → scient-0.3.0}/scient/data/trade.json +0 -0
  177. {scient-0.2.0 → scient-0.3.0}/scient/graph/__init__.py +0 -0
  178. {scient-0.2.0 → scient-0.3.0}/scient/graph/louvain.c +0 -0
  179. {scient-0.2.0 → scient-0.3.0}/scient/image/__init__.py +0 -0
  180. {scient-0.2.0 → scient-0.3.0}/scient/image/edge.c +0 -0
  181. {scient-0.2.0 → scient-0.3.0}/scient/image/feature.c +0 -0
  182. {scient-0.2.0 → scient-0.3.0}/scient/image/friqa.c +0 -0
  183. {scient-0.2.0 → scient-0.3.0}/scient/image/hash.c +0 -0
  184. {scient-0.2.0 → scient-0.3.0}/scient/image/kernel.c +0 -0
  185. {scient-0.2.0 → scient-0.3.0}/scient/image/process.c +0 -0
  186. {scient-0.2.0 → scient-0.3.0}/scient/language/__init__.py +0 -0
  187. {scient-0.2.0 → scient-0.3.0}/scient/language/cut.c +0 -0
  188. {scient-0.2.0 → scient-0.3.0}/scient/language/document.c +0 -0
  189. {scient-0.2.0 → scient-0.3.0}/scient/language/entity.c +0 -0
  190. {scient-0.2.0 → scient-0.3.0}/scient/language/hash.c +0 -0
  191. {scient-0.2.0 → scient-0.3.0}/scient/language/keyword.c +0 -0
  192. {scient-0.2.0 → scient-0.3.0}/scient/language/longest_common.c +0 -0
  193. {scient-0.2.0 → scient-0.3.0}/scient/language/process.c +0 -0
  194. {scient-0.2.0 → scient-0.3.0}/scient/language/tagging.c +0 -0
  195. {scient-0.2.0 → scient-0.3.0}/scient/language/tokenize.c +0 -0
  196. {scient-0.2.0 → scient-0.3.0}/scient/language/topic.c +0 -0
  197. {scient-0.2.0 → scient-0.3.0}/scient/language/vocab.c +0 -0
  198. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/activate.c +0 -0
  199. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/attention.c +0 -0
  200. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/bert.c +0 -0
  201. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/crf.c +0 -0
  202. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/dataset.c +0 -0
  203. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/dropout.c +0 -0
  204. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/esim.c +0 -0
  205. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/function.c +0 -0
  206. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/glove.c +0 -0
  207. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/hypernet.c +0 -0
  208. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/lora.c +0 -0
  209. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/loss.c +0 -0
  210. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/lstm.c +0 -0
  211. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/lstm_crf.c +0 -0
  212. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/mask_linear.c +0 -0
  213. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/optimize.c +0 -0
  214. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/prepare.c +0 -0
  215. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/resnet.c +0 -0
  216. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/skip_gram.c +0 -0
  217. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/transformer.c +0 -0
  218. {scient-0.2.0 → scient-0.3.0}/scient/neuralnet/utils.c +0 -0
  219. {scient-0.2.0 → scient-0.3.0}/scient/process.c +0 -0
  220. {scient-0.2.0 → scient-0.3.0}/scient/service.c +0 -0
  221. {scient-0.2.0 → scient-0.3.0}/scient/test/data/i10.bmp +0 -0
  222. {scient-0.2.0 → scient-0.3.0}/scient/test/data/i10_23_3.bmp +0 -0
  223. {scient-0.2.0 → scient-0.3.0}/scient/test/data/i10_23_4.bmp +0 -0
  224. {scient-0.2.0 → scient-0.3.0}/scient/test/data/i10_23_5.bmp +0 -0
  225. {scient-0.2.0 → scient-0.3.0}/scient/test/data/i10_24_5.bmp +0 -0
  226. {scient-0.2.0 → scient-0.3.0}/scient/test/image.feature.py +0 -0
  227. {scient-0.2.0 → scient-0.3.0}/scient/test/image.friqa.py +0 -0
  228. {scient-0.2.0 → scient-0.3.0}/scient/timeseries/__init__.py +0 -0
  229. {scient-0.2.0 → scient-0.3.0}/scient/timeseries/filter.c +0 -0
  230. {scient-0.2.0 → scient-0.3.0}/scient/timeseries/outlier.c +0 -0
  231. {scient-0.2.0 → scient-0.3.0}/scient/timeseries/segment.c +0 -0
  232. {scient-0.2.0 → scient-0.3.0}/scient.egg-info/dependency_links.txt +0 -0
  233. {scient-0.2.0 → scient-0.3.0}/scient.egg-info/requires.txt +0 -0
  234. {scient-0.2.0 → scient-0.3.0}/scient.egg-info/top_level.txt +0 -0
  235. {scient-0.2.0 → scient-0.3.0}/setup.cfg +0 -0
@@ -6,3 +6,4 @@ exclude scient/language/__tokenize_.py
6
6
  exclude scient/language/__vocab_.py
7
7
  exclude scient/neuralnet/__attention (2).py
8
8
  exclude scient/neuralnet/__dataset (2).py
9
+ exclude scient/neuralnet/__train.py
scient-0.3.0/PKG-INFO ADDED
@@ -0,0 +1,304 @@
1
+ Metadata-Version: 2.1
2
+ Name: scient
3
+ Version: 0.3.0
4
+ Summary: A python package about science compute algorithm, include natural language, image, neural network, optimize algorithm, machine learning, graphic algorithm, etc.
5
+ Home-page:
6
+ Author:
7
+ Author-email: yaomsn@live.cn
8
+ License: Licence
9
+ Keywords: science compute,image,natural language,machine learning,neural network,optimize algorithm,graphic algorithm
10
+ Platform: any
11
+ Description-Content-Type: text/markdown
12
+ Requires-Dist: numpy>=1.24.0
13
+ Requires-Dist: scipy>=1.12.0
14
+
15
+ # scient
16
+
17
+ **scient**一个用python实现科学计算相关算法的包,包括自然语言、图像、神经网络、优化算法、机器学习、图计算等模块。
18
+
19
+ **scient**源码和编译安装包可以在`Python package index`获取。
20
+
21
+ The source code and binary installers for the latest released version are available at the [Python package index].
22
+
23
+ [https://pypi.org/project/scient](https://pypi.org/project/scient)
24
+
25
+ 可以用`pip`安装`scient`。
26
+
27
+ You can install `scient` like this:
28
+
29
+ ```
30
+ pip install scient
31
+ ```
32
+
33
+ 也可以用`setup.py`安装。
34
+
35
+ Or in the `scient` directory, execute:
36
+
37
+ ```
38
+ python setup.py install
39
+ ```
40
+
41
+ ## scient.image
42
+
43
+ 图像相关算法模块,包括边缘检测、图像相似度计算、图像质量评价、图像特征提取等。
44
+
45
+ ### scient.image.friqa
46
+
47
+ 全参考图像质量评价模块,包括峰值信噪比(PSNR),结构相似度(SSIM),直方图相似度(HistSim)。
48
+
49
+ #### scient.image.friqa.psnr(image1,image2,max_pix=255)
50
+
51
+ Parameters
52
+ ----------
53
+ image1 : numpy.array 2D or 3D,参考图像
54
+
55
+ image2 : numpy.array 2D or 3D,待评价图像
56
+
57
+ max_pix : int, optional default is 255, 像素值的最大值,默认值是255.
58
+
59
+ Returns
60
+ -------
61
+ float
62
+
63
+ Algorithms
64
+ -------
65
+ PSNR(Peak Signal to Noise Ratio),峰值信噪比,是一种评价图像的客观标准,单位dB。图像在经过压缩之后,会在某种程度与原始图像不同,PSNR值用来衡量经过处理后的图像品质是否令人满意。
66
+
67
+ $$
68
+ PSNR=10 \cdot \log _ {10} ( \frac { MAX _ I ^ 2 } { MSE }) = 20 \cdot \log _ {10} ( \frac { MAX _ I } { MSE })
69
+ $$
70
+
71
+ 其中,$MAX _ I$是图像像素值的最大值,一般每个采样点用8位表示,那么$MAX _ I$就是255。
72
+
73
+ $MSE$是待评价图像与参考图像的均方误差,$MSE$越小,PSNR越大;PSNR越大,待评价图像质量越好。
74
+
75
+ * PSNR高于40dB说明待评价图像质量极好,非常接近原始图像;
76
+ * PSNR在30—40dB说明待评价图像质量是较好,虽然有明显失真但可以接受;
77
+ * PSNR在20—30dB说明待评价图像质量差;
78
+ * PSNR低于20dB说明待评价图像质量不可接受。
79
+
80
+
81
+ PSNR缺点:基于对应像素点间的误差,即基于误差敏感的图像质量评价。由于并未考虑到人眼的视觉特性(人眼对空间频率较低的对比差异敏感度较高,人眼对亮度对比差异的敏感度较色度高,人眼对一个 区域的感知结果会受到其周围邻近区域的影响等),因而经常出现评价结果与人的主观感觉不一致的情况。
82
+
83
+ Examples
84
+ -------
85
+
86
+ ```
87
+ import os
88
+ from scient.image import friqa
89
+ import numpy
90
+ from PIL import Image
91
+
92
+ ref_image='test/data/I10.BMP'
93
+ images=['test/data/I10.BMP','test/data/i10_23_3.bmp','test/data/i10_23_4.bmp','test/data/i10_23_5.bmp','test/data/i10_24_5.bmp']
94
+
95
+ #读取图像文件
96
+ ref_image=Image.open(os.path.join(os.path.dirname(friqa.__file__),'..',ref_image))
97
+ images=[Image.open(os.path.join(os.path.dirname(friqa.__file__),'..',i)) for i in images]
98
+
99
+ #计算psnr
100
+ for i in images:
101
+ print(friqa.psnr(numpy.array(ref_image),numpy.array(i)))
102
+ ```
103
+
104
+ 运行结果
105
+
106
+ ```
107
+ 100
108
+ 32.436263852012544
109
+ 31.184291262813648
110
+ 30.272831107297733
111
+ 29.3584810257951
112
+ ```
113
+
114
+
115
+ #### scient.image.friqa.ssim(image1,image2,k1=0.01,k2=0.03,block_size=(8, 8),max_pix=255)
116
+
117
+ Parameters
118
+ ----------
119
+ image1 : numpy.array 2D
120
+
121
+ image2 : numpy.array 2D
122
+
123
+ k1 : float, optional,k1<<1,避免分母为0造成不稳定. The default is 0.01.
124
+
125
+ k2 : float, optional,k2<<1,避免分母为0造成不稳定. The default is 0.03.
126
+
127
+ block_size : tuple, optional,将图像分成多个block,采用gaussian加权计算所有block的均值、方差、协方差,进而计算所有block的ssim,最后的ssim取所有block的平均值. The default is (8,8).
128
+
129
+ max_pix : int, optional default is 255, 像素值的最大值,默认值是255.
130
+
131
+ Returns
132
+ -------
133
+ float
134
+
135
+ Algorithms
136
+ -------
137
+
138
+ SSIM(Structural Similarity),结构相似度,用于衡量两个图像相似程度,或检测图像的失真程度。
139
+ SSIM基于样本之间的亮度(luminance,像素平均值)、对比度(contrast,像素标准差)和结构(structure,像素减均值除以标准差)计算。
140
+
141
+ $$
142
+ SSIM(x,y)=f(l(x,y),c(x,y),s(x,y))
143
+ $$
144
+
145
+ $l(x,y)$为亮度对比函数,是关于图像的平均灰度$μ_x,μ_y$的函数;
146
+
147
+ $$
148
+ l(x,y)=\frac { 2μ_x μ_y + C1 } { μ_x^2 μ_y^2 + C1 } \\
149
+ μ_x=\frac { 1 } { N } \sum^{N}_{i=1}{x_i} \\
150
+ C1=(K_1 L)^2
151
+ $$
152
+
153
+ 像素值的最大值,默认值是255. K1<<1。
154
+
155
+ $c(x,y)$为对比度对比函数,是关于图像的标准差$σ_x,σ_y$的函数;
156
+
157
+ $$
158
+ c(x,y)=\frac { 2σ_x σ_y + C2 } { σ_x^2 σ_y^2 + C2 } \\
159
+ σ_x=(\frac { 1 } { N-1 } \sum^{N}_{i=1}{(x_i-μ_x)^2})^{\frac { 1 } { 2 }} \\
160
+ C2=(K_2 L)^2
161
+ $$
162
+
163
+ K2<<1
164
+
165
+ $s(x,y)$为结构对比函数,是关于图像的标准化$\frac { x-μ_x } { σ_x },\frac { y-μ_y } { σ_y }$的函数;
166
+
167
+ $$
168
+ s(x,y)=\frac { σ_{xy} + C3 } { σ_x σ_y + C3 } \\
169
+ σ_{xy}=\frac { 1 } { N-1 } (\sum^{N}_{i=1}{(x_i-μ_x)(y_i-μ_y)}) \\
170
+ $$
171
+
172
+ $$
173
+ SSIM(x,y)=[l(x,y)]^α[c(x,y)]^β[s(x,y)]^γ
174
+ $$
175
+
176
+ α,β,γ取1,令$C_3=\frac { C_2 } { 2 }$,可将SSIM简化为:
177
+
178
+ $$
179
+ SSIM(x,y)=\frac { (2μ_x μ_y + C1)(2σ_{xy} + C2) } { (μ_x^2 μ_y^2 + C1)(σ_x^2 σ_y^2 + C2) }
180
+ $$
181
+
182
+ SSIM取值范围为[0,1],值越大表示图像质量越好。
183
+ SSIM具有:对称性,ssim(x,y)==ssim(y,x);
184
+ 有界性,ssim(x,y)<=1;
185
+ 最大值唯一性,当且仅当x==y时,ssim(x,y)==1。
186
+ SSIM缺点:对于图像出现位移、缩放、旋转(皆属于非结构性的失真)的情况无法有效的判断。
187
+
188
+ Examples
189
+ -------
190
+
191
+ ```
192
+ import os
193
+ from scient.image import friqa
194
+ import numpy
195
+ from PIL import Image
196
+
197
+ ref_image='test/data/I10.BMP'
198
+ images=['test/data/I10.BMP','test/data/i10_23_3.bmp','test/data/i10_23_4.bmp','test/data/i10_23_5.bmp','test/data/i10_24_5.bmp']
199
+
200
+ #读取图像文件
201
+ ref_image=Image.open(os.path.join(os.path.dirname(friqa.__file__),'..',ref_image))
202
+ images=[Image.open(os.path.join(os.path.dirname(friqa.__file__),'..',i)) for i in images]
203
+
204
+ #计算ssim
205
+ for i in images:
206
+ print(friqa.ssim(numpy.array(ref_image.convert("L")),numpy.array(i.convert("L"))))
207
+ ```
208
+
209
+ 运行结果
210
+
211
+ ```
212
+ 1.0
213
+ 0.8568124416229375
214
+ 0.6810351495300123
215
+ 0.5575398637742431
216
+ 0.5072153083460104
217
+ ```
218
+
219
+ ### scient.image.feature
220
+
221
+ 图像特征提取模块,包括BRISQUE,基于累积概率的锐化因子(CPB),曝光度。
222
+
223
+ #### scient.image.feature.brisque(image)
224
+
225
+ Parameters
226
+ ----------
227
+ image : numpy.array 2D
228
+
229
+ Returns
230
+ -------
231
+ tuple
232
+ ('gdd_α','gdd_σ',
233
+ 'aggd_α1','aggd_η1','aggd_σl1','aggd_σr1',
234
+ 'aggd_α2','aggd_η2','aggd_σl2','aggd_σr2',
235
+ 'aggd_α3','aggd_η3','aggd_σl3','aggd_σr3',
236
+ 'aggd_α4','aggd_η4','aggd_σl4','aggd_σr4')
237
+
238
+ Algorithms
239
+ -------
240
+ BRISQUE(Blind/Referenceless Image Spatial QUality Evaluator),是一种无参考的空间域图像质量评估算法。先计算Mean Subtracted Contrast Normalized Coefficients(MSCN系数),MSCN系数反映了由于失真的存在而改变的特征统计,可以用来作为图像失真的统计特征。再用MSCN系数估计Generalized Gaussian Distribution(GDD)的参数α、σ,以及Asymmetric Generalized Gaussian Distribution(AGGD)在Horizontal Neighbour, Vertical Neighbour, On Diagonal Neighbour, Off Diagonal Neighbour上的参数α、η、σl、σr,将GDD的两个参数和AGGD的16个参数作为输出的特征。
241
+
242
+ MSCN系数:
243
+
244
+ $$
245
+ MSCN(i,j)=\frac { I(i,j)-μ(i,j) } { σ(i,j)+C } \\
246
+ μ(i,j)=\sum^{K}_{k=-K}{\sum^{L}_{l=-L}{w_{k,l}I_{k,l}(i,j)}} \\
247
+ σ(i,j)=\sqrt{\sum^{K}_{k=-K}{\sum^{L}_{l=-L}{w_{k,l}(I_{k,l}(i,j)-μ(i,j))^2}}}
248
+ $$
249
+
250
+ 其中$I(i,j)$表示原始图像i行j列元素的值。
251
+
252
+ Generalized Gaussian Distribution:
253
+
254
+ $$
255
+ f(x;α,σ^2)=\frac {α} {2βΓ(1/α)} e^{-(\frac {|x|}{β})^α} \\
256
+ β=σ\sqrt{\frac{Γ(1/α)}{Γ(3/α)}} \\
257
+ Γ(α)=\int^{\infty}_{0}{t^{α-1}e^{-t}dt} α>0
258
+ $$
259
+
260
+ Neighbours:
261
+
262
+ $$
263
+ HorizontalNeighbour(i,j)=MSCN(i,j)MSCN(i,j+1) \\
264
+ VerticalNeighbour(i,j)=MSCN(i,j)MSCN(i+1,j) \\
265
+ OnDiagonalNeighbour(i,j)=MSCN(i,j)MSCN(i+1,j+1) \\
266
+ OffDiagonalNeighbour(i,j)=MSCN(i,j)MSCN(i+1,j-1)
267
+ $$
268
+
269
+ Asymmetric Generalized Gaussian Distribution:
270
+
271
+ $$
272
+ f(x;α,σ_l^2,σ_r^2)=
273
+ \frac {α}{(β_l+β_r)Γ(1/α)}e^{-(\frac {-x}{β_l})^α} x<0
274
+ \frac {α}{(β_l+β_r)Γ(1/α)}e^{-(\frac {x}{β_r})^α} x>=0
275
+ β_l=σ_l\sqrt{\frac{Γ(1/α)}{Γ(3/α)}} \\
276
+ β_r=σ_r\sqrt{\frac{Γ(1/α)}{Γ(3/α)}}
277
+ $$
278
+
279
+ Examples
280
+ -------
281
+
282
+ ```
283
+ import os
284
+ from scient.image import feature
285
+ import numpy
286
+ from PIL import Image
287
+
288
+ images=['test/data/I10.BMP','test/data/i10_23_3.bmp','test/data/i10_23_4.bmp','test/data/i10_23_5.bmp','test/data/i10_24_5.bmp']
289
+
290
+ #读取图像文件
291
+ images=[Image.open(os.path.join(os.path.dirname(feature.__file__),'..',i)) for i in images]
292
+
293
+ #计算brisque
294
+ brisques=[]
295
+ for i in images:
296
+ brisques.append(feature.brisque(numpy.array(i.convert('L'))))
297
+ print(brisques)
298
+ ```
299
+
300
+ 运行结果
301
+
302
+ ```
303
+ [(2.8390000000000026, 0.5387382509471336, 0.8180000000000005, 0.1597336483186561, 0.19928197982139934, 0.4696747920784309, 0.8640000000000005, 0.17081167501931036, 0.1703080506100513, 0.440894038756712, 0.8610000000000007, -0.002437981115828319, 0.2983089768677447, 0.2943996123553127, 0.8670000000000007, 0.03657370089459203, 0.2641503963750437, 0.32229688865209727), (2.179000000000002, 0.3755805588864052, 0.6610000000000005, 0.2105638785869636, 0.06573065885425396, 0.3546433105372317, 0.7250000000000005, 0.2035633011201771, 0.04895566298941261, 0.2895746994148656, 0.7110000000000005, 0.09196294223642214, 0.10660221933416321, 0.22150476223116147, 0.7220000000000004, 0.10061626044729756, 0.09951649928883519, 0.22307536755643081), (1.489000000000001, 0.19567592119387475, 0.4370000000000002, 0.16656579278574843, 0.005144811587270607, 0.1595102390164801, 0.4400000000000002, 0.14819323960693676, 0.007946536338563829, 0.14400949152877282, 0.46900000000000025, 0.1304195444573072, 0.010840852166168865, 0.12285748598680354, 0.47300000000000025, 0.12785146234621667, 0.011051488263507676, 0.11939877242752284), (1.2570000000000008, 0.1189807661854071, 0.2940000000000001, 0.09858069094224381, 0.0033503171775502846, 0.1003980673321924, 0.2960000000000001, 0.09662228540309649, 0.0037953392707882772, 0.09854664422093222, 0.3160000000000001, 0.08840261656054116, 0.004225987220008733, 0.08029184471742051, 0.3180000000000001, 0.08631426420092875, 0.004399447310061135, 0.07751730107145516), (1.203000000000001, 0.14103130545847511, 0.3270000000000001, 0.10623288442963101, 0.008919473174326557, 0.12226537626029133, 0.3280000000000001, 0.06853644417080812, 0.02378947796849877, 0.10143999168472712, 0.33900000000000013, 0.05689116726400874, 0.02385946076111514, 0.08256978072093775, 0.33900000000000013, 0.05450324427873719, 0.02492368706293601, 0.0813272014967197)]
304
+ ```
scient-0.3.0/README.md ADDED
@@ -0,0 +1,290 @@
1
+ # scient
2
+
3
+ **scient**一个用python实现科学计算相关算法的包,包括自然语言、图像、神经网络、优化算法、机器学习、图计算等模块。
4
+
5
+ **scient**源码和编译安装包可以在`Python package index`获取。
6
+
7
+ The source code and binary installers for the latest released version are available at the [Python package index].
8
+
9
+ [https://pypi.org/project/scient](https://pypi.org/project/scient)
10
+
11
+ 可以用`pip`安装`scient`。
12
+
13
+ You can install `scient` like this:
14
+
15
+ ```
16
+ pip install scient
17
+ ```
18
+
19
+ 也可以用`setup.py`安装。
20
+
21
+ Or in the `scient` directory, execute:
22
+
23
+ ```
24
+ python setup.py install
25
+ ```
26
+
27
+ ## scient.image
28
+
29
+ 图像相关算法模块,包括边缘检测、图像相似度计算、图像质量评价、图像特征提取等。
30
+
31
+ ### scient.image.friqa
32
+
33
+ 全参考图像质量评价模块,包括峰值信噪比(PSNR),结构相似度(SSIM),直方图相似度(HistSim)。
34
+
35
+ #### scient.image.friqa.psnr(image1,image2,max_pix=255)
36
+
37
+ Parameters
38
+ ----------
39
+ image1 : numpy.array 2D or 3D,参考图像
40
+
41
+ image2 : numpy.array 2D or 3D,待评价图像
42
+
43
+ max_pix : int, optional default is 255, 像素值的最大值,默认值是255.
44
+
45
+ Returns
46
+ -------
47
+ float
48
+
49
+ Algorithms
50
+ -------
51
+ PSNR(Peak Signal to Noise Ratio),峰值信噪比,是一种评价图像的客观标准,单位dB。图像在经过压缩之后,会在某种程度与原始图像不同,PSNR值用来衡量经过处理后的图像品质是否令人满意。
52
+
53
+ $$
54
+ PSNR=10 \cdot \log _ {10} ( \frac { MAX _ I ^ 2 } { MSE }) = 20 \cdot \log _ {10} ( \frac { MAX _ I } { MSE })
55
+ $$
56
+
57
+ 其中,$MAX _ I$是图像像素值的最大值,一般每个采样点用8位表示,那么$MAX _ I$就是255。
58
+
59
+ $MSE$是待评价图像与参考图像的均方误差,$MSE$越小,PSNR越大;PSNR越大,待评价图像质量越好。
60
+
61
+ * PSNR高于40dB说明待评价图像质量极好,非常接近原始图像;
62
+ * PSNR在30—40dB说明待评价图像质量是较好,虽然有明显失真但可以接受;
63
+ * PSNR在20—30dB说明待评价图像质量差;
64
+ * PSNR低于20dB说明待评价图像质量不可接受。
65
+
66
+
67
+ PSNR缺点:基于对应像素点间的误差,即基于误差敏感的图像质量评价。由于并未考虑到人眼的视觉特性(人眼对空间频率较低的对比差异敏感度较高,人眼对亮度对比差异的敏感度较色度高,人眼对一个 区域的感知结果会受到其周围邻近区域的影响等),因而经常出现评价结果与人的主观感觉不一致的情况。
68
+
69
+ Examples
70
+ -------
71
+
72
+ ```
73
+ import os
74
+ from scient.image import friqa
75
+ import numpy
76
+ from PIL import Image
77
+
78
+ ref_image='test/data/I10.BMP'
79
+ images=['test/data/I10.BMP','test/data/i10_23_3.bmp','test/data/i10_23_4.bmp','test/data/i10_23_5.bmp','test/data/i10_24_5.bmp']
80
+
81
+ #读取图像文件
82
+ ref_image=Image.open(os.path.join(os.path.dirname(friqa.__file__),'..',ref_image))
83
+ images=[Image.open(os.path.join(os.path.dirname(friqa.__file__),'..',i)) for i in images]
84
+
85
+ #计算psnr
86
+ for i in images:
87
+ print(friqa.psnr(numpy.array(ref_image),numpy.array(i)))
88
+ ```
89
+
90
+ 运行结果
91
+
92
+ ```
93
+ 100
94
+ 32.436263852012544
95
+ 31.184291262813648
96
+ 30.272831107297733
97
+ 29.3584810257951
98
+ ```
99
+
100
+
101
+ #### scient.image.friqa.ssim(image1,image2,k1=0.01,k2=0.03,block_size=(8, 8),max_pix=255)
102
+
103
+ Parameters
104
+ ----------
105
+ image1 : numpy.array 2D
106
+
107
+ image2 : numpy.array 2D
108
+
109
+ k1 : float, optional,k1<<1,避免分母为0造成不稳定. The default is 0.01.
110
+
111
+ k2 : float, optional,k2<<1,避免分母为0造成不稳定. The default is 0.03.
112
+
113
+ block_size : tuple, optional,将图像分成多个block,采用gaussian加权计算所有block的均值、方差、协方差,进而计算所有block的ssim,最后的ssim取所有block的平均值. The default is (8,8).
114
+
115
+ max_pix : int, optional default is 255, 像素值的最大值,默认值是255.
116
+
117
+ Returns
118
+ -------
119
+ float
120
+
121
+ Algorithms
122
+ -------
123
+
124
+ SSIM(Structural Similarity),结构相似度,用于衡量两个图像相似程度,或检测图像的失真程度。
125
+ SSIM基于样本之间的亮度(luminance,像素平均值)、对比度(contrast,像素标准差)和结构(structure,像素减均值除以标准差)计算。
126
+
127
+ $$
128
+ SSIM(x,y)=f(l(x,y),c(x,y),s(x,y))
129
+ $$
130
+
131
+ $l(x,y)$为亮度对比函数,是关于图像的平均灰度$μ_x,μ_y$的函数;
132
+
133
+ $$
134
+ l(x,y)=\frac { 2μ_x μ_y + C1 } { μ_x^2 μ_y^2 + C1 } \\
135
+ μ_x=\frac { 1 } { N } \sum^{N}_{i=1}{x_i} \\
136
+ C1=(K_1 L)^2
137
+ $$
138
+
139
+ 像素值的最大值,默认值是255. K1<<1。
140
+
141
+ $c(x,y)$为对比度对比函数,是关于图像的标准差$σ_x,σ_y$的函数;
142
+
143
+ $$
144
+ c(x,y)=\frac { 2σ_x σ_y + C2 } { σ_x^2 σ_y^2 + C2 } \\
145
+ σ_x=(\frac { 1 } { N-1 } \sum^{N}_{i=1}{(x_i-μ_x)^2})^{\frac { 1 } { 2 }} \\
146
+ C2=(K_2 L)^2
147
+ $$
148
+
149
+ K2<<1
150
+
151
+ $s(x,y)$为结构对比函数,是关于图像的标准化$\frac { x-μ_x } { σ_x },\frac { y-μ_y } { σ_y }$的函数;
152
+
153
+ $$
154
+ s(x,y)=\frac { σ_{xy} + C3 } { σ_x σ_y + C3 } \\
155
+ σ_{xy}=\frac { 1 } { N-1 } (\sum^{N}_{i=1}{(x_i-μ_x)(y_i-μ_y)}) \\
156
+ $$
157
+
158
+ $$
159
+ SSIM(x,y)=[l(x,y)]^α[c(x,y)]^β[s(x,y)]^γ
160
+ $$
161
+
162
+ α,β,γ取1,令$C_3=\frac { C_2 } { 2 }$,可将SSIM简化为:
163
+
164
+ $$
165
+ SSIM(x,y)=\frac { (2μ_x μ_y + C1)(2σ_{xy} + C2) } { (μ_x^2 μ_y^2 + C1)(σ_x^2 σ_y^2 + C2) }
166
+ $$
167
+
168
+ SSIM取值范围为[0,1],值越大表示图像质量越好。
169
+ SSIM具有:对称性,ssim(x,y)==ssim(y,x);
170
+ 有界性,ssim(x,y)<=1;
171
+ 最大值唯一性,当且仅当x==y时,ssim(x,y)==1。
172
+ SSIM缺点:对于图像出现位移、缩放、旋转(皆属于非结构性的失真)的情况无法有效的判断。
173
+
174
+ Examples
175
+ -------
176
+
177
+ ```
178
+ import os
179
+ from scient.image import friqa
180
+ import numpy
181
+ from PIL import Image
182
+
183
+ ref_image='test/data/I10.BMP'
184
+ images=['test/data/I10.BMP','test/data/i10_23_3.bmp','test/data/i10_23_4.bmp','test/data/i10_23_5.bmp','test/data/i10_24_5.bmp']
185
+
186
+ #读取图像文件
187
+ ref_image=Image.open(os.path.join(os.path.dirname(friqa.__file__),'..',ref_image))
188
+ images=[Image.open(os.path.join(os.path.dirname(friqa.__file__),'..',i)) for i in images]
189
+
190
+ #计算ssim
191
+ for i in images:
192
+ print(friqa.ssim(numpy.array(ref_image.convert("L")),numpy.array(i.convert("L"))))
193
+ ```
194
+
195
+ 运行结果
196
+
197
+ ```
198
+ 1.0
199
+ 0.8568124416229375
200
+ 0.6810351495300123
201
+ 0.5575398637742431
202
+ 0.5072153083460104
203
+ ```
204
+
205
+ ### scient.image.feature
206
+
207
+ 图像特征提取模块,包括BRISQUE,基于累积概率的锐化因子(CPB),曝光度。
208
+
209
+ #### scient.image.feature.brisque(image)
210
+
211
+ Parameters
212
+ ----------
213
+ image : numpy.array 2D
214
+
215
+ Returns
216
+ -------
217
+ tuple
218
+ ('gdd_α','gdd_σ',
219
+ 'aggd_α1','aggd_η1','aggd_σl1','aggd_σr1',
220
+ 'aggd_α2','aggd_η2','aggd_σl2','aggd_σr2',
221
+ 'aggd_α3','aggd_η3','aggd_σl3','aggd_σr3',
222
+ 'aggd_α4','aggd_η4','aggd_σl4','aggd_σr4')
223
+
224
+ Algorithms
225
+ -------
226
+ BRISQUE(Blind/Referenceless Image Spatial QUality Evaluator),是一种无参考的空间域图像质量评估算法。先计算Mean Subtracted Contrast Normalized Coefficients(MSCN系数),MSCN系数反映了由于失真的存在而改变的特征统计,可以用来作为图像失真的统计特征。再用MSCN系数估计Generalized Gaussian Distribution(GDD)的参数α、σ,以及Asymmetric Generalized Gaussian Distribution(AGGD)在Horizontal Neighbour, Vertical Neighbour, On Diagonal Neighbour, Off Diagonal Neighbour上的参数α、η、σl、σr,将GDD的两个参数和AGGD的16个参数作为输出的特征。
227
+
228
+ MSCN系数:
229
+
230
+ $$
231
+ MSCN(i,j)=\frac { I(i,j)-μ(i,j) } { σ(i,j)+C } \\
232
+ μ(i,j)=\sum^{K}_{k=-K}{\sum^{L}_{l=-L}{w_{k,l}I_{k,l}(i,j)}} \\
233
+ σ(i,j)=\sqrt{\sum^{K}_{k=-K}{\sum^{L}_{l=-L}{w_{k,l}(I_{k,l}(i,j)-μ(i,j))^2}}}
234
+ $$
235
+
236
+ 其中$I(i,j)$表示原始图像i行j列元素的值。
237
+
238
+ Generalized Gaussian Distribution:
239
+
240
+ $$
241
+ f(x;α,σ^2)=\frac {α} {2βΓ(1/α)} e^{-(\frac {|x|}{β})^α} \\
242
+ β=σ\sqrt{\frac{Γ(1/α)}{Γ(3/α)}} \\
243
+ Γ(α)=\int^{\infty}_{0}{t^{α-1}e^{-t}dt} α>0
244
+ $$
245
+
246
+ Neighbours:
247
+
248
+ $$
249
+ HorizontalNeighbour(i,j)=MSCN(i,j)MSCN(i,j+1) \\
250
+ VerticalNeighbour(i,j)=MSCN(i,j)MSCN(i+1,j) \\
251
+ OnDiagonalNeighbour(i,j)=MSCN(i,j)MSCN(i+1,j+1) \\
252
+ OffDiagonalNeighbour(i,j)=MSCN(i,j)MSCN(i+1,j-1)
253
+ $$
254
+
255
+ Asymmetric Generalized Gaussian Distribution:
256
+
257
+ $$
258
+ f(x;α,σ_l^2,σ_r^2)=
259
+ \frac {α}{(β_l+β_r)Γ(1/α)}e^{-(\frac {-x}{β_l})^α} x<0
260
+ \frac {α}{(β_l+β_r)Γ(1/α)}e^{-(\frac {x}{β_r})^α} x>=0
261
+ β_l=σ_l\sqrt{\frac{Γ(1/α)}{Γ(3/α)}} \\
262
+ β_r=σ_r\sqrt{\frac{Γ(1/α)}{Γ(3/α)}}
263
+ $$
264
+
265
+ Examples
266
+ -------
267
+
268
+ ```
269
+ import os
270
+ from scient.image import feature
271
+ import numpy
272
+ from PIL import Image
273
+
274
+ images=['test/data/I10.BMP','test/data/i10_23_3.bmp','test/data/i10_23_4.bmp','test/data/i10_23_5.bmp','test/data/i10_24_5.bmp']
275
+
276
+ #读取图像文件
277
+ images=[Image.open(os.path.join(os.path.dirname(feature.__file__),'..',i)) for i in images]
278
+
279
+ #计算brisque
280
+ brisques=[]
281
+ for i in images:
282
+ brisques.append(feature.brisque(numpy.array(i.convert('L'))))
283
+ print(brisques)
284
+ ```
285
+
286
+ 运行结果
287
+
288
+ ```
289
+ [(2.8390000000000026, 0.5387382509471336, 0.8180000000000005, 0.1597336483186561, 0.19928197982139934, 0.4696747920784309, 0.8640000000000005, 0.17081167501931036, 0.1703080506100513, 0.440894038756712, 0.8610000000000007, -0.002437981115828319, 0.2983089768677447, 0.2943996123553127, 0.8670000000000007, 0.03657370089459203, 0.2641503963750437, 0.32229688865209727), (2.179000000000002, 0.3755805588864052, 0.6610000000000005, 0.2105638785869636, 0.06573065885425396, 0.3546433105372317, 0.7250000000000005, 0.2035633011201771, 0.04895566298941261, 0.2895746994148656, 0.7110000000000005, 0.09196294223642214, 0.10660221933416321, 0.22150476223116147, 0.7220000000000004, 0.10061626044729756, 0.09951649928883519, 0.22307536755643081), (1.489000000000001, 0.19567592119387475, 0.4370000000000002, 0.16656579278574843, 0.005144811587270607, 0.1595102390164801, 0.4400000000000002, 0.14819323960693676, 0.007946536338563829, 0.14400949152877282, 0.46900000000000025, 0.1304195444573072, 0.010840852166168865, 0.12285748598680354, 0.47300000000000025, 0.12785146234621667, 0.011051488263507676, 0.11939877242752284), (1.2570000000000008, 0.1189807661854071, 0.2940000000000001, 0.09858069094224381, 0.0033503171775502846, 0.1003980673321924, 0.2960000000000001, 0.09662228540309649, 0.0037953392707882772, 0.09854664422093222, 0.3160000000000001, 0.08840261656054116, 0.004225987220008733, 0.08029184471742051, 0.3180000000000001, 0.08631426420092875, 0.004399447310061135, 0.07751730107145516), (1.203000000000001, 0.14103130545847511, 0.3270000000000001, 0.10623288442963101, 0.008919473174326557, 0.12226537626029133, 0.3280000000000001, 0.06853644417080812, 0.02378947796849877, 0.10143999168472712, 0.33900000000000013, 0.05689116726400874, 0.02385946076111514, 0.08256978072093775, 0.33900000000000013, 0.05450324427873719, 0.02492368706293601, 0.0813272014967197)]
290
+ ```
@@ -1964,7 +1964,6 @@ static const char __pyx_k_index[] = "index";
1964
1964
  static const char __pyx_k_numpy[] = "numpy";
1965
1965
  static const char __pyx_k_range[] = "range";
1966
1966
  static const char __pyx_k_import[] = "__import__";
1967
- static const char __pyx_k_return[] = "return";
1968
1967
  static const char __pyx_k_square[] = "square";
1969
1968
  static const char __pyx_k_max_pix[] = "max_pix";
1970
1969
  static const char __pyx_k_nanargmax[] = "nanargmax";
@@ -2035,7 +2034,6 @@ typedef struct {
2035
2034
  PyObject *__pyx_n_s_p1;
2036
2035
  PyObject *__pyx_n_s_p2;
2037
2036
  PyObject *__pyx_n_s_range;
2038
- PyObject *__pyx_n_s_return;
2039
2037
  PyObject *__pyx_n_s_scient_image_threshold;
2040
2038
  PyObject *__pyx_kp_s_scient_image_threshold_py;
2041
2039
  PyObject *__pyx_n_s_size;
@@ -2116,7 +2114,6 @@ static int __pyx_m_clear(PyObject *m) {
2116
2114
  Py_CLEAR(clear_module_state->__pyx_n_s_p1);
2117
2115
  Py_CLEAR(clear_module_state->__pyx_n_s_p2);
2118
2116
  Py_CLEAR(clear_module_state->__pyx_n_s_range);
2119
- Py_CLEAR(clear_module_state->__pyx_n_s_return);
2120
2117
  Py_CLEAR(clear_module_state->__pyx_n_s_scient_image_threshold);
2121
2118
  Py_CLEAR(clear_module_state->__pyx_kp_s_scient_image_threshold_py);
2122
2119
  Py_CLEAR(clear_module_state->__pyx_n_s_size);
@@ -2175,7 +2172,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2175
2172
  Py_VISIT(traverse_module_state->__pyx_n_s_p1);
2176
2173
  Py_VISIT(traverse_module_state->__pyx_n_s_p2);
2177
2174
  Py_VISIT(traverse_module_state->__pyx_n_s_range);
2178
- Py_VISIT(traverse_module_state->__pyx_n_s_return);
2179
2175
  Py_VISIT(traverse_module_state->__pyx_n_s_scient_image_threshold);
2180
2176
  Py_VISIT(traverse_module_state->__pyx_kp_s_scient_image_threshold_py);
2181
2177
  Py_VISIT(traverse_module_state->__pyx_n_s_size);
@@ -2244,7 +2240,6 @@ static int __pyx_m_traverse(PyObject *m, visitproc visit, void *arg) {
2244
2240
  #define __pyx_n_s_p1 __pyx_mstate_global->__pyx_n_s_p1
2245
2241
  #define __pyx_n_s_p2 __pyx_mstate_global->__pyx_n_s_p2
2246
2242
  #define __pyx_n_s_range __pyx_mstate_global->__pyx_n_s_range
2247
- #define __pyx_n_s_return __pyx_mstate_global->__pyx_n_s_return
2248
2243
  #define __pyx_n_s_scient_image_threshold __pyx_mstate_global->__pyx_n_s_scient_image_threshold
2249
2244
  #define __pyx_kp_s_scient_image_threshold_py __pyx_mstate_global->__pyx_kp_s_scient_image_threshold_py
2250
2245
  #define __pyx_n_s_size __pyx_mstate_global->__pyx_n_s_size
@@ -2715,8 +2710,7 @@ static PyObject *__pyx_pf_6scient_5image_9threshold_otsu(CYTHON_UNUSED PyObject
2715
2710
  __Pyx_GOTREF(__pyx_t_2);
2716
2711
  __Pyx_DECREF(__pyx_t_8); __pyx_t_8 = 0;
2717
2712
  }
2718
- if (!(likely(__Pyx_Py3Int_CheckExact(__pyx_t_2))||((__pyx_t_2) == Py_None) || __Pyx_RaiseUnexpectedTypeError("int", __pyx_t_2))) __PYX_ERR(0, 33, __pyx_L1_error)
2719
- __pyx_r = ((PyObject*)__pyx_t_2);
2713
+ __pyx_r = __pyx_t_2;
2720
2714
  __pyx_t_2 = 0;
2721
2715
  goto __pyx_L0;
2722
2716
 
@@ -2787,7 +2781,6 @@ static int __Pyx_CreateStringTabAndInitStrings(void) {
2787
2781
  {&__pyx_n_s_p1, __pyx_k_p1, sizeof(__pyx_k_p1), 0, 0, 1, 1},
2788
2782
  {&__pyx_n_s_p2, __pyx_k_p2, sizeof(__pyx_k_p2), 0, 0, 1, 1},
2789
2783
  {&__pyx_n_s_range, __pyx_k_range, sizeof(__pyx_k_range), 0, 0, 1, 1},
2790
- {&__pyx_n_s_return, __pyx_k_return, sizeof(__pyx_k_return), 0, 0, 1, 1},
2791
2784
  {&__pyx_n_s_scient_image_threshold, __pyx_k_scient_image_threshold, sizeof(__pyx_k_scient_image_threshold), 0, 0, 1, 1},
2792
2785
  {&__pyx_kp_s_scient_image_threshold_py, __pyx_k_scient_image_threshold_py, sizeof(__pyx_k_scient_image_threshold_py), 0, 0, 1, 0},
2793
2786
  {&__pyx_n_s_size, __pyx_k_size, sizeof(__pyx_k_size), 0, 0, 1, 1},
@@ -3193,11 +3186,10 @@ if (!__Pyx_RefNanny) {
3193
3186
  __Pyx_DECREF(__pyx_t_2); __pyx_t_2 = 0;
3194
3187
 
3195
3188
 
3196
- __pyx_t_2 = __Pyx_PyDict_NewPresized(3); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
3189
+ __pyx_t_2 = __Pyx_PyDict_NewPresized(2); if (unlikely(!__pyx_t_2)) __PYX_ERR(0, 9, __pyx_L1_error)
3197
3190
  __Pyx_GOTREF(__pyx_t_2);
3198
3191
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_array, __pyx_kp_s_numpy_array) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
3199
3192
  if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_max_pix, __pyx_n_s_int) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
3200
- if (PyDict_SetItem(__pyx_t_2, __pyx_n_s_return, __pyx_n_s_int) < 0) __PYX_ERR(0, 9, __pyx_L1_error)
3201
3193
  __pyx_t_3 = __Pyx_CyFunction_New(&__pyx_mdef_6scient_5image_9threshold_1otsu, 0, __pyx_n_s_otsu, NULL, __pyx_n_s_scient_image_threshold, __pyx_d, ((PyObject *)__pyx_codeobj__3)); if (unlikely(!__pyx_t_3)) __PYX_ERR(0, 9, __pyx_L1_error)
3202
3194
  __Pyx_GOTREF(__pyx_t_3);
3203
3195
  if (!__Pyx_CyFunction_InitDefaults(__pyx_t_3, sizeof(__pyx_defaults), 1)) __PYX_ERR(0, 9, __pyx_L1_error)
@@ -29,6 +29,6 @@ from .lstm import LSTM
29
29
  from .crf import CRF
30
30
  from .lstm_crf import LstmCrf
31
31
  #from . import dataset
32
- from .train import Trainer
32
+ # from .train import Trainer
33
33
  from .esim import ESIM
34
34
  #from .bert import Bert