Views
No views yet
| Model | Input Size | Accuracy |
|---|---|---|
| dtacAI-beta (Baseline) | 150x150 | 68.18% |
| dtacAI-betaV1 (Current) | 224x224 | 93.64% |
1import tensorflow as tf
2from huggingface_hub import hf_hub_download
3import numpy as np
4
5# 1. Download & Load Model
6repo_id = "GGXV1/dtacAI-betaV1"
7filename = "dtacAI_betaV1_model.h5"
8model_path = hf_hub_download(repo_id=repo_id, filename=filename)
9model = tf.keras.models.load_model(model_path)
10
11# 2. Prepare Image
12def predict_image(img_path):
13 img = tf.keras.utils.load_img(img_path, target_size=(224, 224))
14 img_array = tf.keras.utils.img_to_array(img)
15 img_array = tf.expand_dims(img_array, 0) # Create a batch
16
17 predictions = model.predict(img_array)
18 score = tf.nn.sigmoid(predictions[0])
19 return "TRUE" if score > 0.5 else "AI"