Downloads · 30 days
7
9% of all-time downloads
phuoc60648/abc
abc is a machine learning model from phuoc60648. Use it for the machine learning task on the model card, and read the license before you ship it in a product. It is set up for keras.
Triển khai inference cho mô hình image captioning bằng TensorFlow/Keras, với giao diện Gradio đơn giản cho upload ảnh và nhận caption.
Downloads · 30 days
7
9% of all-time downloads
All-time downloads
76
Public
Repo size
64.9 MB
Likes
0
Public
Click a slice to open those files.
.keras128 MB · 99%
From the Hugging Face model README
Triển khai inference cho mô hình image captioning bằng TensorFlow/Keras, với giao diện Gradio đơn giản cho upload ảnh và nhận caption.
Triển khai inference cho mô hình image captioning dùng TensorFlow/Keras, EfficientNetV2B0 và giao diện Gradio.
.
├── app.py # UI Gradio cho Hugging Face Space
├── flickr30k.py # Logic model + tiền xử lý (đã cung cấp)
├── best_model.keras # Trọng số mô hình (đặt cùng thư mục)
├── tokenizer.pkl # Tokenizer đã fit
├── model_config.pkl # Chứa max_length, vocab_size
├── requirements.txt
└── README.md
Các hàm sử dụng trực tiếp từ flickr30k.py: load_caption_model, load_tokenizer_and_config, load_feature_extractor, extract_features_from_image, generate_caption.
python -m venv .venv
. .venv/bin/activate # Windows: .venv\Scripts\activate
pip install --upgrade pip
pip install -r requirements.txt
# Đảm bảo 3 tệp đã có:
# best_model.keras, tokenizer.pkl, model_config.pkl
python app.py
Mở URL Gradio hiển thị trong terminal.
app.py, flickr30k.py, requirements.txt, README.md, và 3 tệp trọng số/cấu hình.tensorflow==2.12.0. Nếu bạn dùng trọng số huấn luyện ở phiên bản khác, cần đồng bộ phiên bản TensorFlow/Keras tương ứng.opencv-python-headless thay vì opencv-python để tránh lỗi GUI trên môi trường server.