Exemple #1
0
def run(input_path, output_path, remvoe_columns):
    """
  This functions removes specified column from input
  """
    meta = {"Remove Columns": remvoe_columns}
    proccesor = Process(meta)
    df = ioutil.read_parquet(input_path)
    result = proccesor.run(df)
    ioutil.save_parquet(result, output_path)
Exemple #2
0
def prepare_input():
    df = ioutil.read_parquet("../dstest/outputs/stargan/")
    results = []
    for index in range(len(df)):
        results.append([[0, 0, 0, 1, 0]])
    df.insert(len(df.columns), "c", results, True)
    print(df.columns)
    ioutil.save_parquet(df, "outputs/stargan/model_input", True)
    return df
def run(input_path, output_path, tensor_column):
    """
  This functions removes specified column from input
  """
    meta = {"Tensor Column": tensor_column}
    proccesor = Process(meta)
    df = ioutil.read_parquet(input_path)
    result = proccesor.run(df)
    #result = result[['image','Result']]
    # ioutil.save_parquet(result, output_path, True)
    ioutil.save_parquet1(result, output_path, True)
def run(input_path, meta_path, output_path, file_name, prob_col):
    """
  read
  """

    meta = {
        "Category File Name": file_name,
        "Probability Column Name": prob_col
    }

    proccesor = Process(meta_path, meta)
    df = ioutil.read_parquet(input_path)
    result = proccesor.run(df)
    ioutil.save_parquet(result, output_path, True)
Exemple #5
0
def run(input_path, output_path, image_column, target_column,
        target_datauri_column, target_image_size):
    """
  This functions read base64 encoded images from df. Transform to format required by model input.
  """
    meta = {
        "Image Column": image_column,
        "Target Column": target_column,
        "Target DataURI Column": target_datauri_column,
        "Target Image Size": target_image_size
    }
    proccesor = PreProcess(meta)

    df = ioutil.read_parquet(input_path)
    result = proccesor.run(df)
    ioutil.save_parquet(result, output_path)
Exemple #6
0
def run(input_path, meta_path, output_path, file_name, prob_col,
        append_category_column_to_output):
    """
  read
  """

    meta = {
        CATEGORY_FILE_NAME_KEY: file_name,
        PROBABILITY_COLUMN_NAME_KEY: prob_col,
        APPEND_CATEGORY_COLUMN_TO_OUTPUT_KEY: append_category_column_to_output
    }

    proccesor = Process(meta_path, meta)
    df = ioutil.read_parquet(input_path)
    result = proccesor.run(df)
    print(result)
    ioutil.save_parquet(result, output_path, True)
Exemple #7
0
    #df = pd.DataFrame()
    #df.insert(len(df.columns), 'x', batch_xs.tolist(), True)

    columns = [f"x.{i}" for i in range(784)]
    #columns = ['x']*784
    df = pd.DataFrame(data=batch_xs, columns=columns, dtype=np.float64)

    names = [
        "fixed acidity", "volatile acidity", "citric acid", "residual sugar",
        "chlorides", "free sulfur dioxide", "total sulfur dioxide", "density",
        "pH", "sulphates", "alcohol"
    ]
    data = [[7, 0.27, 0.36, 20.7, 0.045, 45, 170, 1.001, 3, 0.45, 8.8]]
    df1 = pd.DataFrame(data=data, columns=names)

    df = pd.concat([df, df1], axis=1)
    #df.to_parquet("test.parquet")
    #df.to_csv("test.csv")
    return df


# python -m dstest.tensorflow.mnist_test
if __name__ == '__main__':
    # df = prepare_input()
    df = ioutil.read_parquet("../dstest/outputs/mnist/")
    print(df.columns)

    test_tensor(df)
    out = test_builtin(df)
    print(out.columns)
    print(out)
def prepare_input():
    df = ioutil.read_parquet("../dstest/outputs/mnist/")
    print(df.columns)
    return df
Exemple #9
0
    return result


def prepare_input():
    df = ioutil.read_parquet("../dstest/outputs/stargan/")
    results = []
    for index in range(len(df)):
        results.append([[0, 0, 0, 1, 0]])
    df.insert(len(df.columns), "c", results, True)
    print(df.columns)
    ioutil.save_parquet(df, "outputs/stargan/model_input", True)
    return df


def test(model_path):
    df = prepare_input()
    out = test_builtin(model_path, df)
    ioutil.save_parquet(out, "outputs/stargan/model_output", True)
    print(out.columns)
    print(out)
    print(out["0"].shape)


# python -m dstest.pytorch.stargan
if __name__ == '__main__':
    # model_path = "model/stargan/"
    # test(model_path)

    out = ioutil.read_parquet("outputs/stargan/model_output")
    print(out.columns)
    #print(out["0"][0])