wongkinyiu / yolov7 Goto Github PK
View Code? Open in Web Editor NEWImplementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
License: GNU General Public License v3.0
Implementation of paper - YOLOv7: Trainable bag-of-freebies sets new state-of-the-art for real-time object detectors
License: GNU General Public License v3.0
I saw a project https://github.com/jinfagang/yolov7, why not this project named yolov8 to avoid project name conflict ?this may be confused people.
t[range(n), tcls[i]] = self.cp
#t[t==self.cp] = iou.detach().clamp(0).type(t.dtype)
Hello, I'm glad to see the release of yolov7. Using self.cp instead of using IOU value as classification label, is it because it will lead to performance degradation in your experiment?
@WongKinYiu @AlexeyAB
Hi friendly pings
YOLOv7 surpasses all known object detectors in both speed and accuracy in the range from 5 FPS to 160 FPS and has the highest accuracy 56.8% AP among all known real-time object detectors with 30 FPS or higher on GPU V100.
Weird claim when you actually rank #20 on COCO
If we exclude all models with extra training data you still rank #11.
the #1 without extra data is Dual-Swin-L(HTC, multi-scale), with 60.1 box AP
with extra data it is DINO(Swim-L,multi-scale) with 63.3 box AP
Same issue as this with torch 1.12
With an older version of torch, everything works.
How about GFLOPs of each pretrained model?
Hi,
Is there available the .yaml version of the yolov7-tiny.cfg?
I'd like to train it with my custom data using PyTorch. Already tested with darknet and is working fine
Hi !
I use yolov4 with a c++ application. Will have in the future a version for C++? Or a dll that we can use?
Many thanks =)
assets = [x['name'] for x in response['assets']] # release assets
KeyError: 'assets'
\utils\google_utils.py", line 26, in attempt_download
As usual, when starting a new training, YOLOv7 will try to spawn train.cache/valid.cache.
This is the same name as YOLOv5 cache which, if already exists, will crash the training.
For present and future compatibility, could it be something with some sort of identifier? Example: "train.yolov7", "train.cachev7", etc.
Just a reminder that, for YOLOR, it's "train.cache3".
I try to train on my dataset (good worked on yolov5) and got error after several steps:
Epoch gpu_mem box obj cls total labels img_size
0/4 1.41G 0.04262 2.882 0 2.925 1 640: 7%| | 3/41 [00:06<01:25, 2.24s/i
Traceback (most recent call last):
File "./train.py", line 609, in <module>
train(hyp, opt, device, tb_writer)
File "./train.py", line 362, in train
loss, loss_items = compute_loss_ota(pred, targets.to(device), imgs) # loss scaled by batch_size
File "/mnt/HD0/projects/yolov7/yolov7/utils/loss.py", line 585, in __call__
bs, as_, gjs, gis, targets, anchors = self.build_targets(p, targets, imgs)
File "/mnt/HD0/projects/yolov7/yolov7/utils/loss.py", line 778, in build_targets
matching_bs[i] = torch.cat(matching_bs[i], dim=0)
NotImplementedError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function is registered for schema aten::_cat. This usually means that this function requires a non-empty list of Tensors, or that you (the operator writer) forgot to register a fallback function. Available functions are [CPU, CUDA, QuantizedCPU, BackendSelect, Python, Named, Conjugate, Negative, ZeroTensor, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradLazy, AutogradXPU, AutogradMLC, AutogradHPU, AutogradNestedTensor, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, Tracer, AutocastCPU, Autocast, Batched, VmapMode, Functionalize].
How I can fix this?
Tried on GPU and CPU.
For CPU I had to fix some code at 71 line of train.py:
run_id = torch.load(weights, map_location=device).get('wandb_id') if weights.endswith('.pt') and os.path.isfile(weights) else None
parameter ", map_location=device" was added.
Hi,
Is the repo ready for training on custom dataset?
I am trying to find implementation of Coarse-to-fine lead head guided label assigner in the repo and can anyone point out where is this portion located?
What model can be runned in Google Coral TPU Accelerator?
Is it there a snip code to transform into model_quantized.tflite?
I am running inference on a video in google colab, and after processing some frames, I am getting CUDA out of memory. @WongKinYiu
Anyways, thanks for the great work
Thanks for the great work. I saw so many codes that look like YOLOV5, the author is still cleaning?
windows
vs 2019
cuda 11.3
cudnn 8.2.3
tensorrt 8.2
3060ti
amd 5900H
openvino forward:
yolov5s: 90ms yolov6s 75, yolov7 282ms
opencv dnn forward:
yolov5s:21, yolov6s 18ms, yolov7 25ms
tensorrt
yolov5s: 6ms yolov6s 5ms yolov7 11ms
compare the yolov6 the yolov7 bigger
Can I run this repo on Google collab, I don't have a good local system to run Deep Learning models. Can you please provide instructions on how to run it on collab @WongKinYiu
when onnx_to_tensorrt
In node 163 (parseGraph): INVALID_GRAPH: Assertion failed: ctx->tensors().count(inputName)
onnx is from models/export.py.
my testing model is pretrained yolov7.pt
Hi,
I tested the tiny model on a CPU, it turned on approximately 350ms per image, at the same time, I tested the nano version of YOLOv5 on the same CPU and it was two times faster than YOLOv7-tiny. However, in the paper, it's specified that YOLOv7-tiny is approximately two times faster than YOLOv5-N when executed on a GPU. Is that normal?
Many thanks!
Hi, I am wondering if there will be some notes regarding the setup or installation of the official YOLOv7, preferrably for installation with Docker? Would be great if some material related to this can be added to the repo.
opencv 4.6.0
Hi @WongKinYiu - Excited to try the implementation !
I can't use the webcam, actually the function LoadWebcam is not called at the detect file, only LoadStreams is called.
One more thing, could your provide please the tiny-pretrained model?
Thank you so much!
REORG operation may not be needed, as it has been demonstrated in the V 5 work, with better efficiency through a Conv[64, 6, 2, 2]]
When will the training be released
I really appreciate your guys contribution! It is backed by an official Peer reviewed paper - It also has reputable authors. I wish we could have an official board to regulate YOLO models. Looking forward to making a course on this model!
RuntimeError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function is registered for schema aten::_cat. This usually means that this function requires a non-empty list of Tensors. Available functions are [CPU, CUDA, QuantizedCPU, BackendSelect, Named, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, AutogradNestedTensor, UNKNOWN_TENSOR_TYPE_ID, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, Tracer, Autocast, Batched, VmapMode].
Total weights read: 37669889
Building YOLO network
layer input output weightPtr
(0) conv_silu 3 x 640 x 640 32 x 640 x 640 992
(1) conv_silu 32 x 640 x 640 64 x 320 x 320 19680
(2) conv_silu 64 x 320 x 320 64 x 320 x 320 56800
(3) conv_silu 64 x 320 x 320 128 x 160 x 160 131040
(4) conv_silu 128 x 160 x 160 64 x 160 x 160 139488
(5) conv_silu 64 x 160 x 160 64 x 160 x 160 143840
(6) conv_silu 64 x 160 x 160 64 x 160 x 160 180960
(7) conv_silu 64 x 160 x 160 64 x 160 x 160 218080
(8) conv_silu 64 x 160 x 160 64 x 160 x 160 255200
(9) conv_silu 64 x 160 x 160 64 x 160 x 160 292320
(10) route - 128 x 160 x 160 292320
(11) conv_silu 128 x 160 x 160 256 x 160 x 160 326112
(12) conv_silu 256 x 160 x 160 128 x 160 x 160 359392
(13) conv_silu 128 x 160 x 160 128 x 160 x 160 376288
(14) conv_silu 128 x 160 x 160 128 x 80 x 80 524256
ERROR: [TRT]: 4: [layers.cpp::estimateOutputDims::1944] Error Code 4: Internal Error (route_15: all concat input tensors must have the same dimensions except on the concatenation axis (0), but dimensions mismatched at index 1. Input 0 shape: [128,80,80], Input 1 shape: [128,160,160])
I tried my hand at generating darknet weights for yolov7.pt but I am blocked getting it converted to TensorRT. Any guidance on this issue?
why write here parser.add_argument('--local_rank', type=int, default=-1, help='DDP parameter, do not modify')
,if i want to use DDP, should i change to 0
I want to ask why P is always much lower than R during training?
Are these two values weighted during training?
Dear Author, I see that there is an option in test.py called "--trace", what does it mean? What is the purpose of this option?
Hi @WongKinYiu - excited to try out the repo! Could you share what license this code is released under?
File "/root/yolov7-main/utils/loss.py", line 778, in build_targets
matching_bs[i] = torch.cat(matching_bs[i], dim=0)
NotImplementedError: There were no tensor arguments to this function (e.g., you passed an empty list of Tensors), but no fallback function is registered for schema aten::_cat. This usually means that this function requires a non-empty list of Tensors, or that you (the operator writer) forgot to register a fallback function. Available functions are [CPU, CUDA, QuantizedCPU, BackendSelect, Named, ADInplaceOrView, AutogradOther, AutogradCPU, AutogradCUDA, AutogradXLA, UNKNOWN_TENSOR_TYPE_ID, AutogradMLC, AutogradHPU, AutogradNestedTensor, AutogradPrivateUse1, AutogradPrivateUse2, AutogradPrivateUse3, Tracer, Autocast, Batched, VmapMode].
Deepstream support:
Its training method and deployment are very similar to yolov5, and I like it very much!!
Amazing achievements! Maybe I missed something. I couldn't find the E-ELAN structure. In addition, may you share with me the first citation of the paper, that of the ELAN? Thank you very much!
My E-mail:
[email protected]
Thanks again!
Can you give some instruction to reproduce the speed in your paper or repo?
Can you provide additional information about the complete composite loss function formula? The paper does not provide enough information.
AssertionError: Image Not Found E:\executable_code\YOLO\yolov72022\yolov7-main—7.8\yolov7-main\inference\images\horses.jpg
Please provide a full set of 640 scale training models, and don't do curve comparison.
There are many unfair comparisons in your form, which will not show you to be superior, but will only mislead readers and make readers more confused.
請提供全套640尺度的訓練模型,不要做曲線對比。
你的表格存在很多不公平的對比,這並不會顯得你很優越,只會誤導讀者,讓讀者更困惑。
yolov5 is:
const char* INPUT_BLOB_NAME = "data";
const char* OUTPUT_BLOB_NAME = "prob";
yolov6 is:
const char* INPUT_BLOB_NAME = "image_arrays";
const char* OUTPUT_BLOB_NAME = "outputs";
yolov7 input is images and output is putput
const char* INPUT_BLOB_NAME = "images";
const char* OUTPUT_BLOB_NAME = "output";
yolov7, use the above, all is -1, as below:
IRuntime* runtime = createInferRuntime(gLogger);
assert(runtime != nullptr);
ICudaEngine* engine = runtime->deserializeCudaEngine(trtModelStream, size);
assert(engine != nullptr);
IExecutionContext* context = engine->createExecutionContext();
assert(context != nullptr);
delete[] trtModelStream;
const ICudaEngine& engine = context.getEngine();
const int inputIndex = engine.getBindingIndex(INPUT_BLOB_NAME); //return -1
const int outputIndex = engine.getBindingIndex(OUTPUT_BLOB_NAME); //return -1
Firstly, It's a great work derived from YOLO series, but I notice that the 'cfg' fold in your repo have a 'deploy' direction with various v7's model configuration files, are they the model's cfg after re-parameterization and different from training models?
Such as TensorRT Openvino?~~~
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.