Digital Africa Plantation Counting Challenge
Can you create a semi-supervised algorithm to count trees in plantations in Côte d'Ivoire?
Prize
\$10 000 USD
Time
20 days to go
Participants
153 active · 461 enrolled
Helping
Côte dIvoire
Prediction
Computer Vision
Object Detection
Agriculture
Clean baseline code - LB: 2.542369639
Notebooks · 28 Feb 2023, 04:25 · 6

In this video I train a model to solve this competition from scratch, from end to end, using PyTorch

Enjoy^_^

Thanks @TAUIL_Abdelilah for sharing your hard work

Thanks @TAUIL_Abdelilah How elegant it is!

Great job ! But i think you did a small mistake when checking the validation score : you are averaging rmse of different batches. You'd rather store the predictions and then calculate the rmse.

Interesting, I thought averaging rmse of all batches will give the same results as store the predictions and then calculate the rmse. But I was wrong. I just updated the check_accuracy and hopefully fix the mistake.

This is the updated check accuracy, can you review it and see if I'm checking the accuracy the right way:

```def check_acc_update(loader, model):
all_preds = np.array([]); all_groud_truth = np.array([])```
`    model.eval()`
`    with torch.no_grad():`
`        for x,y in tqdm(loader):`
`            x = x.to('cuda').to(torch.float32)`
`            y = y.to(torch.float).unsqueeze(1)`
`            `
`            all_preds       = np.append(all_preds, (model(x).cpu()))`
`            all_groud_truth = np.append(all_groud_truth, (y.cpu()))`
`    loss = np.sqrt(mean_squared_error(all_preds, all_groud_truth))`
`    print(f'Loss function: {loss}')`
`    model.train()`
`    return loss`