Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion Classification/Digit_Recognition/train_digits_hog.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@
data = []
labels = []


for imagePath in paths.list_images("dataset\\training"):
digit = imagePath.split("\\")[-2]

Expand All @@ -27,6 +26,9 @@
data.append(H)
labels.append(digit)

data_arr = asarray(data)
pixels = data_arr.flatten().reshape(6000, 784)

print("[INFO] training classifier...")

model = RandomForestClassifier(n_estimators=30, random_state=42)
Expand Down Expand Up @@ -54,5 +56,8 @@
act_res.append(digit_val)
pred_res.append(pred)

print(classification_report(act_res, pred_res))



print(classification_report(act_res, pred_res))