Closed alvinxiii closed 6 years ago
where should I put? Its not working
ymin = int((boxes[0][0][0]*height))
xmin = int((boxes[0][0][1]*width))
ymax = int((boxes[0][0][2]*height))
xmax = int((boxes[0][0][3]*width))
Result = np.array(img_np[ymin:ymax,xmin:xmax])
You need put it after vis_util.visualize_boxes_and_labels_on_image_array block
For future reference, this question is better asked on StackOverflow since it is not a bug or feature request. There is also a larger community that reads questions there.
If you think we've misinterpreted a bug, please comment again with a clear explanation, as well as all of the information requested in the issue template. Thanks!
ymin = int((boxes[0][0][0]*height)) xmin = int((boxes[0][0][1]*width)) ymax = int((boxes[0][0][2]*height)) xmax = int((boxes[0][0][3]*width)) Result = np.array(img_np[ymin:ymax,xmin:xmax])
You need put it after vis_util.visualize_boxes_and_labels_on_image_array block
& extract image detected 🤓 img_item = "imagename.png" cv2.imwrite(img_item, Result)
box = np.squeeze(boxes) for i in range(len(boxes)): ymin = (int(box[i,0]height)) xmin = (int(box[i,1]width)) ymax = (int(box[i,2]height)) xmax = (int(box[i,3]width)) print(ymin,xmin,ymax,xmax) roi =image[ymin:ymax,xmin:xmax].copy()
ymin = int((boxes[0][0][0]*height)) xmin = int((boxes[0][0][1]*width)) ymax = int((boxes[0][0][2]*height)) xmax = int((boxes[0][0][3]*width)) Result = np.array(img_np[ymin:ymax,xmin:xmax])
You need put it after vis_util.visualize_boxes_and_labels_on_image_array block
& extract image detected nerd_face img_item = "imagename.png" cv2.imwrite(img_item, Result)
hello I need your help. I'm getting error like
name 'boxes' is not defined
ymin = int((boxes[0][0][0]*height)) xmin = int((boxes[0][0][1]*width)) ymax = int((boxes[0][0][2]*height)) xmax = int((boxes[0][0][3]*width)) Result = np.array(img_np[ymin:ymax,xmin:xmax])
You need put it after vis_util.visualize_boxes_and_labels_on_image_array block
& extract image detected nerd_face img_item = "imagename.png" cv2.imwrite(img_item, Result)
hello I need your help. I'm getting error like
name 'boxes' is not defined
u need xmin,ymin and xmax,ymax
boxes[0][0][0]*height why is this for
use this ymin = (int(box[i,0]*height)) format
ymin = int((boxes[0][0][0]*height)) xmin = int((boxes[0][0][1]*width)) ymax = int((boxes[0][0][2]*height)) xmax = int((boxes[0][0][3]*width)) Result = np.array(img_np[ymin:ymax,xmin:xmax])
You need put it after vis_util.visualize_boxes_and_labels_on_image_array block
& extract image detected nerd_face img_item = "imagename.png" cv2.imwrite(img_item, Result)
hello I need your help. I'm getting error like name 'boxes' is not defined
u need xmin,ymin and xmax,ymax
boxes[0][0][0]*height why is this for
use this ymin = (int(box[i,0]*height)) format sir I just used the format as suggested by you. I'm getting following error: object of type 'Tensor' has no len() for this line for i in range(len(boxes)): Initially i was facing a error :: boxes is not defined So i defined boxes as :: boxes = detection_graph.get_tensor_by_name('detection_boxes:0') please let me know a way out to rectify this problem
sir sir I just used the format as suggested by you. I'm getting following error: object of type 'Tensor' has no len() for this line for i in range(len(boxes)): Initially i was facing a error :: boxes is not defined So i defined boxes as :: boxes = detection_graph.get_tensor_by_name('detection_boxes:0') please let me know a way out to rectify this problem
If possible, can you mail me the source code document for object detection with coordinates of object
On Tue, 4 Jun 2019 at 13:55, Vasi Manoj notifications@github.com wrote:
ymin = int((boxes[0][0][0]height)) xmin = int((boxes[0][0][1]width)) ymax = int((boxes[0][0][2]height)) xmax = int((boxes[0][0][3]width))
Result = np.array(img_np[ymin:ymax,xmin:xmax])
You need put it after vis_util.visualize_boxes_and_labels_on_image_array block
& extract image detected nerd_face img_item = "imagename.png" cv2.imwrite(img_item, Result)
hello I need your help. I'm getting error like
name 'boxes' is not defined
u need xmin,ymin and xmax,ymax
boxes[0][0][0]*height why is this for
use this ymin = (int(box[i,0]*height)) format
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/4682?email_source=notifications&email_token=AMH2EMYUI76BPD5VRNQOTADPYYRHVA5CNFSM4FIBM7B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW3Z4NQ#issuecomment-498572854, or mute the thread https://github.com/notifications/unsubscribe-auth/AMH2EMYTCXWYYSQFB5YDB73PYYRHVANCNFSM4FIBM7BQ .
check the png
My code page is totally different could you mail me the code file.
On Tue, 4 Jun 2019 at 15:40, Vasi Manoj notifications@github.com wrote:
[image: bbbox] https://user-images.githubusercontent.com/22527200/58870872-9c9e6a00-86de-11e9-8645-5481dc5a79b9.png check the png
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/tensorflow/models/issues/4682?email_source=notifications&email_token=AMH2EM3HUPWRGWTAM5YAU6TPYY5PPA5CNFSM4FIBM7B2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODW4CT6A#issuecomment-498608632, or mute the thread https://github.com/notifications/unsubscribe-auth/AMH2EMYZZBHG4HEL5ZVRYRTPYY5PPANCNFSM4FIBM7BQ .
ymin = int((boxes[0][0][0]*height)) xmin = int((boxes[0][0][1]*width)) ymax = int((boxes[0][0][2]*height)) xmax = int((boxes[0][0][3]*width)) Result = np.array(img_np[ymin:ymax,xmin:xmax])
You need put it after vis_util.visualize_boxes_and_labels_on_image_array block
& extract image detected nerd_face img_item = "imagename.png" cv2.imwrite(img_item, Result)
hello I need your help. I'm getting error like
name 'boxes' is not defined
Also, this can solve your problem. boxes = output_dict['detection_boxes']
check the png
Hello,
I have the same code as you, but it tells me name height is not defined. Could you help me please ? I'm new o programming.
check the png
Hello,
I have the same code as you, but it tells me name height is not defined. Could you help me please ? I'm new o programming.
Hello,
I guess you wouldnt have given the input image dimensions.
width, height = image.shape[:2]
You should mention this line before. Hope this helps !!
check the png
Hello, I have the same code as you, but it tells me name height is not defined. Could you help me please ? I'm new o programming.
Hello,
I guess you wouldnt have given the input image dimensions.
width, height = image.shape[:2]
You should mention this line before. Hope this helps !!
Yes it did, thank you very much.
But i'm not sure if the coordinates i have got matches the number of bounding boxes i have in my image.
Hello,
I need someone to help me, i want to extract the actual coordinates of the detected objects along with their class. But the coordinates which i'm getting are normalized values. is there any way to get the actual coordinates?
Hello,
I need someone to help me, i want to extract the actual coordinates of the detected objects along with their class. But the coordinates which i'm getting are normalized values. is there any way to get the actual coordinates?
Hello,
you can take the bounding box, BBOX = ymin, xmin, ymax, xmax
Then multiply with the width and height of the image. final_box = ymin X width, xmin X height, ymax X width, xmax X height
Hope it helps !!
Hello @ebinzacharias ,
Can you please share me your code?. Because, i need to calculate mAP (mean average precision) for evaluation purpose. And i'm sharing normalized cordinates which i am getting.
Hello @ebinzacharias ,
Can you please share me your code?. Because, i need to calculate mAP (mean average precision) for evaluation purpose. And i'm sharing normalized cordinates which i am getting.
Hi,
Take, bboxes = boxes[scores > min_score_thresh] width, height = image.shape[:2] final_box = [] for box in bboxes: ymin, xmin, ymax, xmax = box final_box = [int(ymin width), int(xmin height), int(ymax width), int(xmax height)]
Try this way.
Hello,
I have a problem in evaluating my object detection model. The ground truth which i have is completely different from the predicted truth, i mean the xmin, ymin, xmax and ymax and completely different. Someone help me!!!
Ground Truth: xmin>112.7490234375, ymin>17.1455078125, xmax>277.3284606933594, ymax>167.75123596191406 xmin>6.78125, ymin>6.27734375, xmax>87.906494140625, ymax>154.94227600097656
Predicted Truth: array([0.03908414, 0.01921505, 0.8721036 , 0.3157735 ] array([0.10951501, 0.4028356 , 0.9246461 , 0.97304785].
How to get the coordinates in similar format of ground truth from the model?
Hi all, I have an image with two detected boxes. I am trying to extract those two boxes, but the boxes array contains only one box. To clarify: I am seeing that the model detects and marks the two boxes on the original image, but when I am trying to follow the instructions above (for extracting those two boxes), I am able to extract only one. Can anybody explain to me please, why is that?
Hi @hiteshreddy95 @ashaffir ,
Did you try this ?
Hello @ebinzacharias , Can you please share me your code?. Because, i need to calculate mAP (mean average precision) for evaluation purpose. And i'm sharing normalized cordinates which i am getting.
Hi,
Take, bboxes = boxes[scores > min_score_thresh] width, height = image.shape[:2] final_box = [] for box in bboxes: ymin, xmin, ymax, xmax = box final_box = [int(ymin width), int(xmin height), int(ymax width), int(xmax height)]
Try this way.
Hi @hiteshreddy95 @ashaffir ,
Did you try this ?
Hello @ebinzacharias , Can you please share me your code?. Because, i need to calculate mAP (mean average precision) for evaluation purpose. And i'm sharing normalized cordinates which i am getting.
Hi, Take, bboxes = boxes[scores > min_score_thresh] width, height = image.shape[:2] final_box = [] for box in bboxes: ymin, xmin, ymax, xmax = box final_box = [int(ymin width), int(xmin height), int(ymax width), int(xmax height)] Try this way.
Also, take the box coordinates first from output_dict['detection_boxes'].
For instance,
boxes = output_dict['detection_boxes'] for i in range(min(max_boxes_to_draw, boxes.shape[0])): -----if scores is None or scores[i] > min_score_thresh: ----------class_name = category_index[output_dict['detection_classes'][i]]['name']
you can get the boxes and class afterwards !
Excellent!! Thanks
Hello, thank you for your interactions everyone. I need some help in here too, My model in Tensorflow is able to detect all the objects windows in my case, but it does not draw all the corresponding boxes (I know it detects all because when i extract coordinates, it gives me coordinates of all the windows in the façade)
Does enyone have any idea ? Thanks in advance!
Hello, thank you for your interactions everyone. I need some help in here too, My model in Tensorflow is able to detect all the objects windows in my case, but it does not draw all the corresponding boxes (I know it detects all because when i extract coordinates, it gives me coordinates of all the windows in the façade)
Does enyone have any idea ? Thanks in advance!
Hello,
It seems like it draws 20 bounding boxes as per your image. This is a preset value for Tensorflow object detection API.
So change it to either None or the required number ! Changing it to None, will show all the detected bounding boxes.
Edit the File: visualization_utils.py
Path = models/research/object_detection/utils/visualization_utils.py look for "max_boxes_to_draw"
Hope it helps !
Hello, thank you for your interactions everyone. I need some help in here too, My model in Tensorflow is able to detect all the objects windows in my case, but it does not draw all the corresponding boxes (I know it detects all because when i extract coordinates, it gives me coordinates of all the windows in the façade) Does enyone have any idea ? Thanks in advance!
Hello,
It seems like it draws 20 bounding boxes as per your image. This is a preset value for Tensorflow object detection API.
So change it to either None or the required number ! Changing it to None, will show all the detected bounding boxes.
Edit the File: visualization_utils.py
Path = models/research/object_detection/utils/visualization_utils.py look for "max_boxes_to_draw"
Hope it helps !
Hi, thank you for the answer, even though it looked so logical and correct it didnt work...it's like nothing changed when i changed the max boxes to draw number, unfornately
Hello, thank you for your interactions everyone. I need some help in here too, My model in Tensorflow is able to detect all the objects windows in my case, but it does not draw all the corresponding boxes (I know it detects all because when i extract coordinates, it gives me coordinates of all the windows in the façade) Does enyone have any idea ? Thanks in advance!
Hello, It seems like it draws 20 bounding boxes as per your image. This is a preset value for Tensorflow object detection API. So change it to either None or the required number ! Changing it to None, will show all the detected bounding boxes. Edit the File: visualization_utils.py Path = models/research/object_detection/utils/visualization_utils.py look for "max_boxes_to_draw" Hope it helps !
Hi, thank you for the answer, even though it looked so logical and correct it didnt work...it's like nothing changed when i changed the max boxes to draw number, unfornately
Hello,
Which visualisation drawing function are you using?
Also in which function did you change the value ?
Did you check that ??
Hello, thank you for your interactions everyone. I need some help in here too, My model in Tensorflow is able to detect all the objects windows in my case, but it does not draw all the corresponding boxes (I know it detects all because when i extract coordinates, it gives me coordinates of all the windows in the façade) Does enyone have any idea ? Thanks in advance!
Hello, It seems like it draws 20 bounding boxes as per your image. This is a preset value for Tensorflow object detection API. So change it to either None or the required number ! Changing it to None, will show all the detected bounding boxes. Edit the File: visualization_utils.py Path = models/research/object_detection/utils/visualization_utils.py look for "max_boxes_to_draw" Hope it helps !
Hi, thank you for the answer, even though it looked so logical and correct it didnt work...it's like nothing changed when i changed the max boxes to draw number, unfornately
Hello,
Which visualisation drawing function are you using?
Also in which function did you change the value ?
Did you check that ??
I changed in the function in the photo. What do you mean by drawing function ?
Hello, thank you for your interactions everyone. I need some help in here too, My model in Tensorflow is able to detect all the objects windows in my case, but it does not draw all the corresponding boxes (I know it detects all because when i extract coordinates, it gives me coordinates of all the windows in the façade) Does enyone have any idea ? Thanks in advance!
Hello, It seems like it draws 20 bounding boxes as per your image. This is a preset value for Tensorflow object detection API. So change it to either None or the required number ! Changing it to None, will show all the detected bounding boxes. Edit the File: visualization_utils.py Path = models/research/object_detection/utils/visualization_utils.py look for "max_boxes_to_draw" Hope it helps !
Hi, thank you for the answer, even though it looked so logical and correct it didnt work...it's like nothing changed when i changed the max boxes to draw number, unfornately
Hello, Which visualisation drawing function are you using? Also in which function did you change the value ? Did you check that ??
I changed in the function in the photo. What do you mean by drawing function ?
As you can see this is the function to draw bounding boxes on image tensors.
In your main code, which function are you calling for drawing the bounding boxes? Check that and change the value in the corresponding function in the util file.
If you havent changed anything, then you must be using "visualize_boxes_and_labels_on_image_array".
Then check for this function and change it there !!!
Hello, thank you for your interactions everyone. I need some help in here too, My model in Tensorflow is able to detect all the objects windows in my case, but it does not draw all the corresponding boxes (I know it detects all because when i extract coordinates, it gives me coordinates of all the windows in the façade) Does enyone have any idea ? Thanks in advance!
Hello, It seems like it draws 20 bounding boxes as per your image. This is a preset value for Tensorflow object detection API. So change it to either None or the required number ! Changing it to None, will show all the detected bounding boxes. Edit the File: visualization_utils.py Path = models/research/object_detection/utils/visualization_utils.py look for "max_boxes_to_draw" Hope it helps !
Hi, thank you for the answer, even though it looked so logical and correct it didnt work...it's like nothing changed when i changed the max boxes to draw number, unfornately
Hello, Which visualisation drawing function are you using? Also in which function did you change the value ? Did you check that ??
I changed in the function in the photo. What do you mean by drawing function ?
As you can see this is the function to draw bounding boxes on image tensors.
In your main code, which function are you calling for drawing the bounding boxes? Check that and change the value in the corresponding function in the util file.
If you havent changed anything, then you must be using "visualize_boxes_and_labels_on_image_array".
Then check for this function and change it there !!!
BLESS YOU! It worked, thank you :)
Hello, thank you for your interactions everyone. I need some help in here too, My model in Tensorflow is able to detect all the objects windows in my case, but it does not draw all the corresponding boxes (I know it detects all because when i extract coordinates, it gives me coordinates of all the windows in the façade) Does enyone have any idea ? Thanks in advance!
Hello, It seems like it draws 20 bounding boxes as per your image. This is a preset value for Tensorflow object detection API. So change it to either None or the required number ! Changing it to None, will show all the detected bounding boxes. Edit the File: visualization_utils.py Path = models/research/object_detection/utils/visualization_utils.py look for "max_boxes_to_draw" Hope it helps !
Hi, thank you for the answer, even though it looked so logical and correct it didnt work...it's like nothing changed when i changed the max boxes to draw number, unfornately
Hello, Which visualisation drawing function are you using? Also in which function did you change the value ? Did you check that ??
I changed in the function in the photo. What do you mean by drawing function ?
As you can see this is the function to draw bounding boxes on image tensors. In your main code, which function are you calling for drawing the bounding boxes? Check that and change the value in the corresponding function in the util file. If you havent changed anything, then you must be using "visualize_boxes_and_labels_on_image_array". Then check for this function and change it there !!!
BLESS YOU! It worked, thank you :)
Great :))
Happy to know !!
I am not able to extract the multiple coordinates of the bounding boxes by using the below code can someone help me how to extract multiple coordinates?
width, height= image_np.shape[:2]
box = np.squeeze(boxes) for i in range(len(boxes)): ymin = (int(box[i, 0] height)) xmin = (int(box[i, 1] width)) ymax = (int(box[i, 2] height)) xmax = (int(box[i, 3] width))
print(ymin,xmin,ymax,xmax) roi = image_np[ymin:ymax, xmin:xmax].copy()
Hi @hiteshreddy95 @ashaffir ,
Did you try this ?
Hello @ebinzacharias , Can you please share me your code?. Because, i need to calculate mAP (mean average precision) for evaluation purpose. And i'm sharing normalized cordinates which i am getting.
Hi, Take, bboxes = boxes[scores > min_score_thresh] width, height = image.shape[:2] final_box = [] for box in bboxes: ymin, xmin, ymax, xmax = box final_box = [int(ymin width), int(xmin height), int(ymax width), int(xmax height)] Try this way.
I am using the below code and i am getting an error
I am getting an error
can someone help me with this?
Hi @hiteshreddy95 @ashaffir , Did you try this ?
Hello @ebinzacharias , Can you please share me your code?. Because, i need to calculate mAP (mean average precision) for evaluation purpose. And i'm sharing normalized cordinates which i am getting.
Hi, Take, bboxes = boxes[scores > min_score_thresh] width, height = image.shape[:2] final_box = [] for box in bboxes: ymin, xmin, ymax, xmax = box final_box = [int(ymin width), int(xmin height), int(ymax width), int(xmax height)] Try this way.
I am using the below code and i am getting an error
I am getting an error
can someone help me with this?
hey, this is my code for geeting coordinates and it's working just fine:
height, width = image.shape[:2] box= np.squeeze(boxes) max_boxes_to_draw=box.shape[0] scores=np.squeeze(scores) min_score_thresh=0.5 for i in range (min(max_boxes_to_draw, box.shape[0])): if scores [i] > min_score_thresh: ymin = (int(box[i,0]height)) xmin = (int(box[i,1]width)) ymax = (int(box[i,2]height)) xmax = (int(box[i,3]width)) print (xmin,ymin,xmax,ymax)
I on the other hand have issue in knowing which coordinates belongs to which box, as i have multiple boxes in one image (around 25), Do you have any idea ?
hi guys. HELP! How do I measure the distance between the objects I detected on the webcam?
Hi @hiteshreddy95 @ashaffir , Did you try this ?
Hello @ebinzacharias , Can you please share me your code?. Because, i need to calculate mAP (mean average precision) for evaluation purpose. And i'm sharing normalized cordinates which i am getting.
Hi, Take, bboxes = boxes[scores > min_score_thresh] width, height = image.shape[:2] final_box = [] for box in bboxes: ymin, xmin, ymax, xmax = box final_box = [int(ymin width), int(xmin height), int(ymax width), int(xmax height)] Try this way.
I am using the below code and i am getting an error I am getting an error can someone help me with this?
hey, this is my code for geeting coordinates and it's working just fine:
height, width = image.shape[:2] box= np.squeeze(boxes) max_boxes_to_draw=box.shape[0] scores=np.squeeze(scores) min_score_thresh=0.5 for i in range (min(max_boxes_to_draw, box.shape[0])): if scores [i] > min_score_thresh: ymin = (int(box[i,0]height)) xmin = (int(box[i,1]width)) ymax = (int(box[i,2]height)) xmax = (int(box[i,3]width)) print (xmin,ymin,xmax,ymax)
I on the other hand have issue in knowing which coordinates belongs to which box, as i have multiple boxes in one image (around 25), Do you have any idea ?
Did you find any solution ?
Is it possible to get the coordinates of the detected object through video object detection? For example, topleft, bottomright coordinates.
code :