WongKinYiu / yolov7

Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
GNU General Public License v3.0
13.24k stars 4.18k forks source link

test error #1313

Open yuan243212790 opened 1 year ago

yuan243212790 commented 1 year ago

test.py::test ERROR [100%] test setup failed file yolov7/test.py, line 21 def test(data,weights=None, E fixture 'data' not found

  available fixtures: anyio_backend, anyio_backend_name, anyio_backend_options, cache, capfd, capfdbinary, caplog, capsys, capsysbinary, doctest_namespace, monkeypatch, pytestconfig, record_property, record_testsuite_property, record_xml_attribute, recwarn, tmp_path, tmp_path_factory, tmpdir, tmpdir_factory, xdoctest_namespace
  use 'pytest --fixtures [testpath]' for help on them.
yulin010101 commented 1 year ago

The description is not clear to me. Can you share what you did and the complete error?

hamzanaeem1999 commented 1 year ago

@yulin010101 How to expand the bounding box by 15% in result (detection), Can you post the code please ? Thanks

yulin010101 commented 1 year ago

If (X,Y) is top left corner, adjust the original box (X,Y,W,H) -> (X-0.075W,Y-0.075H,1.15W,1.15H).

hamzanaeem1999 commented 1 year ago

@yulin010101 I am doing like this

    bbox[0] = bbox[0] -  0.05 * (bbox[2] - bbox[0])
    bbox[2] = bbox[2] +  0.05 * (bbox[2] - bbox[0])
    bbox[1] = bbox[1] - 0.05 * (bbox[3] - bbox[1])
    bbox[3] = bbox[3] + 0.05 * (bbox[3] - bbox[1])

But i think if any object comes at the corner, its bounding box goes out of the boundary of image which results an error. Could you please elaborate, (bbox[0], bbox[1]), xmin, ymin same as for xmax, ymax

yulin010101 commented 1 year ago

xmin and ymin should be zero. xmax and ymax should be the image size.

JXCrazy commented 1 year ago

Why i put the address: bash ./get_coco.sh have happend:

image

fangyt commented 1 year ago

https://github.com/WongKinYiu/yolov7/issues/1313#issue-1511538192 run python test.py fixbug