Downloads · 30 days
0
varunnair03/SoleTruth
SoleTruth is a machine learning model from varunnair03. Use it for the machine learning task on the model card, and read the license before you ship it in a product.
This project uses Convolutional Neural Networks (CNN) and normalized cross-correlation along with ViTs to retrieve and link shoeprint images from crime scenes.
Downloads · 30 days
0
Access
Public
Updated Apr 17, 2025
Repo size
15.3 GB
Likes
0
Public
Click a slice to open those files.
.safetensors439 MB · 99%
From the Hugging Face model README
This project uses Convolutional Neural Networks (CNN) and normalized cross-correlation along with ViTs to retrieve and link shoeprint images from crime scenes.
Note: Make sure you are using Git-LFS. To do so just run the following command:
git lfs install
And to track any file using LFS use the following command:
git-lfs track <file-name>
pip install -r requirements.txt.You can downlaod the dataset that was used to fine tune the ViT model.
The dataset used to create the embeddings is present in the directory dataset. The actual contents can be found here
There are mainly two models that are being trained using the code in this repository: msn.ipynb and vit-test.ipynb.
The ViTMSN model is fine-tuned on the dataset mentioned above.
Use the test.ipynb notebook to test the model with new images. Change the variable pretrained_model_name to the desired model.
The code mentioned the directory retrieval contains the vector embedding implementation.
ResNet-RetrievalTest.ipynb contains the code for using embeddings generated using the ResNet-50 model while ViTRestrievalTest.ipynb contains the code for using the embeddings generated using a Vision Transformers (un-fine-tuned).
The vector dataabase is created on the following dataset
Data-information.xlsx contains the mapping for the Shoe make and models.
Given below is the code for retrieving images based on ViTs
# Example code to test the model
test = [Image.open("../patch.png").convert("RGB")]
try:
test_inputs = processor(test, return_tensors="pt")
test_outputs = model(**test_inputs)
except Exception as e:
print(e)
embeddings = test_outputs.last_hidden_state[:, 0, :] # Take CLS token embedding
# Convert to list
test_embeddings = embeddings.detach().numpy().tolist()
search_result = qclient.query_points("shoeprints_part1", query=test_embeddings[0])
return_retrived_image(search_result)
This project is licensed under the MIT License.