forked from dariopavllo/road-segmentation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnaive_model.py
39 lines (30 loc) · 906 Bytes
/
naive_model.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# -*- coding: utf-8 -*-
import numpy as np
class NaiveModel:
def __init__(self):
"""
Construct a bogus classifier that classifies all pixels as background.
"""
# Nothing to do
return
def initialize(self):
""" Initialize or reset this model. """
# Nothing to do
return
def train(self, Y, X):
print('Training completed')
# Nothing to do
def save(self, filename):
# Nothing to do
return
def load(self, filename):
# Nothing to do
return
def classify(self, X):
"""
Classify an unseen set of samples.
This method must be called after "train".
Returns a list of predictions.
"""
# Classify everything as background
return np.zeros((X.shape[0], X.shape[1]*X.shape[2]//256))