feat: test upload - Trendyol DinoV2 Product Similarity and Retrieval Embedding Model
Browse files🧪 Test Upload Details:
- Personal account testing before company publication
- Architecture: ConvNeXt-Base + ArcFace loss
- Embedding dimension: 256
- Task: Product similarity and retrieval
📁 Repository Contents:
- Model weights in safetensors format
- Complete model card with usage examples
- Apache 2.0 license
- Demo notebook for inference
🔒 Security: Scanned and validated
📋 RFC Compliance: Ready for company publication
Test upload by: Personal Account
- README.md +18 -3
- __pycache__/modeling_trendyol_dinov2.cpython-312.pyc +0 -0
- config.json +2 -2
- modeling_trendyol_dinov2.py +1 -1
- preprocessor_config.json +1 -1
README.md
CHANGED
|
@@ -23,8 +23,9 @@ from transformers import AutoModel, AutoImageProcessor
|
|
| 23 |
device = 'cuda'
|
| 24 |
|
| 25 |
# Load model and processor from Hugging Face Hub
|
| 26 |
-
model = AutoModel.from_pretrained("Trendyol/trendyol-dino-v2-ecommerce-256d", trust_remote_code=True)
|
| 27 |
processor = AutoImageProcessor.from_pretrained("Trendyol/trendyol-dino-v2-ecommerce-256d", trust_remote_code=True)
|
|
|
|
|
|
|
| 28 |
|
| 29 |
# Load and process an image
|
| 30 |
image = Image.open('your_image.jpg').convert('RGB')
|
|
@@ -47,7 +48,7 @@ print("Generated dimensional embedding shape:", embeddings.shape[1])
|
|
| 47 |
The model uses a specific preprocessing pipeline that's crucial for good performance:
|
| 48 |
|
| 49 |
1. **DownScale (Lanczos)**: Resize to max dimension of 332px
|
| 50 |
-
2. **JPEG Compression**: Apply quality=
|
| 51 |
3. **Scale Image**: Scale to max dimension of 332px
|
| 52 |
4. **Pad to Square**: Pad with color value 255
|
| 53 |
5. **Resize**: Resize to 224x224
|
|
@@ -116,7 +117,21 @@ This model is designed for:
|
|
| 116 |
|
| 117 |
## License
|
| 118 |
|
| 119 |
-
This model is released under the Apache 2.0 License. See LICENSE file for details.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 120 |
|
| 121 |
## Citation
|
| 122 |
|
|
|
|
| 23 |
device = 'cuda'
|
| 24 |
|
| 25 |
# Load model and processor from Hugging Face Hub
|
|
|
|
| 26 |
processor = AutoImageProcessor.from_pretrained("Trendyol/trendyol-dino-v2-ecommerce-256d", trust_remote_code=True)
|
| 27 |
+
model = AutoModel.from_pretrained("Trendyol/trendyol-dino-v2-ecommerce-256d", trust_remote_code=True)
|
| 28 |
+
model.to(device)
|
| 29 |
|
| 30 |
# Load and process an image
|
| 31 |
image = Image.open('your_image.jpg').convert('RGB')
|
|
|
|
| 48 |
The model uses a specific preprocessing pipeline that's crucial for good performance:
|
| 49 |
|
| 50 |
1. **DownScale (Lanczos)**: Resize to max dimension of 332px
|
| 51 |
+
2. **JPEG Compression**: Apply quality=90 compression
|
| 52 |
3. **Scale Image**: Scale to max dimension of 332px
|
| 53 |
4. **Pad to Square**: Pad with color value 255
|
| 54 |
5. **Resize**: Resize to 224x224
|
|
|
|
| 117 |
|
| 118 |
## License
|
| 119 |
|
| 120 |
+
This model is released by Trendyol under the Apache 2.0 License. See LICENSE file for details.
|
| 121 |
+
|
| 122 |
+
You are allowed to:
|
| 123 |
+
- View, download, and evaluate the model weights.
|
| 124 |
+
- Use the model for non-commercial research and internal testing.
|
| 125 |
+
- Use the model or its derivatives for commercial purposes, provided that:
|
| 126 |
+
- You cite Trendyol as the original model creator.
|
| 127 |
+
- You provide a copy of the Apache 2.0 license with your work.
|
| 128 |
+
|
| 129 |
+
You are not allowed to:
|
| 130 |
+
- Use the model in applications violating ethical standards, including but not limited to surveillance, misinformation, or harm to individuals or groups.
|
| 131 |
+
|
| 132 |
+
By downloading or using this model, you agree to the terms above.
|
| 133 |
+
|
| 134 |
+
© 2025 Trendyol Group. All rights reserved.
|
| 135 |
|
| 136 |
## Citation
|
| 137 |
|
__pycache__/modeling_trendyol_dinov2.cpython-312.pyc
CHANGED
|
Binary files a/__pycache__/modeling_trendyol_dinov2.cpython-312.pyc and b/__pycache__/modeling_trendyol_dinov2.cpython-312.pyc differ
|
|
|
config.json
CHANGED
|
@@ -16,7 +16,7 @@
|
|
| 16 |
"input_size": 224,
|
| 17 |
"downscale_size": 332,
|
| 18 |
"pad_color": 255,
|
| 19 |
-
"jpeg_quality":
|
| 20 |
"normalization": {
|
| 21 |
"mean": [
|
| 22 |
0.485,
|
|
@@ -33,7 +33,7 @@
|
|
| 33 |
"input_size": 224,
|
| 34 |
"downscale_size": 332,
|
| 35 |
"pad_color": 255,
|
| 36 |
-
"jpeg_quality":
|
| 37 |
"transforms": [
|
| 38 |
"DownScaleLanczos",
|
| 39 |
"JPEGCompression",
|
|
|
|
| 16 |
"input_size": 224,
|
| 17 |
"downscale_size": 332,
|
| 18 |
"pad_color": 255,
|
| 19 |
+
"jpeg_quality": 90,
|
| 20 |
"normalization": {
|
| 21 |
"mean": [
|
| 22 |
0.485,
|
|
|
|
| 33 |
"input_size": 224,
|
| 34 |
"downscale_size": 332,
|
| 35 |
"pad_color": 255,
|
| 36 |
+
"jpeg_quality": 90,
|
| 37 |
"transforms": [
|
| 38 |
"DownScaleLanczos",
|
| 39 |
"JPEGCompression",
|
modeling_trendyol_dinov2.py
CHANGED
|
@@ -24,7 +24,7 @@ class TrendyolDinoV2Config(PretrainedConfig):
|
|
| 24 |
in_features=768,
|
| 25 |
downscale_size=332,
|
| 26 |
pad_color=255,
|
| 27 |
-
jpeg_quality=
|
| 28 |
**kwargs
|
| 29 |
):
|
| 30 |
super().__init__(**kwargs)
|
|
|
|
| 24 |
in_features=768,
|
| 25 |
downscale_size=332,
|
| 26 |
pad_color=255,
|
| 27 |
+
jpeg_quality=90,
|
| 28 |
**kwargs
|
| 29 |
):
|
| 30 |
super().__init__(**kwargs)
|
preprocessor_config.json
CHANGED
|
@@ -7,7 +7,7 @@
|
|
| 7 |
"input_size": 224,
|
| 8 |
"downscale_size": 332,
|
| 9 |
"pad_color": 255,
|
| 10 |
-
"jpeg_quality":
|
| 11 |
"do_normalize": true,
|
| 12 |
"image_mean": [
|
| 13 |
0.485,
|
|
|
|
| 7 |
"input_size": 224,
|
| 8 |
"downscale_size": 332,
|
| 9 |
"pad_color": 255,
|
| 10 |
+
"jpeg_quality": 90,
|
| 11 |
"do_normalize": true,
|
| 12 |
"image_mean": [
|
| 13 |
0.485,
|