--- license: mit language: - en pipeline_tag: object-detection tags: - baseball - baseball-cards - sports --- # JunkWaxHero πŸ¦Έβ€β™‚οΈ **JunkWaxHero** is your go-to computer vision model for identifying "Junk Wax" baseball card sets from the golden era of 1980 to 1999. Whether you're a collector, dealer, or enthusiast, JunkWaxHero simplifies the process of cataloging and verifying your collection with high precision and recall. **The purpose of JunkWaxHero is to provide a model that quickly identifies baseball card sets without relying on SaaS-based inference APIs.** ## πŸ“¦ Available Formats JunkWaxHero is available in **ONNX** format to cater to different deployment needs and preferences. - **ONNX:** Perfect for interoperability across various platforms and optimizing for different hardware accelerators. ## πŸ“Š Training Details - **Model Version:** Iteration 22 - **Domain:** General (compact) [S1] ### **Overall Performance Metrics** - **Precision:** 99.0% - **Recall:** 96.7% - **mAP:** 98.5% ## πŸ“ Dataset The training dataset for **JunkWaxHero** was meticulously curated to ensure robustness and versatility. It includes baseball card images captured on multiple different surfaces and backgrounds, with varying zoom levels to simulate real-world conditions. All images adhere to a **3:4 aspect ratio** to align with modern cell phone portrait modes. The baseball cards in the dataset are **vertically aligned** to maintain consistency during training. Support for **horizontally aligned cards photographed in their horizontal orientation** is planned for future iterations to enhance the model's flexibility. ## 🎯 Performance Per Set JunkWaxHero has been meticulously trained to recognize the following baseball card sets with exceptional accuracy: | Tag | Precision | Recall | Average Precision (AP) | | -------------------------------- | --------- | ------ | ---------------------- | | 1982 Donruss | 100.0% | 100.0% | 100.0% | | 1984 Topps | 100.0% | 100.0% | 100.0% | | 1987 Fleer | 100.0% | 95.5% | 95.5% | | 1987 Topps | 100.0% | 100.0% | 100.0% | | 1988 Donruss | 95.5% | 100.0% | 100.0% | | 1988 Fleer | 100.0% | 71.4% | 90.5% | | 1988 Fleer Pack | 100.0% | 100.0% | 100.0% | | 1988 Score | 100.0% | 100.0% | 100.0% | | 1988 Topps | 100.0% | 95.8% | 100.0% | | 1989 Bowman | 100.0% | 94.7% | 99.7% | | 1989 Donruss | 100.0% | 94.7% | 100.0% | | 1989 Fleer | 100.0% | 100.0% | 100.0% | | 1989 Score | 100.0% | 100.0% | 100.0% | | 1989 Topps | 95.0% | 90.5% | 95.0% | | 1989 Upper Deck | 100.0% | 92.3% | 100.0% | | 1990 Donruss | 100.0% | 100.0% | 100.0% | | 1990 Fleer Pack | 92.3% | 100.0% | 100.0% | | 1990 Leaf | 94.7% | 94.7% | 99.3% | | 1990 Leaf Pack | 100.0% | 100.0% | 100.0% | | 1990 Topps | 100.0% | 100.0% | 100.0% | | 1990 Upper Deck High Series Pack | 100.0% | 95.7% | 99.5% | | 1991 Fleer Ultra | 100.0% | 100.0% | 100.0% | | 1991 Leaf | 100.0% | 90.9% | 95.5% | | 1991 Leaf Pack | 100.0% | 100.0% | 100.0% | | 1991 Upper Deck | 100.0% | 89.5% | 94.7% | | 1991 Upper Deck Low Series Pack | 100.0% | 96.0% | 99.6% | | 1992 Fleer | 100.0% | 100.0% | 100.0% | | 1992 Fleer Ultra | 100.0% | 100.0% | 100.0% | | 1992 Fleer Pack | 100.0% | 75.0% | 75.0% | | 1992 O-Pee-Chee Premiere | 100.0% | 94.7% | 94.7% | | 1992 Pinnacle | 100.0% | 100.0% | 100.0% | | 1992 Pinnacle Pack | 100.0% | 85.7% | 100.0% | | 1992 Upper Deck | 100.0% | 87.5% | 95.7% | | 1992 Upper Deck High Series Pack | 100.0% | 100.0% | 100.0% | | 1993 Fleer Series 1 Pack | 100.0% | 100.0% | 100.0% | | 1993 Fleer Series 2 Pack | 100.0% | 100.0% | 100.0% | | 1993 Topps | 95.2% | 90.9% | 99.0% | | 1994 Leaf | 100.0% | 100.0% | 100.0% | | 1994 Pinnacle | 100.0% | 100.0% | 100.0% | | 1994 Score | 100.0% | 100.0% | 100.0% | | 1995 Leaf | 100.0% | 100.0% | 100.0% | | 1995 Select | 95.5% | 100.0% | 100.0% | | 1996 Pinnacle | 92.3% | 100.0% | 100.0% | *Included sets are marked with a βœ…, while excluded sets (if any) would be marked with a ❌.* ## πŸš€ Getting Started ### Repository Access the repository on Hugging Face: [https://huggingface.co/enusbaum/JunkWaxHero/](https://huggingface.co/enusbaum/JunkWaxHero/) ### Installation To integrate **JunkWaxHero** into your projects, choose the format that best fits your workflow: #### ONNX 1. **Install ONNX Runtime:** ```bash pip install onnxruntime ``` 2. **Download the ONNX Model:** Navigate to the ONNX directory in the repository and download the `model.onnx` file from [https://huggingface.co/enusbaum/JunkWaxHero/tree/main/onnx](https://huggingface.co/enusbaum/JunkWaxHero/tree/main/onnx). 3. **Load the ONNX Model:** ```python import onnxruntime as ort import numpy as np # Path to the downloaded ONNX model MODEL_PATH = 'path/to/junkwaxhero/onnx/junkwaxhero.onnx' # Initialize the ONNX runtime session session = ort.InferenceSession(MODEL_PATH) # Get input and output names input_name = session.get_inputs()[0].name output_name = session.get_outputs()[0].name # Example function to run inference def predict(image): image = np.expand_dims(image, axis=0).astype(np.float32) # Add batch dimension and ensure correct type predictions = session.run([output_name], {input_name: image}) return predictions ``` ### Usage 1. **Prepare Your Images:** Ensure your baseball card images are clear and well-lit for optimal identification. Images should be in a **4:3 ratio** and **vertically aligned**. 2. **Load the Model:** Use the appropriate code snippet above based on your chosen format (TensorFlow or ONNX). 3. **Identify Sets:** Pass your images through JunkWaxHero to accurately identify the set they belong to. ```python from PIL import Image # Load and preprocess the image def load_image(image_path): image = Image.open(image_path) image = image.resize((width, height)) # Resize to the input size expected by the model image = np.array(image) return image # Example usage image = load_image('path/to/baseball_card.jpg') predictions = predict(image) # Get the predicted label predicted_label = labels[np.argmax(predictions)] print(f'Predicted Set: {predicted_label}') ``` > **Note:** Replace `(width, height)` with the actual dimensions expected by your model. ### Optimization Leverage the high precision and recall rates to maintain an organized and verified collection. Depending on your deployment environment, choose between TensorFlow for seamless integration with TensorFlow ecosystems or ONNX for broader platform compatibility and performance optimizations. ## πŸ” Use Cases - **Collectors:** Quickly verify and catalog your baseball card collection. - **Dealers:** Streamline inventory management with accurate set identification. - **Enthusiasts:** Explore and discover sets with ease using advanced computer vision techniques. ## πŸ› οΈ Technical Details JunkWaxHero leverages state-of-the-art computer vision architectures optimized for identifying baseball card sets from images. Trained on a diverse dataset spanning multiple decades, the model ensures robustness and reliability across various card conditions and designs. By offering both TensorFlow and ONNX formats, JunkWaxHero provides flexibility for different deployment scenarios, whether you're integrating into existing TensorFlow pipelines or seeking cross-platform compatibility with ONNX. ## πŸ“„ License This project is licensed under the [MIT License](LICENSE). ## πŸ“« Contact For questions, suggestions, or support, please reach out to [eric@nusbaum.me](mailto:eric@nusbaum.me). --- *Happy Collecting!*