Skip to content
Snippets Groups Projects
Commit 7b569874 authored by nikhil_rayaprolu's avatar nikhil_rayaprolu
Browse files

Update test.py

parent d726546c
No related branches found
No related tags found
No related merge requests found
......@@ -19,7 +19,6 @@ import json
test_images_path = os.getenv("AICROWD_TEST_IMAGES_PATH", False)
predictions_output_path = os.getenv("AICROWD_PREDICTIONS_OUTPUT_PATH", False)
print(predictions_output_path)
......@@ -417,7 +416,6 @@ def single_gpu_test(model, data_loader, show=False):
with torch.no_grad():
result = model(return_loss=False, rescale=not show, **data)
results.append(result)
print("one image done")
if show:
model.module.show_result(data, result)
......@@ -522,7 +520,6 @@ def parse_args():
def main():
print("I am here")
args = parse_args()
assert args.out or args.show or args.json_out, \
......@@ -601,15 +598,11 @@ def main():
coco_eval(result_files, eval_types, dataset.coco)
print(args.json_out, rank)
if outputs and args.json_out and rank == 0:
print("inside json_out")
print(outputs)
if not isinstance(outputs[0], dict):
print("inside is instance")
response = results2json(dataset, outputs, args.json_out)
else:
print("inside the else")
for name in outputs[0]:
print("inside the output folder")
outputs_ = [out[name] for out in outputs]
result_file = args.json_out + '.{}'.format(name)
response = results2json(dataset, outputs_, result_file)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment