import sys | |
from image_classification_model.predict import predict | |
def main(): | |
if len(sys.argv) < 2: | |
print("Usage: python predict.py <image_path>") | |
sys.exit(1) | |
image_path = sys.argv[1] | |
# Run prediction (handles preprocessing internally) | |
predicted_label = predict(image_path) | |
# Print output in Hugging Face-compatible format | |
print({"label": predicted_label}) | |
if __name__ == "__main__": | |
main() | |