Git Product home page Git Product logo

Comments (23)

zigaLuksic avatar zigaLuksic commented on June 24, 2024 1

You can train a model on Slovenian data and apply it to Ukraine, yes

however since the model will be trained on the Slovenian surface, it will very likely perform worse on Ukraine than a model trained on Ukrainian surface. It mostly depends on how similar the two regions are, for instance a model trained on Slovenia will perform poorly in Egypt (lots of bare land) or Norway (lots of snow and sea).

If you are lacking good quality data in Ukraine it might still be worth a try. In the past we also tried mixing high-accuracy (in terms of label) Slovenian data and lower accuracy data from a different country (where only some regions had good labels for instance).

from eo-learn.

zigaLuksic avatar zigaLuksic commented on June 24, 2024

Hi @fuckingsore
here it an example of how we did land-cover/land-use classification for Slovenia, it might be the starting point that you're looking for.

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

Hi, thank you.
On which sites and how can I find these files, but with geodata of Ukraine?
svn_border.geojson
land_use_10class_reference_slovenia_partial.gpkg

from eo-learn.

zigaLuksic avatar zigaLuksic commented on June 24, 2024

I do not know where you could find LULC data for Ukraine, since it's very country specific.
You might have some luck with the OSM data or perhaps this. You might be able to find some more data online.

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

Why I have problems with these imports?
pycharm64_SsjhvIeoMb

from eo-learn.

zigaLuksic avatar zigaLuksic commented on June 24, 2024

Why I have problems with these imports?

Seems like you are trying to run some outdated code

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

Thanks, that's what I thought

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

Good evening.
If I run your example with Slovenia, and then just substitute pictures of Ukraine, will I get a classification of the land of Ukraine?

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

I don't understand what I need to change in order to run a trained model on Slovenian data to classify the territory of Ukraine. Tell me what needs to be changed in this example and how, please.
https://github.com/sentinel-hub/eo-learn/blob/master/examples/land-cover-map/SI_LULC_pipeline.ipynb

from eo-learn.

mlubej avatar mlubej commented on June 24, 2024

Hi @fuckingsore

I don't understand what I need to change in order to run a trained model on Slovenian data to classify the territory of Ukraine. Tell me what needs to be changed in this example and how, please.

  1. run the notebook to obtain the model trained on data from Slovenia
  2. create a copy of the notebook and keep the sections for downloading data and applying the model to get the predictions
  3. change the area and time of interest to suit your needs and run the predictions on the obtained data using the model from step 1.

For more information, you can follow along the blog posts on medium:

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

So I need to change geojson from step 1? but how to change it correctly so that it fits the code further?

from eo-learn.

mlubej avatar mlubej commented on June 24, 2024

So I need to change geojson from step 1? but how to change it correctly so that it fits the code further?

Once the AOI is set and the eopatches are downloaded, it doesn't matter where the eopatches are coming from, from the code point of view it should all fit together regardless.

At the same time, the notebook is just an example tutorial on how to use the library and how to construct a pipeline for land use classification, it is not meant to be an out-of-the-box solution for all kinds of problems, so it is expected of the users to make changes of their own and use it as a base to build their own project.

My suggestion would be to try to understand how it all fits together and read the documentation and the blog posts for details. We cannot solve the whole problem for you, but we are happy to help with details and specific problems. However, please keep in mind to provide specific details about the problem you are facing, comments like above are too vague and hard to pinpoint the exact issues you are dealing with.

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

Why there is this error and how fix it?

Draw the RGB image

fig, axs = plt.subplots(nrows=5, ncols=5, figsize=(20, 20))

time_id = np.where(feature_importances == np.max(feature_importances))[0][0]

for i in tqdm(range(len(patchIDs))):
sample_path = os.path.join(EOPATCH_SAMPLES_FOLDER, f"eopatch_{i}")
eopatch = EOPatch.load(sample_path, lazy_loading=True)
ax = axs[i // 5][i % 5]
ax.imshow(np.clip(eopatch.data["FEATURES"][time_id][..., [2, 1, 0]] * 2.5, 0, 1))
ax.set_xticks([])
ax.set_yticks([])
ax.set_aspect("auto")
del eopatch

fig.subplots_adjust(wspace=0, hspace=0)
pycharm64_TgspZGUT3F

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

And I also have this error in this part of code:
fig, axs = plt.subplots(nrows=5, ncols=5, figsize=(20, 25))

for i in tqdm(range(len(patchIDs))):
eopatch_path = os.path.join(EOPATCH_SAMPLES_FOLDER, f"eopatch_{i}")
eopatch = EOPatch.load(eopatch_path, lazy_loading=True)
ax = axs[i // 5][i % 5]
im = ax.imshow(eopatch.mask_timeless["LBL_GBM"].squeeze(), cmap=lulc_cmap, norm=lulc_norm)
ax.set_xticks([])
ax.set_yticks([])
ax.set_aspect("auto")
del eopatch

fig.subplots_adjust(wspace=0, hspace=0)

cb = fig.colorbar(im, ax=axs.ravel().tolist(), orientation="horizontal", pad=0.01, aspect=100)
cb.ax.tick_params(labelsize=20)
cb.set_ticks([entry.id for entry in LULC])
cb.ax.set_xticklabels([entry.name for entry in LULC], rotation=45, fontsize=15)
plt.show()
pycharm64_55iZ2628jp

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

Before I used another geojson, eopatches were downloaded successfully and in first part of this notebook rgb picture was painted

from eo-learn.

mlubej avatar mlubej commented on June 24, 2024

The first error states you are trying to access temporal slice 11, but the size of the temporal array is 2, perhaps manually set the time_id to 0 or 1. Perhaps the data you downloaded is not of the size you expect, so I would check the downloaded eopatches

the second issue is probably related to some problem which occurred in between. You are accessing the LBL_GBM key in the eopatch, but it doesn't seem to exist, meaning that something seemed to have gone wrong in the prediction step. What exactly went wrong, I cannot say.

What is the temporal range you are using?

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

I used temporal range 2022-06-01, 2022-06-30

from eo-learn.

mlubej avatar mlubej commented on June 24, 2024

I used temporal range 2022-06-01, 2022-06-30

Well, that explains it. You are using 1 month of data with Sentinel-2 imagery, there aren't always that many satellite images available in such a short time span, especially with cloud filtering applied.

The classification process in the notebook expects a full year worth of data, so try to change as little as possible aside from the AOI and year of the time period if you don't wish to run into unexpected problems

from eo-learn.

mlubej avatar mlubej commented on June 24, 2024

For starters I would suggest focusing on a small AOI in Ukraine and 1 year of data, so you can create a working prototype of the project. Perhaps you could use a shorter period than 1 year, but definitely more than just a few months.

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

Hello, guys!
Why does this happen? The area is ~13900 km2.
In QGIS and on first step, I have correct image of this area.
pycharm64_3E3CCvc8V2
pycharm64_6HetsFUlsT

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

I have one more question. If I understand correctly, you collect data per pixel for almost a year. This is so that the result is not affected by the time of year. Can I train a model based on just one snapshot, i.e. split the time series into separate data and train on that? Is it realistic to implement and how to implement it correctly?

from eo-learn.

mlubej avatar mlubej commented on June 24, 2024

Why does this happen? The area is ~13900 km2.

the area that you are splitting seems to span 2 UTM zones, so the one on the right is plotted with the wrong UTM zone. Probably the notebook you are using to plot assumes a single UTM vector file, so if you want a proper plot, you should convert to some common CRS (like WGS84) just for plotting.

I have one more question. If I understand correctly, you collect data per pixel for almost a year. This is so that the result is not affected by the time of year.

Correct, or rather to take the full year info into account, so we're not affected by missing data, bad images, or some temporary change on the land.

Can I train a model based on just one snapshot, i.e. split the time series into separate data and train on that? Is it realistic to implement and how to implement it correctly?

You are using the words "one snapshot" and "time series" together, which probably doesn't make sense. If you use just one snapshot, there will be no time series, just a single image.

But sure, you can still do classification based on a single image, but as I mentioned, that image has to be nearly perfect (no clouds, cloud shadows, haze, artifacts, etc... ), in those areas the classification will likely fail

from eo-learn.

fuckingsore avatar fuckingsore commented on June 24, 2024

Thank you, guys!)

from eo-learn.

Related Issues (20)

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.