Upload tagger.py
Browse files
tagger.py
ADDED
@@ -0,0 +1,17 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import os
|
2 |
+
import subprocess
|
3 |
+
|
4 |
+
# Clone the repository
|
5 |
+
if not os.path.exists("wdv3-jax"):
|
6 |
+
repo_url = "https://github.com/SmilingWolf/wdv3-jax.git"
|
7 |
+
subprocess.run(["git", "clone", repo_url])
|
8 |
+
|
9 |
+
# Change directory to the cloned repository
|
10 |
+
os.chdir("wdv3-jax")
|
11 |
+
|
12 |
+
subprocess.run(["bash", "setup.sh"])
|
13 |
+
|
14 |
+
model_type = "swinv2" # or "convnext" or "vit"
|
15 |
+
image_path = "../test-img.png"
|
16 |
+
with open("output.txt", "w") as output_file:
|
17 |
+
subprocess.run(["python", "wdv3_jax.py", model_type, image_path], stdout=output_file)
|