giscience / ohsome2label Goto Github PK
View Code? Open in Web Editor NEWHistorical OpenStreetMap Objects to Machine Learning Training Samples
Home Page: https://github.com/GIScience/ohsome2label
License: MIT License
Historical OpenStreetMap Objects to Machine Learning Training Samples
Home Page: https://github.com/GIScience/ohsome2label
License: MIT License
I am finding the walkthrough for satellite image building detection quite confusing.
I am using a Google Colab instace to test it out.
I have installed the package and then downloaded the tanzania dataset
!pip install ohsome2label
!rm -r tanzania
!ohsome2label --config config.yaml --schema schema.yaml vector
!ohsome2label --config config.yaml --schema schema.yaml label
!ohsome2label --config config.yaml --schema schema.yaml image
!ohsome2label --config config.yaml --schema schema.yaml visualize -t overlay
This works, I have the data downloaded & visualized properly.
But now the walkthrough says that I have to "Copy tf_record_from_coco.py from this repo to the ./ohsome2label/ directory". How can I do this? The package is installed somewhere in the system's native Python directory. Do I really have to go searching for where this package was installed in site-packages
to add this file?
It has been reported that one could get the following error:
when running ohsome2label vector
from the server.
We found out this issue was related to the security certificate check in Python requests, especially via the server traffic.
One easy solution/walkaround is to change the following code in your repo:
ohsome2label/ohsome2label/utils.py
Line 22 in 5921866
just to disable the verification, while a better solution should be considered in the future:
r = requests.get(api, params, verify=False)
While trying to setup training env, I came across the following error -
The following two steps helped me go through these errors -
virtualenv -p python2.7 venv
apt-get install libgeos-dev
apt-get install libgdal-dev
Note that for ohsome2label we still need python3.6 version. One can use different virenv for that.
Hope it helps!
when running for large-sccale image download, one might come up with an requests.exceptions.ConnectionError
Error message:
requests.exceptions.ConnectionError: HTTPConnectionPool(host='t0.tiles.virtualearth.net', port=80): Max retries exceeded with url: /tiles/a12020330203220030.png?g=854&mkt=en-US&token=your_token(Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at 0x7ff69bf7ecf8>: Failed to establish a new connection: [Errno 110] Connection timed out',))
44%|███████████████████████ | 11394/26174 [15:14<19:45, 12.47it/s]
Potential solution:
add request status check and random sleep
Hey, I just flew over your readme and it seems like there happened some sort of formatting or copy-past error in your readme. In the section about "Command line functions", it seems the text that follows is also somehow formatted as a headline and appears twice.
Hi there,
Great tool!
I'm using it to make some segmentation masks for land cover analysis. I notice that a significant drawback in segmentation mode is that almost all highway=* attributes are lines, not polygons. This means that they are left blank in the segmentation labels. Is there any way around this? Otherwise the labels have large gaps where all the roads are. Given that at higher zoom levels, roads are actually extended objects several pixels wide, it would be good to be able to label these. Example below:
Thanks!
The config.yaml on contains the YAML code:
project:
name: kalola
workspace: ./tanzania
project_time: 2021-3-25
task: object detection
osm:
api: ohsome
url: https://api.ohsome.org/v1/elements/geometry
bboxes: [32.463226318359375, -5.032122934090069, 32.48931884765625, -5.019810836520875]
tags:
- {'label': 'building', 'key': 'building', 'value': ''}
timestamp: 2020-10-20
types: polygon
image:
img_api: bing
img_url: http://t0.tiles.virtualearth.net/tiles/a{q}.png?g=854&mkt=en-US&token={token}
api_token : 'REPLACE BY YOURTOKEN'
zoom: 18
But tags
should be a subkey of osm
:
project:
name: kalola
workspace: ./tanzania
project_time: 2021-3-25
task: object detection
osm:
api: ohsome
url: https://api.ohsome.org/v1/elements/geometry
bboxes: [32.463226318359375, -5.032122934090069, 32.48931884765625, -5.019810836520875]
tags:
- {'label': 'building', 'key': 'building', 'value': ''}
timestamp: 2020-10-20
types: polygon
image:
img_api: bing
img_url: http://t0.tiles.virtualearth.net/tiles/a{q}.png?g=854&mkt=en-US&token={token}
api_token : 'REPLACE BY YOURTOKEN'
zoom: 18
During the execution of the comand ohsome2label --config config\config.yaml image
with the following file config.ymal
:
project:
name: TestSentinel
workspace: ./Sentinel_result
project_time: 2020-05-18
task: segmentation
osm:
api: ohsome
url: https://api.ohsome.org/v1/elements/geometry
bboxes: [8.625,49.3711,8.7334,49.4397]
tags:
- {'label': 'urban', 'key': 'landuse', 'value': 'residential'}
- {'label': 'urban', 'key': 'landuse', 'value': 'garages'}
- {'label': 'industry', 'key': 'landuse', 'value': 'railway'}
- {'label': 'industry', 'key': 'landuse', 'value': 'industrial'}
timestamp: 2019-10-20
types: polygon
image:
img_api: sentinel
img_url: https://services.sentinel-hub.com/ogc/wms/{token}?showLogo=false&service=WMS&request=GetMap&layers=ALL-BAND&styles=&format=image%2Ftiff&transparent=1&version=1.1.1&maxcc=20&time=2015-01-01%2F2020-01-01&priority=mostRecent&height=256&width=256&srs=EPSG%3A3857&bbox={bbox}
api_token : 'TOKEN'
zoom: 14
It provided the error below. I never use the operator <<, so I'm not confident in fixing it. From the guide seems that n = 1 << int(tile.z)
could fix it, but this will produce other errors.
File "c:\users\stucchi\documents\github\ohsome2label\ohsome2label\tile.py", line 148, in top_left
n = 1 << tile.z
TypeError: unsupported operand type(s) for <<: 'int' and 'str'
I used python 3.6.8 and shapely 1.7.1, the suggested version of shapely (1.6.4) is not working and provides multiple errors. The 1.7.1 works in the command vector
and label
.
the command of "ohsome2label label" with default config gives me the following error:
I think it is related to
ohsome2label/ohsome2label/label.py
Line 354 in 19f456c
@wuzyzy could you maybe check the dev branch?
If you may use pycharm or other IDE in Windows, there might be error when installing shaply with pip.
The potential solution could be: conda install -c conda-forge shapely=1.6.4
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.