MCPcopy Index your code
hub / github.com/AhmedZgaren/Save

github.com/AhmedZgaren/Save @main

Chat with this repo
repository ↗ · DeepWiki ↗ · + Follow
203 symbols 510 edges 21 files 60 documented · 30% 4 cross-repo links
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

SAVE: Self-Attention on Visual Embedding for zero-shot generic object counting

PWC

img

Environment

Here is the code to setup the conda environment:

git clone https://github.com/AhmedZgaren/Save.git
cd Save
conda env create -f environment.yml
conda activate count

Download trained model

We provide pre-trained model weights in FSC147:

model

Store the pre-trained model in the pre-trained folder.

Demo

To test the model in an image use the code below:

python demo.py --i path\to\img

Train the model from scratch

Download FSC147 dataset

Use this link to download the FSC147 dataset and store images under the folder .\data\images\

Train your model

To train the model just run the following command:

python train.py

Test the trained model in different datasets

To test the model in the FSC147 validation set:

python valid.py -valid True

To test the model in the FSC147 test set:

python valid.py -test True

To test the model in the COCO validation set:

python valid.py -vcoco True

To test the model in the COCO test set:

python valid.py -tcoco True

Core symbols most depended-on inside this repo

to
called by 15
model/backbone.py
info
called by 12
utils/tasks.py
load
called by 4
utils/tasks.py
guess_model_task
called by 4
utils/tasks.py
random_crop_savebboxes
called by 4
utils/augment.py
is_no_jit
called by 4
model/config.py
_check_is_pytorch_model
called by 4
model/backbone.py
_forward_once
called by 3
utils/tasks.py

Shape

Method 103
Function 60
Class 40

Languages

Python100%

Modules by API surface

model/activations_me.py45 symbols
model/activations.py28 symbols
utils/tasks.py27 symbols
model/activations_jit.py20 symbols
model/config.py19 symbols
model/transformer.py10 symbols
model/backbone.py10 symbols
model/aggregation_zeropad.py10 symbols
utils/utils.py9 symbols
utils/augment.py5 symbols
utils/augmentation.py3 symbols
model/trcount.py3 symbols

For agents

$ claude mcp add Save \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact