dd1740d3f5a6e587805551e7316b0e607dc1f6f4,object-detection/yolov2/valid.py,,valid,#Any#Any#Any#,34

Before Change


            // if not (np.sum(ret[1].numpy()) == 0):
            yield ret

    valid_loader = batch_iter(
        iter(valid_dataset), batch_size=args.valid_batchsize)

    fps = [0]*args.num_classes
    if not os.path.exists(outdir):
        os.mkdir(outdir)
    for i in range(args.num_classes):
        buf = "%s/%s%s.txt" % (prefix, outfile, names[i])
        fps[i] = open(buf, "w")

    lineId = -1

    future_data = pool.apply_async(
        utils.raise_info_thread(next), (valid_loader, None))
    for batch_idx in itertools.count():
        curr_data = future_data
        future_data = pool.apply_async(
            utils.raise_info_thread(next), (valid_loader, None))
        ret = curr_data.get()
        if ret is None:

After Change


        fps[i] = open(buf, "w")

    lineId = 0
    total_samples = len(valid_files)
    total_batches = (total_samples+args.valid_batchsize -
                     1)//args.valid_batchsize

    for each_batch in range(0, total_batches):
        ret = valid_dataset.next()
        data, target = ret
        yolo_x_nnabla.d = data
        yolo_features_nnabla.forward(clear_buffer=True)
        batch_boxes = utils.get_region_boxes(
            yolo_features_nnabla.d, args.conf_thresh, args.num_classes, args.anchors, args.num_anchors, 0, 1)
        for i in range(yolo_features_nnabla.d.shape[0]):
            if lineId >= total_samples:
                print("Reached End of total_samples")
                break
            fileId = os.path.basename(valid_files[lineId]).split(".")[0]
            width, height = utils.get_image_size(valid_files[lineId])
            print(valid_files[lineId])
            lineId += 1
Italian Trulli
In pattern: SUPERPATTERN

Frequency: 3

Non-data size: 6

Instances


Project Name: sony/nnabla-examples
Commit Name: dd1740d3f5a6e587805551e7316b0e607dc1f6f4
Time: 2020-02-29
Author: sai.dyavarasetti@sony.com
File Name: object-detection/yolov2/valid.py
Class Name:
Method Name: valid


Project Name: GoogleCloudPlatform/python-docs-samples
Commit Name: 7d47747b0515a1f0c4b3ae7bc999b072c132864a
Time: 2020-06-15
Author: erschmid@google.com
File Name: media-translation/cloud-client/translate_from_mic.py
Class Name:
Method Name: main


Project Name: dmlc/dgl
Commit Name: 22ccf4365af620d10387b207aa103287c34d9247
Time: 2021-02-08
Author: wmjlyjemaine@gmail.com
File Name: benchmarks/benchmarks/model_speed/bench_pinsage.py
Class Name:
Method Name: track_time