Python Image Classifier: Real vs Toy Cars

Job ID: 40020396

Budget: $10 – $30 USD

I need a Python program that works exactly like the Handwritten Digit Recognition example (using load_digits() from sklearn), but instead of digits, I want to classify two categories of images:
Real Cars
Toy Cars
Requirements:
The code structure must be the same as this format:
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression

# load dataset
X, y = ...

# split
X_train, X_test, y_train, y_test = train_test_split(...)

# model
model = LogisticRegression(...)
model.fit(X_train, y_train)

print(...)
I want a custom dataset loader similar to load_digits(), but using my own image folders.
The dataset will be in this structure:
cars/
real/
(real car images)
toy/
(toy car images)
The loader function must:
Read the images
Convert them to grayscale
Resize to 8×8 pixels (same size as digits)
Flatten them into vectors (same shape as digits.data)
Return data and target attributes
Final output should print training accuracy and testing accuracy.
No deep learning. Only Logistic Regression from sklearn.
The final code must run immediately after I add my images into the folders.