บทความ

กำลังแสดงโพสต์จาก มกราคม, 2019

Python : Text to speak(Google)

step 1. py -m pip install gtts py -m pip install pyglet step 2. โหลด AVbin มาติดตั้ง http://avbin.github.io/AVbin/Download.html step 3 ลองรัน #code: #--------------------------------------------------------------------- from gtts import gTTS from time import sleep import os import pyglet   tts = gTTS(text='สวัสดีคุณผู้ชาย มีอะไรให้ออเจ้ารับใช้คะ', lang='th') #ต้องมีการสร้างโฟลเดอร์ tmp ไว้ใน drive C: ก่อน filename = 'C:\\tmp\\gtts.mp3' tts.save(filename) music = pyglet.media.load(filename, streaming=False) music.play() sleep(music.duration) #prevent from killing os.remove(filename) #remove temperory file #---------------------------------------------------------------------

Python: tensorflow + openCV to exe

ปัญหากับ windows 10 -64bit ต้อง upgrade matplotlib ให้เป็น version 3.0.2 ขั้นไป ด้วยคำสั่ง  py -m pip install -U matplotlib และ downgrade pandas ลงมาให้เป็น v 0.23.0 ด้วย  ไม่งั้นเกิด tf.estimator package not installed ref: https://github.com/tensorflow/tensorflow/issues/23007 ปัญหาถัดมาคือ tensorflow module not found แก้ด้วยการเปลี่ยนชื่อไฟล์ โดยการเติม  tensorflow.python. นำหน้าชื่อไฟล์เดิมคือ  _pywrap_tensorflow_internal.pyd ref: https://stackoverflow.com/questions/49732801/windows-10-pyinstaller-tensorflow-missing-modules/50580345 ----------

python : Levenshtein วัดความเหมือนของคำ

# install with: pip install python-Levenshtein from Levenshtein import distance edit_dist = distance ( "ชลิตา" , "ชาริตา" ) https://www.youtube.com/watch?v=b6AGUjqIPsA&fbclid=IwAR3B6Ihq9yk1S9eNXNoQF4IMRXhd-srbsSjsEdDcbEaBVRpsmsGvExHqAE0

MQTT : ใช้ผ่านหน้าเว็บด้วย Web Socket โดยใช้ mqttws.js

http://www.steves-internet-guide.com/using-javascript-mqtt-client-websockets/ ภาษาไทย เข้าใจง่าย https://ioxhop.github.io/ESPIOX2-Document/mqtt-on-adurino-ide.html Src ของไทย : https://www.dropbox.com/s/b2rromz9ijg9puh/mqtt_html.zip?dl=0