Skip to content

Commit

Permalink
feat: ram
Browse files Browse the repository at this point in the history
  • Loading branch information
LutingWang committed Sep 13, 2024
1 parent 7da60bb commit 5df78b0
Show file tree
Hide file tree
Showing 17 changed files with 5,064 additions and 51 deletions.
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
*.pth filter=lfs diff=lfs merge=lfs -text
tutorials/visuals.ipynb filter=lfs diff=lfs merge=lfs -text
todd/tasks/natural_language_processing/tokenizers/clip_bpe.txt.gz filter=lfs diff=lfs merge=lfs -text
*.jpg filter=lfs diff=lfs merge=lfs -text
4 changes: 1 addition & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,7 @@ repos:
- id: codespell
exclude_types:
- jupyter
args:
- tests
- todd
exclude: ^docs/source/pretrained/ram.csv$
- repo: https://github.com/commitizen-tools/commitizen
rev: v3.14.1
hooks:
Expand Down
3 changes: 3 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
"BBoxes",
"codebook",
"codebooks",
"ConceptNet",
"ConvNeXt",
"cxcy",
"cxcywh",
Expand All @@ -20,6 +21,7 @@
"IoUs",
"LAION",
"LLAVA",
"logit",
"LVIS",
"multihead",
"ODKD",
Expand All @@ -28,6 +30,7 @@
"SGFI",
"shorthair",
"Sintel",
"Swin",
"synset",
"synsets",
"unicodes",
Expand Down
6 changes: 6 additions & 0 deletions docs/source/data/conceptnet.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import todd.tasks.knowledge_graph as kg

conceptnet = kg.ConceptNet()
print(conceptnet.similarity('/c/en/cat', '/c/en/cats'))
print(conceptnet.similarity('/c/en/cat', '/c/en/dog'))
print(conceptnet.similarity('/c/en/cat', '/c/en/computer'))
25 changes: 25 additions & 0 deletions docs/source/data/conceptnet.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
ConceptNet
==========

https://github.com/commonsense/conceptnet5

.. code-block:: bash
root=data/conceptnet
mkdir -p ${root}
ConceptNet 5.7.0
----------------

.. code-block:: bash
wget https://s3.amazonaws.com/conceptnet/downloads/2019/edges/conceptnet-assertions-5.7.0.csv.gz -P ${root}
Numberbatch
-----------

https://github.com/commonsense/conceptnet-numberbatch

.. code-block:: bash
wget http://conceptnet.s3.amazonaws.com/precomputed-data/2016/numberbatch/19.08/mini.h5 -P ${root}
2 changes: 2 additions & 0 deletions docs/source/pretrained/clip.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=duplicate-code

import torch
import torchvision.transforms.v2 as tf_v2
from einops.layers.torch import Rearrange
Expand Down
2 changes: 2 additions & 0 deletions docs/source/pretrained/dino.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
# pylint: disable=duplicate-code

import torch
import torchvision.transforms.v2 as tf_v2
from einops.layers.torch import Rearrange
Expand Down
Loading

0 comments on commit 5df78b0

Please sign in to comment.