Skip to content

Instantly share code, notes, and snippets.

@rahulremanan
Last active August 30, 2021 19:39
Show Gist options
  • Save rahulremanan/f5b7ee3b43060b5b56b5e10d5b294e4a to your computer and use it in GitHub Desktop.
Save rahulremanan/f5b7ee3b43060b5b56b5e10d5b294e4a to your computer and use it in GitHub Desktop.
Twitter saliency filter analysis -- Part 01: Installation
import logging
from pathlib import Path
logging.basicConfig(level=logging.ERROR)
BIN_MAPS = {"Darwin": "mac", "Linux": "linux"}
HOME_DIR = Path("../").expanduser()
try:
import google.colab
!python3 -m pip install -q pandas scikit-learn scikit-image statsmodels requests dash
![[ -d image-crop-analysis ]] || git clone https://github.com/twitter-research/image-crop-analysis.git
HOME_DIR = Path("./image-crop-analysis").expanduser()
IN_COLAB = True
except:
IN_COLAB = False
import sys, platform
sys.path.append(str(HOME_DIR / "src"))
bin_dir = HOME_DIR / Path("./bin")
bin_path = bin_dir / BIN_MAPS[platform.system()] / "candidate_crops"
model_path = bin_dir / "fastgaze.vxm"
data_dir = HOME_DIR / Path("./data/")
data_dir.exists()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment