Views
No views yet
SelectKBest (ANOVA F-value) → top 500 features

pip install opencv-python scikit-learn scikit-image joblib huggingface_hub numpy1from huggingface_hub import hf_hub_download
2import joblib
3import cv2
4import numpy as np
5# ... import your extract_features function ...
6
7repo_id = "Itz-Amethyst/coil100-vision-sorting-svm"
8
9# Load pipeline components
10model = joblib.load(hf_hub_download(repo_id, "model.joblib"))
11scaler = joblib.load(hf_hub_download(repo_id, "scaler.joblib"))
12selector = joblib.load(hf_hub_download(repo_id, "selector.joblib"))
13pca = joblib.load(hf_hub_download(repo_id, "pca.joblib"))
14le = joblib.load(hf_hub_download(repo_id, "label_encoder.joblib"))
15
16# Example inference on a new image
17img = cv2.imread("path/to/new_object.png")
18features = extract_features(img) # your feature function
19features_scaled = scaler.transform([features])
20features_selected = selector.transform(features_scaled)
21features_reduced = pca.transform(features_selected)
22
23pred_idx = model.predict(features_reduced)[0]
24predicted_class = le.inverse_transform([pred_idx])[0]
25
26print(f"Predicted object class: {predicted_class}")1@article{nene1996columbia,
2 title={Columbia object image library (coil-100)},
3 author={Nene, Sameer A and Nayar, Shree K and Murase, Hiroshi},
4 journal={Technical Report CUCS-005-96},
5 year={1996},
6 institution={Columbia University}
7}```