-
Notifications
You must be signed in to change notification settings - Fork 0
/
run.py
36 lines (27 loc) · 1.01 KB
/
run.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
import sys
import os
import glob
import click
# Load third party modules for environment testing
import numpy as np
import pandas as pd
import tensorflow as tf
from dss_kaggle_clouds.features.utils import verify_files_exist
@click.command()
@click.argument("RAW_DATA_DIR", type=click.Path(exists=True))
def run(raw_data_dir):
"""Command Line Interface
The RAW_DATA_DIR is the data/ directory that includes the data/train_images or data/train.csv files
should be passed on command line like:
python3 run.py data/
"""
if verify_files_exist(raw_data_dir):
click.echo("Data dir is correctly built.")
csv_file = os.path.join(raw_data_dir, "train.csv")
train_images_dir = os.path.join(raw_data_dir, "train_images")
image_files = list(map(os.path.abspath, glob.glob(os.path.join(train_images_dir, "*.jpg"))))
click.echo("CSV filepath: {}".format(csv_file))
click.echo("Train Images Count: {}".format(len(image_files)))
sys.exit(0)
if __name__ == "__main__":
run()