GithubHelp home page GithubHelp logo

giscience / ohsome2label Goto Github PK

View Code? Open in Web Editor NEW
48.0 9.0 5.0 18.88 MB

Historical OpenStreetMap Objects to Machine Learning Training Samples

Home Page: https://github.com/GIScience/ohsome2label

License: MIT License

Python 100.00%
osm deeplearning openstreetmap-historical-data objectdetection

ohsome2label's Issues

Don't know how to proceed with "adding tf_record_from_coco.py to the ./ohsome2label/ directory"

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?

ERROR ConnectionError when requesting from the server

It has been reported that one could get the following error:

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:

r = requests.get(api, params)

just to disable the verification, while a better solution should be considered in the future:

r = requests.get(api, params, verify=False)

walkthrough setup.md tf version and geopandas installation error and fix.

While trying to setup training env, I came across the following error -

The following two steps helped me go through these errors -

  • use it to initiate an env with python 2.7 version
    virtualenv -p python2.7 venv
  • install the following two packages while installing Install System Level Libraries
    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!

requests.exceptions.ConnectionError

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

Copy-paste error in readme

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.

Buffering lines for segmentation

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:

14 8584 5593

Thanks!

Mistake in building detection config.yaml

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

Error in `ohsome2label image` command with Sentinel image from SentineHub

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.

shapely install in Windows

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.