autobotasia / autoface

Face Recognition Using
MIT License
0 stars 1 forks source link

Research Colab #28

Open khanh339 opened 4 years ago

thaithien001 commented 4 years ago

*Link colab via Google Drive: !apt-get install -y -qq software-properties-common python-software-properties module-init-tools !add-apt-repository -y ppa:alessandro-strada/ppa 2>&1 > /dev/null !apt-get update -qq 2>&1 > /dev/null !apt-get -y install -qq google-drive-ocamlfuse fuse from google.colab import auth auth.authenticate_user() from oauth2client.client import GoogleCredentials creds = GoogleCredentials.get_application_default() import getpass !google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret} < /dev/null 2>&1 | grep URL vcode = getpass.getpass() !echo {vcode} | google-drive-ocamlfuse -headless -id={creds.client_id} -secret={creds.client_secret}

**Tạo thư mục ảo !mkdir -p drive !google-drive-ocamlfuse drive

***Chạy python3 !python3 đường dẫn/.../file.py

thaithien001 commented 4 years ago

Phải chọn đến thư mục cần chạy để thêm datasets

thaithien001 commented 4 years ago

*export import os os.environ['PYTHONPATH'] += ":/content/drive/Colab Notebooks/network/models/insightface/deploy/"

thaithien001 commented 4 years ago

pip install mxnet-cu100

thaithien001 commented 4 years ago

autoface.py fix bug: pip install tensorflow==1.13.1 chuyển đổi float 64 về float32: inputs = tf.cast(inputs,dtype = tf.float32)

thaithien001 commented 4 years ago

Facenet: 1 số thư viện cần đưa về để chạy cái file: pip install scipy==1.1.0 pip install tensorflow==1.7 pip install numpy==1.16.2

Code chạy align: !python ./align/align_dataset_mtcnn.py \ ./datasets/test2/ \ #Đường dẫn file ảnh datasets ./datasets/test22/casia_maxpy_mtcnnpy_182 \ #Đường dẫn file ảnh align --image_size 160 \ --margin 44

Code export embedding: !python ./models/facenet/contributed/export_embeddings.py \ ./models/facenet/models/20180402-114759 \ ./datasets/aligned/train/112x112/ \ --is_aligned TRUE \ --image_size 160 \ --margin 44 \ --image_batch 16 \ --gpu_memory_fraction 0.25 \ --embeddings_name ./data/capture/embeddings11.npy \ --labels_name ./data/capture/labels11.npy \ --labels_strings_name ./data/capture/labels_strings11.npy \

Chạy file tạo csv mới theo ảnh đã align.

Chạy train và test...