Comments (12)
I got the same error with wrong y-coordinates with python 3.6. I fixed it when replaced line 294 in yolo3_one_file_to_detect_them_all.py:
row = i / grid_w
with
row = i // grid_w
Hope it will help
from keras-yolo3.
@experiencor thank you for your help. you are right, the letterbox_image will get a higher mAP. The resize_image just work well on some images. maybe somehting is wrong with the rounding just like @JaspervDalen said. I also get the wrong result by python 3.6, and get the correct result by python 2.7
from keras-yolo3.
Are you sure you are running my code? My result is a bit different.
And do you actually run darknet yolo3 or just take the picture from the paper?
from keras-yolo3.
I try all steps again, and get the same result. the coordinates of bbox are also wrong.
- get the 'dog.jpg' image from repositories( https://github.com/pjreddie/darknet.git)
- download the yolov3.weights (wget https://pjreddie.com/media/files/yolov3.weights)
- download your code again, and then run: python yolo3_one_file_to_detect_them_all.py -w yolov3.weights -i dog.jpg
the environment:
ubuntu 16.04 tensorflow 1.7 keras 2.1.5
just now, i do all steps on another computer again, the result are also wrong.
are you sure your test code is same as the repositories a14aa4e
from keras-yolo3.
Yes, it is. I never change that python file since it's working. I also note that your probabilities are rounded to 2 decimal places, which are different from mine.
Darknet dog (actually run the darknet yolo3):
My dog (yolov3.weights => yolov3.h5 => predict.py):
from keras-yolo3.
I have the same results as @szxwpp but I use python3 and I think somehting is wrong with the rounding. However besides noticing that it was wrong I didn't have time to find the mistake and fix it.
from keras-yolo3.
@experiencor so sorry for the late reply. my probabilities are rounded to 2 decimal places only when drawing bboxs, it is after detection.
i used cv2:resize to replace letterbox_image, and calculate the coordinates without x_offset, x_scale and so on, then the result is correct.
from keras-yolo3.
letterbox_image is important.
from keras-yolo3.
I also got bounding boxes at wrong location, same as @szxwpp. May I have the piece of code you @szxwpp did to fix it? Not quit sure how to change the code based on "used cv2:resize to replace letterbox_image, and calculate the coordinates without x_offset, x_scale and so on".
This might just be I'm using a different version of some python package.
I'm using Python 3.6, keras = 2.1.2, tensorflow 1.5.1 on a mac os.
May I have something like a environment.yml for anoconda for your repo @experiencor?
Thanks a lot!
from keras-yolo3.
"used cv2:resize to replace letterbox_image, and calculate the coordinates without x_offset, x_scale and so on" is the wrong way to do things. Just use my code exactly. Fine with both 2.7 and 3.6.
from keras-yolo3.
Thank you very much for the quick reply! I have Python 3.6, Keras 2.1.2, tensorflow 1.5.1
I used command:
python yolo3_one_file_to_detect_them_all.py -w yolov3.weights -i dog.jpg
Do you have some suggestions for where I may look at to make the bounding box same as your result?
Here is the bounding box information I got when printing them out in the draw_boxes function.
The vertices matches what's shown in image, so maybe I got different values before entering this function:
bicycle: 99.36379194259644%
box vertex 164 141 562 471
dog: 98.62090945243835%
box vertex 128 236 313 551
truck: 92.9111659526825%
box vertex 473 106 689 192
Here is where I added print statements:
for i in range(len(labels)):
if box.classes[i] > obj_thresh:
label_str += labels[i]
label = i
print(labels[i] + ': ' + str(box.classes[i]*100) + '%')
print("box vertex", box.xmin, box.ymin, box.xmax, box.ymax)
from keras-yolo3.
Thank you for your help @experiencor ! Bounding box is correct now : ) In case anyone has the same issue, I'm using Ubuntu 16.04.3, python 2.7 and Keras 2.1.2, tensorflow 1.8
from keras-yolo3.
Related Issues (20)
- Custom Dataset Low Map and No Convergence(with images!) HOT 9
- ValueError: not enough values to unpack (expected 4, got 1) HOT 1
- Question about mAP calculation
- TypeError: 'Image' object is not subscriptable
- How do you determine recall and precision?
- How to get precision and recall values
- Where are the weights from backend.h5 from? HOT 1
- ValueError: Can't convert Python sequence with mixed types to Tensor. HOT 2
- Low precision, high recall
- Very slow inference speed
- tf.Print is deprecated
- Early stop on train HOT 1
- ne https://github.com/experiencor/keras-yolo3.git
- ZeroDivisionError: float division by zero
- ValueError Exception on batch_seen variable HOT 2
- Problem training the model
- Prolem training the raccoon example
- What am I missing.
- Detection, Float32 overflow to inf HOT 1
- Channel Dimension Issue
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keras-yolo3.