Coder Social home page Coder Social logo

rvchallenge-evaluation's People

Contributors

david2611 avatar jskinn avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

rvchallenge-evaluation's Issues

Submitting Bbox with mean corner outside image coordinates

There's an error when evaluating detections with mean corners outside the image coordinates. For example, corner at (643, 300) when image is only (640, 480). The error is:

"""
Traceback (most recent call last):
  File "/.pyenv/versions/anaconda3-5.3.0/lib/python3.7/multiprocessing/pool.py", line 121, in worker
    result = (True, func(*args, **kwds))
  File "/tmp/codalab/tmpoL6BRw/run/program/pdq.py", line 156, in _get_image_evals
    results = _calc_qual_img(gt_instances, det_instances)
  File "/tmp/codalab/tmpoL6BRw/run/program/pdq.py", line 374, in _calc_qual_img
    cost_tables = _gen_cost_tables(gt_instances, det_instances)
  File "/tmp/codalab/tmpoL6BRw/run/program/pdq.py", line 307, in _gen_cost_tables
    det_seg_heatmap_mat, det_label_prob_mat = _vectorize_img_dets(det_instances, img_shape)
  File "/tmp/codalab/tmpoL6BRw/run/program/pdq.py", line 200, in _vectorize_img_dets
    det_seg_heatmap_mat = np.stack([det_instance.calc_heatmap(img_shape) for det_instance in det_instances], axis=2)
  File "/tmp/codalab/tmpoL6BRw/run/program/pdq.py", line 200, in 
    det_seg_heatmap_mat = np.stack([det_instance.calc_heatmap(img_shape) for det_instance in det_instances], axis=2)
  File "/tmp/codalab/tmpoL6BRw/run/program/data_holders.py", line 102, in calc_heatmap
    np.array(covs2[1]).T)
  File "/tmp/codalab/tmpoL6BRw/run/program/data_holders.py", line 177, in gen_single_heatmap
    roi_box = find_roi(img_size, mean, cov)
  File "/tmp/codalab/tmpoL6BRw/run/program/data_holders.py", line 142, in find_roi
    positions = np.indices(approx_roi_shape).T.reshape(-1, 2)
  File "/.pyenv/versions/anaconda3-5.3.0/lib/python3.7/site-packages/numpy/core/numeric.py", line 1863, in indices
    res = empty((N,)+dimensions, dtype=dtype)
ValueError: negative dimensions are not allowed
"""

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/tmp/codalab/tmpoL6BRw/run/program/evaluate_codalab.py", line 31, in 
    main(input_dir=sys.argv[1], output_dir=sys.argv[2])
  File "/tmp/codalab/tmpoL6BRw/run/program/evaluate_codalab.py", line 21, in main
    result = do_evaluation(submit_dir, truth_dir)
  File "/tmp/codalab/tmpoL6BRw/run/program/evaluate.py", line 31, in do_evaluation
    score = evaluator.score(matches)
  File "/tmp/codalab/tmpoL6BRw/run/program/pdq.py", line 77, in score
    for img_results in pool.imap_unordered(_get_image_evals, iterable=matches):
  File "/.pyenv/versions/anaconda3-5.3.0/lib/python3.7/multiprocessing/pool.py", line 748, in next
    raise value
ValueError: negative dimensions are not allowed

Error traces back to the find_roi(img_size, mean, cov) function in data_holders.py. Lines 143-154:

    minx = int(max(mean[1] - stdx * 5, 0))
    miny = int(max(mean[0] - stdy * 5, 0))
    maxx = int(min(mean[1] + stdx * 5, img_size[1] - 1))
    maxy = int(min(mean[0] + stdy * 5, img_size[0] - 1))

    # If the covariance is singular, we can't do any better in our estimate.
    if np.abs(np.linalg.det(cov)) < 1e-8:
        return minx, miny, maxx, maxy

    # produce list of positions [y,x] to compare to the given mean location
    approx_roi_shape = (maxy + 1 - miny, maxx + 1 - minx)
    positions = np.indices(approx_roi_shape).T.reshape(-1, 2)

While maxx and maxy variables are constrained to the image size, minx and miny are not. This means that minx > maxx and miny > maxy, which causes approx_roi_shape to contain negative values which can be passed into the np.indices() function.

One potential solution would be to make sure that minx, miny, maxx and maxy are all constrained between 0 and image-width/height.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.