Preparation
ก่อนเราจะเริ่มใช้ Google Colab เพื่อการจัดการไฟล์ เราอยากให้ทุกท่านได้รับลิ้งค์ไฟล์เพื่อใช้งาน โดยเราแนบไฟล์ไว้ให้ 2 ไฟล์
1. Google Colab Notebook ตัววอย่าง Code เพื่อให้ท่านสามารถเอา Code ไปใช้งานได้เลยทันที
2. Example File เพื่อเป็นตัวอย่างไฟล์ให้ท่านสามารถใช้งานไฟล์ตัวอย่างเพื่อสั่งการด้วย Google Colab ได้
Google Colab Notebook
https://colab.research.google.com/drive/1Rkbtzz6bau4HwHJLhekFWFXIqx7raSYH?usp=sharing
File Download Source
Direct Link: https://storage.googleapis.com/piyaphanwebsite.appspot.com/Colab/download.zip
Google Drive Sharing: https://drive.google.com/file/d/1YMiJtNFE4t45_gnW7B_u_Y5sd89AiRCi/view?usp=sharing
Let us Start!
- Install Library
ก่อนที่เราจะเริ่มจัดการไฟล์ เราจำเป็นต้องติดตั้งเครื่องมือที่ใช้ในการจัดการไฟล์ ดังนี้ หากเราต้องการใช้งานกับระบบข้างนอก Google Colab ด้วย
#wget use for download file from URL
#gdown use for download file from Google Drive shared file and URL
#Shutil use for file management
#split-folders use for split train/test folde
!pip install wget
!pip install gdown
!pip install pytest-shutil
!pip install split-folders
- Import Library
เพื่อให้ใช้งานเครื่องมือที่ติดตั้งได้ ทุกครั้งที่เราเปิดเครื่องใช้งาน หลัง Install เรียบร้อยแล้วเราจำเป็นต้องใช้คำสั่ง Import เพื่อเรียก Library มาใช้งาน
import wget
import gdown
import shutil
import splitfolders
from distutils.dir_util import copy_tree
Recent Comments