Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix eval.py script #25

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -64,4 +64,4 @@ The training script will save a checkpoint in the `log` directory after each 100
## Evaluate
In order to try our model, we included a snapshot of our trained model (in the `log` directory). That can be used as follow:

`python3 eval.py <input_img_path> <trimap_img_path> <output_img_path> --checkpoint -1`
`python3 eval.py <input_img_path> <output_img_path> --checkpoint -1`
4 changes: 1 addition & 3 deletions eval.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,6 @@ def parse_args():
parser = argparse.ArgumentParser(description="Evalutate image")
parser.add_argument("input", type=str,
help="Path to a file containing input image")
parser.add_argument("object", type=str,
help="Path to a file containing trimap image")
parser.add_argument("output", type=str,
help="Path to the output file")
parser.add_argument('--checkpoint', type=int, default=None,
Expand Down Expand Up @@ -116,7 +114,7 @@ def main(args):
input_filename = args.input
image = load_image(input_filename)
print(image.shape)
trimap = generate_trimap(args.object)
trimap = generate_trimap(input_filename)

image = np.array(image)
trimap = np.array(trimap)[..., np.newaxis]
Expand Down