File size: 1,002 Bytes
47ea9aa
 
 
 
 
 
59131c3
 
 
47ea9aa
59131c3
4da9eb0
47ea9aa
 
 
1d48d85
47ea9aa
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
---
license: mit
---


FLUX Detection model with sklearn API using wavelets and UMAP embeddings and then K-Nearest neighbors for classification.
The process is as follows: DWT -> UMAP -> KNN. The discrete wavelet transform converts an image to its wavelet representation.
The model was trained on around 300 FLUX images and 300 photographs from Unsplash but a new dataset can be used instead of FLUX.
Accuracy varies depending on the dataset but can be anywhere from 80%-90% depending on the dataset you use.

 Methods include fit, predict, score, and predict_proba. First, load an image using PIL (Pillow) and then store using an array. Load the class using joblib and then predict.
 The model is already pretrained but can be trained again using fit. The images have to be resized to 512x512 before prediction, otherwise the model will give an error.

 ```python
model = joblib.load("flux_classifier.pkl")
images = [Image.open("image.jpeg").resize((512, 512))]
predictions = model.predict(images)
```