目前分類:NetYea (13)

瀏覽方式: 標題列表 簡短摘要

為了將圖片數據轉換為合適 AI訓練的格局,哄騙 OpenCV先對面部進行辨識,然後將面部數據另存為同一的格式。

  1. import cv2
  2.  
  3. face_cascade = cv2.CascadeClassifier('./cascades/haarcascade_frontalface_default.xml')
  4. eye_cascade = cv2.CascadeClassifier('./cascades/haarcascade_eye.xml')
  5.  
  6. def detect(filename):
  7.     img = cv2.imread(filename)
  8.     gray = cv2.cvtColor(img, cv2.COLOR_BGR2GRAY)
  9.     faces = face_cascade.detectMultiScale(gray,
  10.                                           scaleFactor=1.2,
  11.                                           minNeighbors=3,)
  12.     for (x,y,w,h) in faces:
  13.         roi_gray = gray[y:y+h, x:x+w]
  14.         eyes = eye_cascade.detectMultiScale(roi_gray,
  15.                                             scaleFactor=1.02,
  16.                                             minNeighbors=3,
  17.                                             minSize=(40,40),)
  18.         img = cv2.rectangle(img,(x,y),(x+w,y+h),(255,0,0),2)
  19.         for (ex,ey,ew,eh) in eyes:
  20.             img = cv2.rectangle(img,(x+ex,y+ey),(x+ex+ew,y+ey+eh),(0,255,0),2)
  21.     cv2.imwrite('./tzuyu_face.jpg', img)
  22.  
  23. detect('tzuyu.jpg')
文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

有在利用Google Maps的人,多幾許少必然都有利用到Google地圖找附近景點餐廳。

 

文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

測試成果(夜神慢 雷電9)
文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

起首可以到FPDF網站下載程式,固然FPDF的網站有教授教養也值得前去旁觀http://www.fpdf.org/

或直接點選這邊下載fpdf16.zip

文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

1.png

展示網站


發現了個不錯的jQuery幻燈片插件flexslider,有接近3000 Star,應該說是很靠譜的,下面是簡單利用教程。

引入代碼

所有代碼都可以在flexlslider的Github上取得。

引入css 文件和js 文件和jQuery 焦點代碼:

文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

資料庫往往是有看沒有懂

圖解秒懂SQL說話水管清洗

水管清洗

1.png

文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

1.png


這兩天用CPanel 辦事器用transfer Tool對拷主機


發現有的網站居然顯示 內部毛病 ERROR 500





找了一下.htaccess檔案內多了

文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

記得筆者曾經寫過一篇「用 JavaScript 來做偽浮水印」,那時是用 JavaScript 來寫的,得顛末計算才能把版權宣佈的圖片放在右下角。目下當今筆者把全部效果用 jQuery 來改寫,並把原本要較量爭論的版權宣佈圖片位置換成 background-position 的體式格局來節制,如許想放那就只要設定一下就行了。

我們的 HTML 就是很純真的圖片罷了:

檢視原始碼 HTML

1.jpg

文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

實例需求:應用python語言爬取http://kaijiang.zhcw.com/zhcw/html/ssq/list_1.html這個開獎網站所有的信息,並且保存為txt文件和excel文件。
實例情況:python3.7
       BeautifulSoup庫、xlwt庫(需手動安裝)
       urllib庫、re庫(內置的python庫,無需手動安裝)
文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

水管清洗

從2020年5月入手下手
Google SEO增添了加強功能
從以下網址可知增添了那些功能
https://developers.google.com/search/docs/advanced/structured-data/search-gallery


SEO寫好今後,到下列網址測試是不是完成
https://search.google.com/test/rich-results?utm_campaign=devsite&utm_medium=jsonld&utm_source=article


測試網址
http://www.netyea.com/
1.png

點選預覽就可以看到下面圖片

2.png


網頁設計,網站架設 ,網路行銷,網頁優化,SEO - NetYea 網頁設計

文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

影片



TB6612FNG是東芝生產的馬達驅動與節制IC,內部包括兩組H橋式電路,可驅動和控制兩個小型直流馬達,或一個雙極性步進馬達。

水管清洗

1.jpg

文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

水管清洗

申明:在Linux下把excel數據導入到mysql數據庫中,這實在是很搞笑的一個勾當!幾近很少有法式員研究過這個問題吧?如此變態的問題,估計我是第一個研究的!呵呵,完滿是自找苦吃~~,可是今天完了這項太有挑戰性的工作!
先清理一下思緒先,~~
起首:需要把文件上傳到服務器上
然後:讀取excel數據列顯示出來
然後:讓用戶選擇字段的對應關係
然後:提交數據,讀取字段的對應關係
最後:批量導入數據,刪除臨時文件
一共是以上五步調!我們一步步剖析~~~
第一步:下載附件中的phpexcelparser4.rar ,這個文件是上傳excel盜辦事器上並以web情勢展示出來的!這個一般沒有問題的!問題是法式的做法是把表存為姑且表而沒有真正保存下來,所以起首要更改程序代碼為

 

  1.  
  2. //uc轉換成html
  3. function uc2html($str) {
  4.    $ret = '';
  5.    for( $i=0; $i<strlen($str)/2; $i++ ) {
  6.        $charcode = ord($str[$i*2])+256*ord($str[$i*2+1]);
  7.        // $ret .= '&#'.$charcode;
  8.        if($charcode<127)
  9.          $ret .=chr($charcode);
  10.        else
  11.            $ret .= iconv("utf-8","utf-8",u2utf8($charcode));
  12.    }
  13.        return $ret;
  14. }
  15. //html轉成utf8
  16. function u2utf8($c) {
  17. $str="";
  18. if ($c < 0x80) {
  19.   $str.=$c;
  20. } else if ($c < 0x800) {
  21.   $str.=chr(0xC0 | $c>>6);
  22.   $str.=chr(0x80 | $c & 0x3F);
  23. } else if ($c < 0x10000) {
  24.   $str.=chr(0xE0 | $c>>12);
  25.   $str.=chr(0x80 | $c>>6 & 0x3F);
  26.   $str.=chr(0x80 | $c & 0x3F);
  27. } else if ($c < 0x200000) {
  28.   $str.=chr(0xF0 | $c>>18);
  29.   $str.=chr(0x80 | $c>>12 & 0x3F);
  30.   $str.=chr(0x80 | $c>>6 & 0x3F);
  31.   $str.=chr(0x80 | $c & 0x3F);
  32. }
  33. return $str;
  34. }
  35.  
  36. if (trim($_POST["cmd"])=="upload")
  37. {
  38. $err_corr = "Unsupported format or file corrupted";
  39. $excel_file_size;
  40. $excel_file = $_FILES['excel_file'];
  41. $uploadservername=$UploadAbsPath."tmpexcel/".$_FILES['excel_file']['name'];
  42. echo($uploadservername);
  43.      if (!is_writeable($UploadAbsPath."tmpexcel/"))
  44.      {
  45.      echo "目次不行寫!"; exit;
  46.      }
  47.      else
  48.      {
  49.      echo "目次可寫!";
  50.      }
  51. if (move_uploaded_file($_FILES['excel_file']['tmp_name'], $uploadservername))
  52. {
  53.     echo("上傳成功");
  54. }
  55. else
  56. {
  57.     echo("上傳失敗");
  58. }
  59. $excel_file=$uploadservername;
  60. //if( $excel_file )
  61. //    $excel_file = $_FILES['excel_file']['tmp_name'];
  62.  
  63.  
  64. if( $excel_file == '' ) fatal("No file uploaded");
  65.  
  66.  
  67. $exc = new ExcelFileParser("debug.log", ABC_NO_LOG);//ABC_NO_LOG ABC_VAR_DUMP);
  68.     //echo($excel_file."|");
  69.    
  70. $style = $_POST['style'];
  71. if( $style == 'old' )
  72. {
  73.     $fh = @fopen ($excel_file,'rb');
  74.     if( !$fh ) fatal("No file uploaded");
  75.     if( filesize($excel_file)==0 ) fatal("No file uploaded");
  76.     $fc = fread( $fh, filesize($excel_file) );
  77.     @fclose($fh);
  78.     if( strlen($fc) < filesize($excel_file) )
  79.     fatal("Cannot read file");
  80.    
  81.     $time_start = getmicrotime();
  82.     $res = $exc->ParseFromString($fc);
  83.     $time_end = getmicrotime();
  84. }
  85. elseif( $style == 'segment' )
  86. {
  87.     $time_start = getmicrotime();
  88.     $res = $exc->ParseFromFile($excel_file);
  89.     $time_end = getmicrotime();
  90. }
  91.  
  92.  
  93. switch ($res) {
  94.     case 0: break;
  95.     case 1: fatal("Can't open file");
  96.     case 2: fatal("File too small to be an Excel file");
  97.     case 3: fatal("Error reading file header");
  98.     case 4: fatal("Error reading file");
  99.     case 5: fatal("This is not an Excel file or file stored in Excel < 5.0");
  100.     case 6: fatal("File corrupted");
  101.     case 7: fatal("No Excel data found in file");
  102.     case 8: fatal("Unsupported file version");
  103.  
  104.  
  105.     default:
  106.     fatal("Unknown error");
  107. }
  108.  
  109.  
  110. /*
  111. print '<pre>';
  112. print_r( $exc );
  113. print '</pre>';
  114. exit;
  115. */
  116.  
  117.  
  118. show_time();
  119.  
  120.  
  121. echo <<<LEG
  122. <b>Legend:</b><br><br>
  123. <form name='doform' action='' method='post'>
  124. <input type='hidden' name='action' value='do'>
  125. <input type='hidden' name='excel_file' value=$excel_file>
  126. <input type='hidden' name='style' value=$style>
  127. <table border=1 cellspacing=0 cellpadding=0>
  128. <tr><td>Data type</td><td>Description</td></tr>
  129. <tr><td class=empty>&nbsp;</td><td class=index>An empty cell</td></tr>
  130. <tr><td class=dt_string>ABCabc</td><td class=index>String</td></tr>
  131. <tr><td class=dt_int>12345</td><td class=index>Integer</td></tr>
  132. <tr><td class=dt_float>123.45</td><td class=index>Float</td></tr>
  133. <tr><td class=dt_date>123.45</td><td class=index>Date</td></tr>
  134. <table>
  135. <br><br>
  136.  
  137.  
  138. LEG;
  139. /*
  140. print "<pre>";
  141. print_r ($exc->worksheet);
  142. print_r($exc->sst);
  143. print "</pre>";
  144. */
  145.     for( $ws_num=0; $ws_num<count($exc->worksheet['name']); $ws_num++ )
  146.     {
  147.     print "<b>Worksheet: \"";
  148.     if( $exc->worksheet['unicode'][$ws_num] ) {
  149.     print uc2html($exc->worksheet['name'][$ws_num]);
  150.     } else
  151.     print $exc->worksheet['name'][$ws_num];
  152.  
  153.  
  154.     print "\"</b>";
  155.     $ws = $exc->worksheet['data'][$ws_num];
  156.  
  157.  
  158.     if( is_array($ws) &&
  159.          isset($ws['max_row']) && isset($ws['max_col']) ) {
  160.      echo "\n<br><br><table border=1 cellspacing=0 cellpadding=2>\n";
  161.  
  162.  
  163.      print "<tr><td>&nbsp;</td>\n";
  164.      for( $j=0; $j<=$ws['max_col']; $j++ ) {
  165.     print "<td class=index>&nbsp;";
  166.     if( $j>25 ) print chr((int)($j/26)+64);
  167.     //這裡要顯示一個下拉列表來顯示數據
  168.     //注意是輪回數據<br />
  169.     echo("\n<select name='".$j."'>");
  170.     echo("\n<option value='0'>不選擇</option>");
  171.    echo("\n<option value='costomernum'>客戶編號</option>");
  172.    echo("\n<option value='name'>客戶姓名</option>");
  173.    echo("\n<option value='phone1'>德律風1</option>");
  174.    echo("\n<option value='phone2'>德律風2</option>");
  175.    echo("\n<option value='address1'>地址1</option>");
  176.    echo("\n<option value='address2'>地址2</option>");  
  177.    echo("\n<option value='company'>公司</option>");
  178.    echo("\n<option value='levelc'>職稱</option>");   
  179.    echo("\n<option value='ps'>備註</option>");
  180.    
  181.     echo("</select>");
  182.     print "</td>";
  183.      }
  184.  
  185.  
  186.      print "<tr><td>&nbsp;</td>\n";
  187.      for( $j=0; $j<=$ws['max_col']; $j++ ) {
  188.     print "<td class=index>&nbsp;";
  189.     if( $j>25 ) print chr((int)($j/26)+64);
  190.     print chr(($j % 26) + 65)."&nbsp;列名</td>";
  191.      }
  192.  
  193.  
  194.  
  195. //表頭輸出終了
  196.     if ($ws['max_row']>9)
  197.     {
  198.     $shownum=9;
  199.     }
  200.     else
  201.     {
  202.     $shownum=$ws['max_row'];//只輸出前10條數據
  203.     }
  204.      for( $i=0; $i<=$shownum; $i++ ) {
  205.      print "<tr><td class=index>".($i+1)."</td>\n";
  206.      if(isset($ws['cell'][$i]) && is_array($ws['cell'][$i]) ) {
  207.          for( $j=0; $j<=$ws['max_col']; $j++ ) {
  208.  
  209.  
  210.     if( ( is_array($ws['cell'][$i]) ) &&
  211.          ( isset($ws['cell'][$i][$j]) )
  212.          ){
  213.  
  214.  
  215.      // print cell data
  216.      print "<td class=\"";
  217.      $data = $ws['cell'][$i][$j];
  218.  
  219.  
  220.      $font = $ws['cell'][$i][$j]['font'];
  221.      $style = " style ='".ExcelFont::ExcelToCSS($exc->fonts[$font])."'";
  222.  
  223.  
  224.          switch ($data['type']) {
  225.     // string
  226.     case 0:
  227.         print "dt_string\"".$style.">";
  228.         $ind = $data['data'];
  229.         if( $exc->sst['unicode'][$ind] ) {
  230.         $s = uc2html($exc->sst['data'][$ind]);
  231.         } else
  232.         $s = $exc->sst['data'][$ind];
  233.         if( strlen(trim($s))==0 )
  234.         print "&nbsp;";
  235.         else
  236.         print $s;
  237.         break;
  238.     // integer number
  239.     case 1:
  240.         print "dt_int\"".$style.">&nbsp;";
  241.         print $data['data'];
  242.         break;
  243.     // float number
  244.     case 2:
  245.         print "dt_float\"".$style.">&nbsp;";
  246.         echo $data['data'];
  247.         break;
  248.     // date
  249.     case 3:
  250.         print "dt_date\"".$style.">&nbsp;";
  251.  
  252.  
  253.         $ret = $data[data];//str_replace ( " 00:00:00", "", gmdate("d-m-Y H:i:s",$exc->xls2tstamp($data[data])) );
  254.         echo ( $ret );
  255.         break;
  256.     default:
  257.         print "dt_unknown\"".$style."> &nbsp;";
  258.         break;
  259.          }
  260.      print "</td>\n";
  261.     } else {
  262.         print "<td class=empty>&nbsp;</td>\n";
  263.     }
  264.          }
  265.      } else {
  266.     // print an empty row
  267.     for( $j=0; $j<=$ws['max_col']; $j++ )
  268.         print "<td class=empty>&nbsp;</td>";
  269.     print "\n";
  270.      }
  271.      print "</tr>\n";
  272.      }
  273.  
  274.  
  275.      echo "</table><br>\n";
  276.     } else {
  277.     // emtpty worksheet
  278.     print "<b> - empty</b><br>\n";
  279.     }
  280.     print "<br>";
  281.  
  282.  
  283.     }
  284.     echo("<input type='submit' name='Submit' value='轉換' />");
  285.     echo("</form>");
  286. /*    print "Formats<br>";
  287.     foreach($exc->format as $value) {
  288.     printf("( %x )",array_search($value,$exc->format));
  289.     print htmlentities($value,ENT_QUOTES);
  290.     print "<br>";
  291.     }
  292.  
  293.  
  294.      print "XFs<br>";
  295.     for( $i=0;$i<count($exc->xf['format']);$i++) {
  296.     printf ("(%x)",$i);
  297.     printf (" format (%x) font (%x)",$exc->xf['format'][$i],$exc->xf['font'][$i]);
  298.  
  299.  
  300.     print "<br>";
  301.     }
  302. */
  303. }
文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()

註冊、設置好狐狸錢包後,如文內新增BSC鏈一般新增Arbitrum鏈網路。

網路名稱
文章標籤

bertrav45c1 發表在 痞客邦 留言(0) 人氣()