Comments (5)
The examples in the https://github.com/sentinel-hub/eo-learn-examples
are outdated.
The PointSamplingTask
was removed in eo-learn 1.0
, where it was replaced with FractionSamplingTask
(controls sampling via mask) and BlockSamplingTask
(can also sample larger blocks from array). From a quick glance FractionSamplingTask
is what you're looking for, though the interface is slightly different.
from eo-learn.
Thanks:)
I updated signature to below but am not be assigning correct labels back to EOPatches ... this is more my fault at this point as I am not very familiar with the library and plan to dig into basics first.
Just wondering if eo-learn-examples
will be updated in future?
sampling_task = FractionSamplingTask(
fraction=0.10,
sampling_feature=(FeatureType.MASK_TIMELESS, LABELS[1]),
features_to_sample=[(FeatureType.DATA, "FEATURES", "FEATURES_SAMPLED")]
)
from eo-learn.
Just wondering if eo-learn-examples will be updated in future?
We have plenty of ideas, and even longer wishlist, but not enough time for all of them... I hope that yes, we will update the examples repo, but until then, we'd appreciate help. Pull requests welcome!
from eo-learn.
I tried running the notebook to see how to aid you. Since there is no inherent filtering done in sampling, it is better to use BlockSamplingTask
(otherwise some things break further in the notebook since not all eopatches have the same number of samples)
sampling_task = BlockSamplingTask(
amount=100,
features_to_sample=[
(FeatureType.DATA, "FEATURES", "FEATURES_SAMPLED"),
(FeatureType.MASK, "IS_DATA", "IS_DATA_SAMPLED"),
(FeatureType.MASK_TIMELESS, "water_label", "water_label_SAMPLED"),
], # tag fields to sample
)
The new tasks don't rename automatically so I had to pass them renaming schemas.
The next cell is also outdated, but I tried fixing it with minimal adjustments. It requires you to load linearly_connect_tasks
and EOWorkflow
.
# Define the workflow
eonodes = linearly_connect_tasks(load_task, extract_task, ndwi_task, ndmi_task, merge_task, sampling_task, save_task)
load_node, _, _, _, _, sampling_node, save_node = eonodes
workflow = EOWorkflow(eonodes)
We need the nodes because execution arguments are now linked to nodes, not tasks. Also since the EOPatches are old, you'll get a ton of warnings, but it's safe to ignore them.
%%time
import warnings
# Create list of arguments to be passed at run-time
execution_args = []
for idx, eop_name in enumerate(eopatch_names):
execution_args.append(
{load_node: {"eopatch_folder": eop_name}, sampling_node: {"seed": idx}, save_node: {"eopatch_folder": eop_name}}
)
with warnings.catch_warnings():
warnings.simplefilter("ignore")
# Execute workflow in parallel, e.g. each EOPatch is process in parallel in dedicated processes
executor = EOExecutor(workflow, execution_args, save_logs=True)
executor.run(workers=N_WORKERS, multiprocess=True)
# Make report to check possible failures
executor.make_report()
And the rest worked for me.
Another note, sometime next week a new eo-learn version will release. If you wish to run this example stay on your current version, because the new one will no longer load the outdated eopatches used here.
from eo-learn.
Example has since been updated.
from eo-learn.
Related Issues (20)
- SI_LULC_pipeline notebook HOT 9
- readthedocs links not working HOT 1
- [FEAT] Enable timestamp filtering from interval end towards interval start HOT 5
- [BUG] SentinelHubInputTask downloads incorrect timestamps HOT 6
- [BUG] Issue with the SpatialResizeTask in ImportTiffPipeline when using the resolution approach HOT 5
- [BUG] eo-learn installation issue due to open-cv latest update on Dec 30, 2022. HOT 2
- Registration HOT 4
- [BUG] Failing tests on MacOS related to lock-related EOExecutor tests HOT 1
- [BUG] Reading EOPatches saved with eo-learn 0.10.1 with eolearn 1.4 HOT 2
- [HELP] Where has eopatch_to_dataset gone? HOT 6
- [FEAT] TDigestTask handle nans HOT 1
- [HELP] Error when I'm trying to run land-cover-map HOT 5
- [HELP] Perform sen2cor atmospheric correction on L1C EOPatch HOT 2
- [HELP] Using eo-learn for the classification of land surface types of Ukraine HOT 23
- Why I have problems with these imports? HOT 3
- ExecutableNotFound: failed to execute WindowsPath('dot'), make sure the Graphviz executables are on your systems' PATH HOT 3
- how do i fix this HOT 2
- CRSError in rasterio when using ExportToTiffTask HOT 6
- `eo-learn` 1.5.0 migration guide
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from eo-learn.