Skip to content

Satelytics/AI-engineer-coding-exercise

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

49 Commits
 
 
 
 

Repository files navigation

Remote-sensing AI engineer coding exercise

You are expected to have a python environment with numpy, matplotlib, scikit-learn and optionally jupyter installed.

Please write your code in a private repository using a version control system (git). Make a tar ball or a zip file of your repository and submit it by email.

If you have questions regarding the following instructions, please create an issue or send us an email.

Numpy, GDAL

Part 1

  1. Install gdal (version>=3) using conda/pip/...
  2. Open a jupyter notebook session or any python session with access to installed gdal
  3. Load data of all bands from swir_ortho_standardized.tif to a numpy array using gdal. The loaded numpy array should have a shape of (8, 653, 502). Hints:
    • Use ds = gdal.Open(path) to open a dataset
    • Use data = ds.ReadAsArray() to read data
    • 653 is number of rows, 502 is number of columns, 8 is number of bands. For each pixel, the data in the 8 bands forms a spectrum for that pixel.
  4. Load the "facility spectrum" numpy array from facility_spectrum_standardized.npy using np.load
  5. Calculate the cosine similarity of the spectra of all pixels with the given "facility spectrum" loaded in the previous step using np.dot, and save the output as an array of shape (653, 502), matching the input image
  6. Plot the cosine similarity using matplotlib and save the plot to an image
  7. Use 0.995 as the threshold, create a mask array where pixels with cosine_similarity > threshold are labeled with value 1, and other pixels labeled with value 0. Plot the mask and save it to an image

Part 2

  1. Instead of just one spectrum in facility_spectrum_standardized.npy, here we need to calculate cosine similarity of spectra for all pixels with 100 reference spectra saved in ref_spectra_standardized.npy. The result should be a 653X502X100 numpy array. You don't need to submit the final result, but please submit your code. Does your code leverage numpy vectorized computation?

Regression

  1. Load training data from train_swir_nr.npy (X) and train_concentration.npy (y). X has 28 features
  2. Fit X to y using a regression model. Please explain the reason behind your choice of regressor.
  3. Make a plot of y_pred (predicted y values from your regression model) vs y
  4. Predict y_test from test data test_swir_nr.npy (Xtest) and save it as a numpy array
  5. Is there a way to reduce the number of features? Discuss and code.
  6. Record your solution in a jupyter notebook or a python script

Image orthorectification

Hints if using OTB for this exercise:

  1. Install OTB (version>=6.6) in a linux box https://www.orfeo-toolbox.org/CookBook/Installation.html#linux
  2. Use the command otbcli_OrthoRectification
  3. Plot the orthorectified image and save it
  4. Wrap the orthorectification procedure in a python function
  5. Write a test function for the new python function you created in the last step

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •