chargedmonk / social-distancing-using-yolov5 Goto Github PK
View Code? Open in Web Editor NEWClassifying people as high risk and low risk based on their distance to other people.
License: GNU General Public License v3.0
Classifying people as high risk and low risk based on their distance to other people.
License: GNU General Public License v3.0
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 ?
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! :)
Hello, thank you for your cool repo. I just had a couple of questions,
Thanks
Thanks for a brilliant implementation.
But how to use this for other categories like car or boat ?
I tried to pass the argument '--classes 8' but it does not draw the detections.
Please help
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...
Hi great works. Could you tell me how to count people in the frame and show that in the frame too. Thanks
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?
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?
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']
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.