Skip to content

Instantly share code, notes, and snippets.

View youonf's full-sized avatar

Kevin Luk youonf

  • Hong Kong
View GitHub Profile
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@youonf
youonf / wget
Created February 16, 2019 02:47
wget.py
!wget --user=your_username --password=your_password http://cdn1.i3s.up.pt/digitalpathology/ICIAR2018_BACH_Challenge.zip
#Download required dataset / competition files to a folder of your choice
!kaggle competitions download -c histopathologic-cancer-detection -p /content/gdrive/My\ Drive/kaggle/cancer
#List datasets and competitions
!kaggle datasets list
!kaggle competitions list
#Search for datasets and competitions by name
!kaggle datasets list -s cancer
!kaggle competitions list -s histopathologic-cancer-detection
@youonf
youonf / kaggle_api1.py
Created February 3, 2019 09:04
Upload the kaggle.json file
from google.colab import files
files.upload() #this will prompt you to update the json
!pip install -q kaggle
!mkdir -p ~/.kaggle
!cp kaggle.json ~/.kaggle/
!ls ~/.kaggle
!chmod 600 /root/.kaggle/kaggle.json # set permission
@youonf
youonf / google_colab_drive_mount.py
Last active April 11, 2021 00:28
Mounting Google Drive to Google Colab Notebook
from google.colab import drive
drive.mount('/content/gdrive')
root_path = 'gdrive/My Drive/your_project_folder/' #change dir to your project folder
@youonf
youonf / Data_augmentation_keras_opencv_brightness_hsv.py
Created January 31, 2019 11:38 — forked from avsthiago/Data_augmentation_keras_opencv_brightness_hsv.py
Data augmentation using Keras ImageDataGenerator and OpenCV. Also with brightness augmentation.
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
"""
Created on Thu Mar 29 09:57:55 2018
@author: avsthiago
"""
from keras.preprocessing.image import ImageDataGenerator
import numpy as np
hashtag_list = ['travelblog', 'travelblogger', 'traveler']
# prev_user_list = [] - if it's the first time you run it, use this line and comment the two below
prev_user_list = pd.read_csv('20181203-224633_users_followed_list.csv', delimiter=',').iloc[:,1:2] # useful to build a user log
prev_user_list = list(prev_user_list['0'])
new_followed = []
tag = -1
followed = 0
likes = 0
@youonf
youonf / instabot1.py
Created December 28, 2018 17:02 — forked from fnneves/instabot1.py
from selenium import webdriver
from selenium.webdriver.common.keys import Keys
from time import sleep, strftime
from random import randint
import pandas as pd
chromedriver_path = 'C:/Users/User/Downloads/chromedriver_win32/chromedriver.exe' # Change this to your own chromedriver path!
webdriver = webdriver.Chrome(executable_path=chromedriver_path)
sleep(2)
webdriver.get('https://www.instagram.com/accounts/login/?source=auth_switcher')