EfficientDet | EfficientDet | Computer Vision library
kandi X-RAY | EfficientDet Summary
kandi X-RAY | EfficientDet Summary
Thanks for their hard work. This project is released under the Apache License. Please take their licenses into consideration too when use this project.
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
- r Estimator .
- Build BiFPN layer .
- Builds WBiFPN layer .
- Filter boxes based on classification .
- Batch convolution block .
- Create generator functions .
- Compute the anchor targets for the given bboxes .
- Create callbacks .
- Runs the model on the given image .
- Evaluate the model .
EfficientDet Key Features
EfficientDet Examples and Code Snippets
def _pad():
def _impl(inputs, input_types):
data = inputs[0]
padding = inputs[1]
# pad_width = list(zip(padding, padding))
pad_v = padding.type_annotation.shape # change here and next line
pad_width = [[0,
_defaults = {
#--------------------------------------------------------------------------#
# 使用自己训练好的模型进行预测一定要修改model_path和classes_path!
# model_path指向logs文件夹下的权值文件,classes_path指向model_data下的txt
# 如果出现shape不匹配,同时要注意训练时的model_pat
python3 train.py path_to_all_images \
--ann_name ../annotations/binary_mixed --model tf_efficientdet_d2 \
--batch-size 4 --decay-rate 0.95 --lr .001 --workers 4 --warmup-epochs 5 \
--model-ema --dataset multi --pretrained --num-classes 1 --color-jitt
Community Discussions
Trending Discussions on EfficientDet
QUESTION
I'm trying to get a YOLOv5s model to run on a Coral EdgeTPU. Ive followed the instructions in the YOLOv5 repository for conversion from the yolov5s.pt model to the yolov5s-int8_edgetpu.tflite model.
After cloning the pycoral repository, they provide a detect_image.py
script. When using their model, the script executes with no errors.
If I run the same script with my yolov5s-int8_edgetpu.tflite model I get this error:
...ANSWER
Answered 2022-Feb-04 at 14:57Since the Yolov5s model has a different input file than the EfficientDet, the output tensor will be different. The trick here is understanding how to process this output tensor.
Fortunately, Ultralytics/Yolov5 held an export competition where the goal was to execute Yolov5 models on EdgeTPU devices.
This guy Josh won the coral devboard section. He wrote python library to process these wonky tensor outputs from Yolov5s models. Here is the repo. The real processing of the output tensor is done in his non-max-suppression code.
I've forked his repo and added the ability to execute/process these Yolov5s models on desktops.
Thanks so much Josh!
QUESTION
I've downloaded the EfficientDet D0 512x512 model from the object detection API model zoo, downloaded the PASCAL VOC dataset and preprocessed it with the create_pascal_tf_record.py
file. Next I took one of the config files and adjusted it to fit the architecture and VOC dataset. When evaluating the resulting network with the pascal_voc_detection_metrics
it gives me a near zero mAP for the first class (airplane), the other classes are performing fine. I'm assuming one of my settings in the config file is wrong (pasted down below), why does this happen and how do i fix this?
ANSWER
Answered 2021-Aug-04 at 10:21There is a bug in the way pascal_voc_detection_metrics
calculates the metric, fix can be found here
QUESTION
Code using tfjs-node
:
ANSWER
Answered 2021-Mar-25 at 02:29When you download the tensor using dataSync()
it just keeps the value. If you wanted the object with a description of each of the results without the tensors you would just have to console.log(result)
. Then you expand the result from your log in the browsers console it should return something like this:
QUESTION
I want to train a large object detection model using TF2, preferrably the EfficientDet D7
network. With my Tesla P100 card that has 16 GB of memory I am running into an "out of memory" exception, i.e. not enough memory on the graphics card can be allocated.
So I am wondering what my options are in this case. Is it correct that if I would have multiple GPUs, then the TF model would be split so that it fills memory of both cards? So in my case, with a second Tesla card again with 16 GB I would have 32 GB in total during training? If that is the case would that also be true for a cloud provider, where I could utilize multiple GPUs?
Moreover, if I am wrong and it would not work to split a model for multiple GPUs during training, what other approach would work in order to train a large network that does not fit into my GPU memory?
PS: I know that I could reduce the batch_size
to 1, but unfortunately that does still not solve my issue for the really large models ...
ANSWER
Answered 2021-Mar-18 at 09:26You can use multiple GPU's in GCP (Google Cloud Platform) atleast, not too sure about other cloud providers. And yes, once you do that, you can train with a larger batch size (exact number would depend on the GPU, it's memory and how may you GPU's you have running in your VM)
You can check this link for the list of all GPU's available in GCP
If you're using the object detection API, you can check this post regarding training using multiple GPU's.
Alternatively, if you want to go with a single GPU, one clever trick would be to use the concept of gradient accumulation where you could virtually increase your batch size without using too much extra GPU memory, which is discussed in this post
QUESTION
I'm currently trying to train a model based off the model detection zoo for object detection. Running the setup on the CPU works as expected but trying the same on my GPU results in the following error.
...ANSWER
Answered 2021-Mar-11 at 07:39I've done a complete reinstallation of every involving component. I might have done something different this time but I cannot say what. Atleast I'm now able to utilize the GPU for training.
QUESTION
I am using the TF2 research object detection API with the pre-trained EfficientDet D3 model from the TF2 model zoo. During training on my own dataset I notice that the total loss is jumping up and down - for example from 0.5 to 2.0 a few steps later, and then back to 0.75:
So all in all this training does not seem to be very stable. I thought the problem might be the learning rate, but as you can see in the charts above, I set the LR to decay during the training, it goes down to a really small value of 1e-15, so I don't see how this can be the problem (at least in the 2nd half of the training).
Also when I smooth the curves in Tensorboard, as in the 2nd image above, one can see the total loss going down, so the direction is correct, even though it's still on quite a high value. I would be interested why I can't achieve better results with my training set, but I guess that is another question. First I would be really interested why the total loss is going up and down so much the whole training. Any ideas?
PS: The pipeline.config
file for my training can be found here.
ANSWER
Answered 2021-Mar-08 at 09:03In your config it states that your batch size is 2. This is tiny and will cause a very volatile loss.
Try increasing your batch size substantially; try a value of 256
or 512
. If you are constrained by memory, try increasing it via gradient accumulation.
Gradient accumulation is the process of synthesising a larger batch by combining the backwards passes from smaller mini-batches. You would run multiple backwards passes before updating the model's parameters.
Typically, a training loop would like this (I'm using pytorch-like syntax for illustrative purposes):
QUESTION
I am trying to use custom model detection using TensorFlow in android and I am using pre-train models from the official TensorFlow site. 3 out of 4 models are not working getting this error in the log.
...ANSWER
Answered 2021-Feb-25 at 09:18Seems you're using ML Kit's object detection API with custom model. It first identifies objects in the image, and run image classification on those objects to determine what the object is. Hence, the model's output is class probability.
On the other hand, other models are actual object detection models, and outputs four tensors representing bounding box positions and classes.
Please refer to following example for using those detection models.
https://www.tensorflow.org/lite/examples/object_detection/overview
QUESTION
I'm training an EfficientDet V7 model using the V2 model zoo and have the following output in TensorBoard:
This is great, you can see that my classification and localisation losses are dropping to low levels (I'll worry about overfitting later if this is a separate issue) - but regularisation loss is still high and this is keeping my total loss at quite high levels. I can't seem to a) find a clear explanation (for a newbie) on what I'm looking at with the regularisaton loss (what does it represent in this context) and b) suggestions as to why it might be so high.
...ANSWER
Answered 2021-Feb-23 at 11:04Usually, regularization loss is something like a L2 loss computed on the weights of your neural net. Minimization of this loss tends to shrink the values of the weights. It is a regularization (hence the name) technique, which can help with such problems as over-fitting (maybe this article can help if you want to know more).
Bottom line: You don't have to do anything about it.
QUESTION
Even though I am quite familiar with the concepts of Machine Learning & Deep Learning, I never needed to create my own dataset before.
Now, for my thesis, I have to create my own dataset with images of an object that there are no datasets available on the internet(just assume that this is ground-truth).
I have limited computational power so I want to use YOLO, SSD or efficientdet.
Do I need to go over every single image I have in my dataset by my human eyes and create bounding box center coordinates and dimensions to log them with their labels?
Thanks
...ANSWER
Answered 2021-Jan-07 at 11:32Yes, you will need to do that.
At the same time, though the task is niche, you could benefit from the concept of transfer learning. That is, you can use a pre-trained backbone in order to help your model to learn faster/achieve better results/need fewer annotations example, but you will still need to annotate the new dataset on your own.
You can use software such as LabelBox
, as a starting point, it is very good since it allows you to output the format in Pascal(VOC) format, YOLO and COCO format, so it is a matter of choice/what is more suitable for you.
QUESTION
I have been checking out this detr repository and the total number of classes are 100, but 10 of these are empty string as shown here.
Is there any particular reason behind this?
ANSWER
Answered 2020-Dec-17 at 13:18Basically, the COCO dataset was described in a paper before its release (you can find it here). At this point, the authors gave a list of the 91 types of objects that would be in the dataset.
But when the 2014 and 2017 datasets sere released, it turned out that you could find only 80 of these objects in the annotations.
The list you have is the original list of objects (as described in the paper) but with every object that does not appear in the 2014 and 2017 replaced by the empty string ""
.
My guess is that the sole purpose of keeping these "phantom" objects is to keep consistency with object ids that may have been fixed someday in the past.
If you want to learn more about it, you can look at this blog entry.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install EfficientDet
MSCOCO 2017 Download images and annotations of coco 2017 Copy all images into datasets/coco/images, all annotations into datasets/coco/annotations
Other types please refer to fizyr/keras-retinanet)
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page