Skip to content

Commit

Permalink
add mpi download
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultGROUEIX committed Sep 9, 2019
1 parent b7100b0 commit cefdb36
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 13 deletions.
9 changes: 9 additions & 0 deletions inference/download_test_data.sh
@@ -0,0 +1,9 @@
#!/bin/bash
function gdrive_download () {
CONFIRM=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate "https://docs.google.com/uc?export=download&id=$1" -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$CONFIRM&id=$1" -O $2
rm -rf /tmp/cookies.txt
}
gdrive_download 1eunbBgwV9nFf5ybwxkW7oa88lQ4W0HZm mpi.zip # Test data files
unzip mpi.zip
mv export $1
22 changes: 9 additions & 13 deletions inference/script.py
@@ -1,4 +1,3 @@

from __future__ import print_function
import sys
sys.path.append('./auxiliary/')
Expand All @@ -7,18 +6,10 @@
import my_utils
print("fixed seed")
import argparse
import random
import numpy as np
import torch
import torch.optim as optim
from datasetSMPL2 import *
from model import *
from ply import *
import os
import json
import datetime
import correspondences
import parser

parser = argparse.ArgumentParser()
print(sys.path)
# ========
Expand All @@ -34,6 +25,14 @@
my_utils.plant_seeds(randomized_seed=opt.randomize)


if not os.path.exists("log_inference"):
print("Creating log_inference folder")
os.mkdir("log_inference")

if not os.path.exists(os.path.join(opt.dataset_path,"test_scan_006.ply")):
print("getting test data")
os.system(f"chmod +x ./inference/download_test_data.sh")
os.system(f"./inference/download_test_data.sh {opt.dataset_path}")
#
# =====DEFINE CHAMFER LOSS======================================== #
sys.path.append("./extension/")
Expand All @@ -52,9 +51,6 @@
inf = correspondences.Inference(model_path = opt.model_path, save_path=dir_name, LR_input=opt.LR_input)


if not os.path.exists("log_inference"):
print("Creating log_inference folder")
os.mkdir("log_inference")



Expand Down

0 comments on commit cefdb36

Please sign in to comment.