wayground logo

Free Printable Worksheets

NEW

Font size

S
M
L
XL
Worksheets

Section 1: Python and File Operations (Q1–10)

Total questions: 75

Worksheet time: 38mins

Name
Class
Date
1.

What is the purpose of os.makedirs(OUT_DIR, exist_ok=True)?

a)

Deletes the directory

b)

Creates OUT_DIR if it doesn't exist

c)

Moves files into OUT_DIR

d)

Renames the output directory

2.

What does BASE = "/content/drive/MyDrive/Tree_Canopy" represent?

a)

A Python package

b)

Input image path

c)

Base directory for I/O

d)

TensorFlow variable

3.

What happens when you run os.kill(os.getpid(), 9)?

a)

Starts a new process

b)

Saves the model

c)

Terminates the Python process

d)

Restarts Google Colab

4.

Which module is used to mount Google Drive?

a)

shutil

b)

drive

c)

google.colab

d)

pathlib

5.

What is the purpose of reproject() from rasterio.warp?

a)

Clip raster

b)

Plot raster

c)

Align rasters to the same CRS and grid

d)

Rename files

6.

What does transform = src.transform retrieve?

a)

File path

b)

Coordinate transformation matrix

c)

Image histogram

d)

Projection WKT

7.

What kind of data is crs = src.crs?

a)

File size

b)

Spatial resolution

c)

Coordinate Reference System

d)

Image filter

8.

What is the output of src.read(1)?

a)

A vector file

b)

A scalar value

c)

A 2D array (raster band)

d)

An image preview

9.

What type of file is Tree_Crowns2.gpkg?

a)

JSON

b)

GeoPackage

c)

Text file

d)

JPEG

10.

What does CHM_PATH store?

a)

3D building model

b)

Filtered Canopy Height Model

c)

Orthomosaic RGB

d)

DEM

11.

What is the purpose of subtracting DTM from DSM?

a)

Detect roads

b)

Generate CHM (Canopy Height Model)

c)

Extract soil features

d)

Calculate NDVI

12.

Which unit is the CHM calculated in?

a)

Inches

b)

Feet

c)

Meters

d)

Pixels

13.

Which library is used to open raster files?

a)

geopandas

b)

pandas

c)

rasterio

d)

shapely

14.

What is the purpose of gaussian_filter()?

a)

Normalize RGB

b)

Detect edges

c)

Smooth raster data

d)

Compute histogram

15.

What is a valid nodata handling technique?

a)

Fill with ones

b)

Replace with 0 only

c)

Replace with np.nan

d)

Ignore it

16.

What does the features.shapes() function return?

a)

Raster band

b)

Polygon geometries from labeled regions

c)

CHM histogram

d)

Coordinate lists

17.

Which Python library is used for vector data processing?

a)

rasterio

b)

fiona

c)

geopandas

d)

shapely

18.

What does maximum_filter() detect in the CHM?

a)

NDVI

b)

Tree shadows

c)

Local peaks (tree tops)

d)

Water bodies

19.

Which unit is crown area calculated in?

a)

Pixels

b)

Hectares

c)

Square meters

d)

Kilometers

20.

What is watershed() used for in this context?

a)

Predict water flow

b)

Segment tree crowns

c)

Clip DEM

d)

Apply edge detection

21.

What is the purpose of gdf_crowns["height_m"]?

a)

Slope angle

b)

Tree width

c)

Max height per crown

22.

What does rasterio.transform.xy() compute?

a)

Polygon area

b)

Real-world coordinates from row/col

c)

Distance between points

d)

Raster cell values

23.

What does gpd.points_from_xy(xs, ys) create?

a)

A raster file

b)

Tree centroid points

c)

Polygon features

d)

Buffer zones

24.

What does df_pts.to_csv() do?

a)

Save shapefile

b)

Save tree point data in CSV format

c)

Export raster

d)

Generate HTML

25.

What is the minimum height used to detect trees?

a)

0.5 m

b)

1.0 m

c)

2.0 m

d)

5.0 m

26.

Why is chm[chm < 0] = 0 used?

a)

Apply smoothing

b)

Resample image

c)

Clean artifacts (negative height)

d)

Remove low trees

27.

What is PIX_M used for?

a)

Count trees

b)

Convert pixel to meters

c)

Raster reclassification

d)

Project image

28.

What function detects tree tops based on CHM?

a)

gaussian_filter

b)

maximum_filter

c)

uniform_filter

d)

binary_closing

29.

What does the expression NDVI = (NIR - R) / (NIR + R) calculate?

a)

Soil composition

b)

Vegetation health

c)

Crown area

d)

Height difference

30.

Why is exg_mask = ExG >= EXG_THR used?

a)

Segment buildings

b)

Detect water

c)

Create RGB mask for trees

d)

Create a DTM

31.

Which library is used for tree crown detection?

a)

FastAI

b)

DeepForest

c)

XGBoost

d)

PyTorch Lightning

32.

What kind of model is DeepForest?

a)

Semantic segmentation model

b)

Object detection model

c)

Clustering algorithm

d)

Regression model

33.

What type of image does DeepForest expect?

a)

Grayscale

b)

RGB (3 bands)

c)

NDVI only

d)

Hyperspectral

34.

What does model.use_release() do?

a)

Plot CHM

b)

Load pretrained model

c)

Segment crowns

d)

Download custom weights

35.

What does the predict_image() function return?

a)

Points only

b)

Bounding box detections

c)

Loss value

d)

Mask layer

36.

What does the parameter DF_SCORE = 0.20 represent?

a)

Batch size

b)

Confidence score threshold

c)

Height threshold

d)

Number of classes

37.

Which input is not required by DeepForest?

a)

RGB image

b)

CHM

c)

Numpy array

d)

RGB channels (3-band)

38.

Which of the following is a DeepForest output?

a)

Segmentation mask

b)

Bounding box coordinates

c)

Soil depth

d)

Vegetation index

39.

What kind of deep learning model underpins DeepForest?

a)

UNet

b)

RetinaNet

c)

Transformer

d)

KMeans

40.

What is a common use case of DeepForest?

a)

Urban planning

b)

Tree crown detection in RGB orthomosaics

c)

Climate forecasting

d)

Sea temperature prediction

41.

What type of file is Tree_Points2.csv?

a)

Raster

b)

Table with coordinates and tree attributes

c)

Vector

d)

Binary

42.

What does Tree_Crowns2.gpkg contain?

a)

NDVI layers

b)

Bounding boxes

43.

Which field is not in the tree points CSV?

a)

tree_id

b)

X

c)

canopy type

d)

height_m

44.

What does the geometry column represent in GeoDataFrames?

a)

Projection

b)

CRS definition

c)

Spatial features (points, polygons)

d)

Color channels

45.

What does the to_file() method save?

a)

Raster

b)

CSV

c)

Vector geospatial data

d)

Text log

46.

What is the CRS used for in geospatial files?

a)

Color Rendering Scheme

b)

Coordinate Reference System

c)

Compression Ratio Setting

d)

Cell Raster Statistics

47.

What format is typically used for raster data output?

a)

.csv

b)

.tif

c)

.gpkg

d)

.json

48.

What does gdf_crowns["crown_area_m2"] = gdf_crowns.geometry.area calculate?

a)

Average height

b)

Area of each crown in m²

c)

Bounding box

d)

Crown ID

49.

What library allows saving .gpkg files in Python?

a)

rasterio

b)

geopandas

c)

pyproj

d)

rasterstats

50.

What does xy(transform, r, c) compute in rasterio?

a)

Crown shape

b)

Real-world X, Y from pixel row and column

c)

Layer bounds

d)

Image extent

51.

What's the primary benefit of saving crowns as vector polygons?

a)

Easy color rendering

b)

Faster loading

c)

Enables precise spatial analysis and overlay

d)

Reduces size

52.

Which tool is used to segment crowns from a raster?

a)

DeepForest

b)

Watershed algorithm

c)

NDVI threshold

d)

ExG

53.

Why are small crown regions filtered out in the code?

a)

To simplify output

b)

To remove noise and artifacts

c)

To merge crowns

d)

For visualization

54.

Which file contains individual tree heights and coordinates?

a)

CHM.tif

b)

DTM.tif

c)

Tree_Crowns2.gpkg

d)

Tree_Points2.csv

55.

What is the role of MIN_CROWN_M2 in tree crown analysis?

a)

Tree height cap

b)

Minimum crown area to retain the crown

c)

Minimum NDVI

d)

Minimum EVI

56.

Why is count = src.count important in raster analysis?

a)

Gives projection info

b)

Returns number of bands in the raster

c)

Gives pixel size

d)

Outputs file format

57.

What happens if an image has fewer than 3 bands?

a)

Script continues

b)

DeepForest throws a ValueError

c)

Image is converted

d)

Bands are duplicated

58.

How are tree IDs assigned in GeoDataFrame?

a)

By GPS

b)

Sequential integers starting from 1

c)

By height

d)

Based on filename

59.

What is the result of gdf_pts.merge(gdf_crowns, on="tree_id")?

a)

It converts vector to raster

b)

Joins point and crown attributes by tree ID

c)

Clips raster to crown

d)

Detects new crowns

60.

What determines the window size for maximum_filter()?

a)

NDVI

b)

Crown diameter and pixel size

c)

DSM range

d)

CHM extent

61.

Which formula is used for NDVI?

a)

(NIR - Red) / (NIR + Red)

b)

(Green - Red) / (Green + Red)

c)

(Blue - Green) / (Blue + Green)

d)

Red / Green

62.

What is NDVI used for in this script?

a)

Height thresholding

b)

Vegetation masking

c)

RGB compositing

d)

Soil detection

63.

What is used when NIR is not available?

a)

Excess Green Index (ExG)

b)

NDMI

c)

RGB-D fusion

d)

EVI only

64.

What is the threshold for NDVI_MIN in this script?

a)

0.5

b)

0.25

c)

0.15

d)

0.75

65.

Which bands are required to calculate EVI?

a)

Green, Blue

b)

NIR, Red, Blue

c)

Red only

d)

Blue only

66.

What type of mask is created using NDVI + EVI?

a)

Slope mask

b)

Strong vegetation mask

c)

CHM mask

d)

Erosion mask

67.

Why is evi_denom[evi_denom == 0] = 1e-6 used?

a)

To maximize NDVI

b)

To avoid division by zero

c)

To smooth the EVI

d)

To normalize pixel values

68.

What is the unit of the RGB bands used in DeepForest?

a)

0–1 range

b)

0–255 pixel values

c)

Geodetic degrees

d)

Meters

69.

What happens when RGB.max() <= 1.0?

a)

Convert to binary

b)

Ignore values

c)

Scale up to 0–255 range

d)

Clip to 0–1

70.

Why does the script check veg_mask.shape == chm_s.shape?

a)

Check CRS

b)

Ensure both arrays can be AND-ed safely

c)

Filter ExG

d)

Align DEM

71.

Why is a smoothing step used after CHM generation?

a)

Remove all peaks

b)

Reduce noise for peak detection

c)

Make raster smaller

d)

Reproject CRS

72.

What does GAUSS_SIGMA_PX = 2.0 control?

a)

NDVI scale

b)

Smoothing intensity of CHM

c)

Band blending

d)

Projection units

73.

What is the default threshold for tree detection score?

a)

0.75

b)

0.20

c)

1.0

d)

0.0

74.

Which variable limits how large a crown can be?

a)

MIN_CROWN_M2

b)

MAX_CROWN_M2

c)

GAUSS_SIGMA_PX

d)

PEAK_MIN_HEIGHT

75.

What is the output of watershed(-chm_s, markers, mask)?

a)

Raster image

b)

Labeled crown segments

c)

Binary mask