GithubHelp home page GithubHelp logo

chargedmonk / social-distancing-using-yolov5 Goto Github PK

View Code? Open in Web Editor NEW
109.0 3.0 44.0 74.83 MB

Classifying people as high risk and low risk based on their distance to other people.

License: GNU General Public License v3.0

Dockerfile 1.32% Python 97.77% Shell 0.91%
python opencv yolo computer-vision deep-learning social-distancing social-distancing-detection social-distance-monitoring pytorch

social-distancing-using-yolov5's People

Contributors

chargedmonk avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

social-distancing-using-yolov5's Issues

model structure failed

i run detect.py next happend

    detect()
  File "detect.py", line 62, in detect
    pred = model(img, augment=opt.augment)[0]
  File "/Users/s-yasui/anaconda3/envs/yolov5/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/Users/s-yasui/Documents/ai/pytorch/Social-Distancing-using-YOLOv5/models/yolo.py", line 91, in forward
    return self.forward_once(x, profile)  # single-scale inference, train
  File "/Users/s-yasui/Documents/ai/pytorch/Social-Distancing-using-YOLOv5/models/yolo.py", line 108, in forward_once
    x = m(x)  # run
  File "/Users/s-yasui/anaconda3/envs/yolov5/lib/python3.8/site-packages/torch/nn/modules/module.py", line 722, in _call_impl
    result = self.forward(*input, **kwargs)
  File "/Users/s-yasui/Documents/ai/pytorch/Social-Distancing-using-YOLOv5/models/yolo.py", line 28, in forward
    x[i] = x[i].view(bs, self.na, self.no, ny, nx).permute(0, 1, 3, 4, 2).contiguous()
RuntimeError: shape '[1, 3, 85, 56, 80]' is invalid for input of size 573440

tensor size is correct ?

How to convert to model TensorRT

Hello, I want to optimize model by convert model to TensorRT

But I'm not familiar with pytorch, so I don't know how to do it.

Do I need to modify the entire code to apply tensorrt optimization to the current source code?

And I wonder what I would do if I could accelerate with tensorrt.

Thank you for your good code! :)

Question

Hello, thank you for your cool repo. I just had a couple of questions,

  1. How did you calculate the distance between two persons? Did you use bird-eye view? Or only the pixel distance was calculated?
  2. Can we change the distance threshold value somehow?

Thanks

licence

Observation: your repo is under scrutiny on a worldwide forum (Kaggle). You can't change a GPLv3 licence (original yolov5) into MIT licence: you need to keep the GPL licence...

image support?

Hello ๐Ÿ‘‹,
Thank you for your work I want to add the support of the image. Did any change you make any changes to the image?

Issue

Hi,

I downloaded the code and ran:
python detect.py --source ./inference/videos/video.mp4

the got the following error:

Namespace(agnostic_nms=False, augment=False, classes=None, conf_thres=0.4, device='', fourcc='mp4v', img_size=640, iou_thres=0.5, output='inference/output', save_txt=False, source='./inference/videos/video.mp4', view_img=False, weights='weights/yolov5s.pt')
Using CUDA device0 _CudaDeviceProperties(name='GeForce RTX 2070 SUPER', total_memory=8192MB)

Traceback (most recent call last):
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 189, in nti
    n = int(s.strip() or "0", 8)
ValueError: invalid literal for int() with base 8: 'py\nndarr'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 2297, in next
    tarinfo = self.tarinfo.fromtarfile(self)
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1093, in fromtarfile
    obj = cls.frombuf(buf, tarfile.encoding, tarfile.errors)
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1035, in frombuf
    chksum = nti(buf[148:156])
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 191, in nti
    raise InvalidHeaderError("invalid header")
tarfile.InvalidHeaderError: invalid header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "C:\Users\XPC\anaconda3\envs\py36\lib\site-packages\torch\serialization.py", line 555, in _load
    return legacy_load(f)
  File "C:\Users\XPC\anaconda3\envs\py36\lib\site-packages\torch\serialization.py", line 466, in legacy_load
    with closing(tarfile.open(fileobj=f, mode='r:', format=tarfile.PAX_FORMAT)) as tar, \
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1589, in open
    return func(name, filemode, fileobj, **kwargs)
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1619, in taropen
    return cls(name, mode, fileobj, **kwargs)
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 1482, in __init__
    self.firstmember = self.next()
  File "C:\Users\XPC\anaconda3\envs\py36\lib\tarfile.py", line 2309, in next
    raise ReadError(str(e))
tarfile.ReadError: invalid header

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "detect.py", line 166, in <module>
    detect()
  File "detect.py", line 21, in detect
    model = torch.load(weights, map_location=device)['model'].float()  # load to FP32
  File "C:\Users\XPC\anaconda3\envs\py36\lib\site-packages\torch\serialization.py", line 386, in load
    return _load(f, map_location, pickle_module, **pickle_load_args)
  File "C:\Users\XPC\anaconda3\envs\py36\lib\site-packages\torch\serialization.py", line 559, in _load
    raise RuntimeError("{} is a zip archive (did you mean to use torch.jit.load()?)".format(f.name))
RuntimeError: weights/yolov5s.pt is a zip archive (did you mean to use torch.jit.load()?)

ALl the pt files are in the weights folder.

any clue?

'No images or videos found in %s. Supported formats are:\nimages: %s\nvideos: %s'

assert self.nF > 0, 'No images or videos found in %s. Supported formats are:\nimages: %s\nvideos: %s' % \

AssertionError: No images or videos found in inference/videos/videofile.mp4. Supported formats are:images: ['.bmp', '.jpg', '.jpeg', '.png', '.tif', '.dng']
videos: ['.mov', '.avi', '.mp4', '.mpg', '.mpeg', '.m4v', '.wmv', '.mkv']
image

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.