-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
image_width and image_height incorrect in database #2485
Comments
We also have these lines in
Not sure if any other values need to change based on changing the image width. Honestly don't know what the alpha values are used for. |
Well, I may have found a problem with our
So if the coordinate is negative, we've been adding the image width to it. And that image width was not always correct :) Just did a test on a label and it had an x value of -757. Then 13312 was added to it, so it's set to 12555. But I think we should have added 16384 to it, bringing it to 15627. And even
It might take some work to figure out how incorrect our data are and how much we will be able to fix. |
Ugh, that's no good. So two things here:
|
image_width
and image_height
incorrect in database
Hi @misaugstad, I've put together a sample list of label_ids for dropped curbs where I felt the crops were not making much sense (no dropped curb in the vicinity of the crop). As you mentioned in Depth data endpoint removed, need to get metadata elsewhere #8 it looks like all these odd label positions only seem to occur in the larger gsv image size of (16384, 8192). I tested and observed all these labels with and without a scaling factor for sv_x_image and sv_y_image (multiplied by 1.23). This did not improve the position for any crops bar label_id: 116193, which could just be luck. I selected 25 labels as a sample from the roughly ~2,500 crops I processed using the metadata csv you provided me with. There may be human error involved as the label_ids I selected were the ones I deemed as 'incorrect'. This issue seems to occur less often than Labels not placed directly on obstacles #2478 based on the sample crops. Example: As always, let me know if this is useful, or if you require further information/samples! |
This is very helpful, thank you! And these are some nice examples we can use to see if we can fix this issue 😉 |
Another thing we are seeing is that the As of right now, we aren't re-rendering labels that were placed in the past on a pano, but that code would be useful once we merge our open PR that does that ;) And we should try adding that kind of code to the label viewers in LabelMap, Gallery, and the Admin page to see if that improves label placement. Given that the Cross-posting with #2741 |
Oops, there's a little more to do here! Will update soon. |
@shokiami just sent us a CSV with a list of pano ids along with the error in pixels of the GSV to 2D translation. I wasn't sure where to add this? Maybe in sidewalk-panorama-tools? I know @crescendochu is interested in this as well. |
Below are some updates on things that were talked about in this thread. These are the less important updates, so I kind of want to just separate them out into their own comment. More coming soon on errors in the actual
|
Now the juicy stuff: The As noted above, one big reason for the incorrect
I have also just found cases where the way we calculate the angle is just straight up wrong. I'm not totally sure what the old math is trying to do, but it seems to only be accurate when the Our old way of calculating the
Here's the new way that I'm doing it (note that the
An example! Let's look at label
Here's what we get with our two different methods:
Here is what the label looks like: And here are the two locations that we get: Can we fix the old data? Yes! Is it just a simple SQL query? I don't think so! Thankfully, we have all the data that we need. But there is a lot of math that we have to do to get from what we have to the new Either way, I think that the next step should be to write that script/query, and then compare that to the data that we have now. I want to see how much of our data would change by a significant number of pixels. How drastic of a change would it be? I'd love to see how that directly impacts CV performance, but I'm not sure that that's worth my time unless someone else already has something set up that would make it easy to test this. Then we should make the update assuming that all looks good! I believe that we have multiple CV projects with partners ongoing rn, so fixing this is probably a pretty high priority... Always interested to hear you thoughts @jonfroehlich! Some other notes as I wrap up for the day:
|
Wow, I could hug you @misaugstad. Such great work. Woohoo! I agree that this is high priority. Are the test cases that @shokiami sent useful? @crescendochu said she also might have some good test cases (where labels seemed off after 2D translation). Also, would love to fix this retrospectively for all data if possible... given again that most projects will use our old data too. |
I don't think that they've been helpful thus far. I think that the values in there include the adjustments that they had made to the location of label through the cropper. So the x/y values in there aren't the same ones that we have in the database. And all of the errors listed in that CSV are on the order of like 10-200 pixels, whereas I'm dealing above with errors that are more in the realm of many 100s of pixels. That being said, this may be more helpful when I look at
Totally agree. I'm totally fine with leaving DC as our pilot, and I consider the data after that to be important, and we have a lot of it! |
Gotcha. Thanks for the update. Now that your brain is "dug in" on this, I think it would be most efficient to continue the deep dive and continue the explorations of Exciting to have this update! |
In #3192 I just fixed the I just took a look at The issue with Super easy to fix both retroactively and for the future (we just need to update it downstream in CV pipelines). For the future, we need to change this line
to this
Retroactively would look something like
Then there is still the issue where we know that the |
Before we do the retrospective fixes, let's make sure we create backups of all city databases. I think you'd do this anyway but just emphasizing that :) |
Great point. Now seems like a decent time to take a snapshot of each database, so I'll get started on that today! |
As pointed out in this comment on the sidewalk-panorama-tools repo, the
sv_image_width
andsv_image_height
values are not always correct in our database. I investigated a bit further. It turns out that a fixed width and height were coded in from the beginning:And that is the resolution of (at least most of) the imagery in DC, but that is not always the resolution of GSV imagery. In Seattle, there are often higher resolution images (16384x8192).
I did some digging, confirmed that we can get the pano's full width and height from the JavaScript API when we're looking at it on the audit page. And the tile size should actually remain the same (the 512's above), but we should be filling that programmatically as well! We can access all of that in the callback to the
getPanorama
function on the front-end using:This is all great moving forward! Unfortunately, I don't think that there is a way to figure this out programmatically for images that are no longer being hosted by Google. For any where we still have access to the imagery, we should try to backfill the tables to have the correct values though.
The text was updated successfully, but these errors were encountered: