TheOneReborn commited on
Commit
4ae8579
·
1 Parent(s): f6e67a4

feat: setup project

Browse files
Files changed (7) hide show
  1. .gitattributes +1 -0
  2. .gitignore +2 -0
  3. app.py +25 -0
  4. models/car-segmentation_v1.pkl +3 -0
  5. requirements.txt +104 -0
  6. test/1.jpg +3 -0
  7. test/2.jpg +3 -0
.gitattributes CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ *.jpg filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ __pycache__
2
+ .venv
app.py ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio
2
+ import numpy
3
+
4
+ from pathlib import Path
5
+
6
+ from fastai.vision.all import load_learner, PILImage
7
+
8
+
9
+ MODEL_PATH = Path('.') / 'models'
10
+ TEST_IMAGES_PATH = Path('.') / 'test'
11
+ LEARNER = load_learner(MODEL_PATH) / 'car-segmentation_v1.pkl'
12
+
13
+
14
+ def segment_image(image):
15
+ image = PILImage.create(image)
16
+ prediction, _, _ = LEARNER.predict(image)
17
+ return numpy.array(prediction)
18
+
19
+ demo = gradio.Interface(
20
+ segment_image,
21
+ inputs=gradio.Image(type='pil'),
22
+ outputs=gradio.Image(type='numpy'),
23
+ examples=[str(image) for image in TEST_IMAGES_PATH.iterdir()]
24
+ )
25
+ demo.launch()
models/car-segmentation_v1.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:16247a5cae3048adfd1c102482610b0b1b85b0285271faf9ace1328528b218d4
3
+ size 194626328
requirements.txt ADDED
@@ -0,0 +1,104 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ aiofiles==23.2.1
2
+ annotated-types==0.7.0
3
+ anyio==4.8.0
4
+ blis==1.2.0
5
+ catalogue==2.0.10
6
+ certifi==2025.1.31
7
+ charset-normalizer==3.4.1
8
+ click==8.1.8
9
+ cloudpathlib==0.21.0
10
+ confection==0.1.5
11
+ contourpy==1.3.1
12
+ cycler==0.12.1
13
+ cymem==2.0.11
14
+ fastai==2.7.18
15
+ fastapi==0.115.11
16
+ fastcore==1.7.29
17
+ fastdownload==0.0.7
18
+ fastprogress==1.0.3
19
+ ffmpy==0.5.0
20
+ filelock==3.17.0
21
+ fonttools==4.56.0
22
+ fsspec==2025.2.0
23
+ gradio==5.20.0
24
+ gradio_client==1.7.2
25
+ groovy==0.1.2
26
+ h11==0.14.0
27
+ httpcore==1.0.7
28
+ httpx==0.28.1
29
+ huggingface-hub==0.29.2
30
+ idna==3.10
31
+ Jinja2==3.1.5
32
+ joblib==1.4.2
33
+ kiwisolver==1.4.8
34
+ langcodes==3.5.0
35
+ language_data==1.3.0
36
+ marisa-trie==1.2.1
37
+ markdown-it-py==3.0.0
38
+ MarkupSafe==2.1.5
39
+ matplotlib==3.10.1
40
+ mdurl==0.1.2
41
+ mpmath==1.3.0
42
+ murmurhash==1.0.12
43
+ networkx==3.4.2
44
+ numpy==2.2.3
45
+ nvidia-cublas-cu12==12.4.5.8
46
+ nvidia-cuda-cupti-cu12==12.4.127
47
+ nvidia-cuda-nvrtc-cu12==12.4.127
48
+ nvidia-cuda-runtime-cu12==12.4.127
49
+ nvidia-cudnn-cu12==9.1.0.70
50
+ nvidia-cufft-cu12==11.2.1.3
51
+ nvidia-curand-cu12==10.3.5.147
52
+ nvidia-cusolver-cu12==11.6.1.9
53
+ nvidia-cusparse-cu12==12.3.1.170
54
+ nvidia-nccl-cu12==2.21.5
55
+ nvidia-nvjitlink-cu12==12.4.127
56
+ nvidia-nvtx-cu12==12.4.127
57
+ orjson==3.10.15
58
+ packaging==24.2
59
+ pandas==2.2.3
60
+ pillow==11.1.0
61
+ preshed==3.0.9
62
+ pydantic==2.10.6
63
+ pydantic_core==2.27.2
64
+ pydub==0.25.1
65
+ Pygments==2.19.1
66
+ pyparsing==3.2.1
67
+ python-dateutil==2.9.0.post0
68
+ python-multipart==0.0.20
69
+ pytz==2025.1
70
+ PyYAML==6.0.2
71
+ requests==2.32.3
72
+ rich==13.9.4
73
+ ruff==0.9.9
74
+ safehttpx==0.1.6
75
+ scikit-learn==1.6.1
76
+ scipy==1.15.2
77
+ semantic-version==2.10.0
78
+ setuptools==75.8.2
79
+ shellingham==1.5.4
80
+ six==1.17.0
81
+ smart-open==7.1.0
82
+ sniffio==1.3.1
83
+ spacy==3.8.4
84
+ spacy-legacy==3.0.12
85
+ spacy-loggers==1.0.5
86
+ srsly==2.5.1
87
+ starlette==0.46.0
88
+ sympy==1.13.1
89
+ thinc==8.3.4
90
+ threadpoolctl==3.5.0
91
+ tomlkit==0.13.2
92
+ torch==2.5.1
93
+ torchvision==0.20.1
94
+ tqdm==4.67.1
95
+ triton==3.1.0
96
+ typer==0.15.2
97
+ typing_extensions==4.12.2
98
+ tzdata==2025.1
99
+ urllib3==2.3.0
100
+ uvicorn==0.34.0
101
+ wasabi==1.1.3
102
+ weasel==0.4.1
103
+ websockets==15.0
104
+ wrapt==1.17.2
test/1.jpg ADDED

Git LFS Details

  • SHA256: 13b841199ceda26fdbdc865f9a5af157efa967f4e70553a9e06cee2ec4b34a3d
  • Pointer size: 132 Bytes
  • Size of remote file: 1.48 MB
test/2.jpg ADDED

Git LFS Details

  • SHA256: e170cfba326ecd1f767884ac4dda9ba9595c730ae1e4eb0e57c4be4173715211
  • Pointer size: 131 Bytes
  • Size of remote file: 391 kB