Keras
vit
MichaelEdward commited on
Commit
f1817f8
·
verified ·
1 Parent(s): 24614f0

Upload folder using huggingface_hub

Browse files
Files changed (4) hide show
  1. .gitattributes +1 -0
  2. README.md +9 -4
  3. run.py +12 -6
  4. test_image.jpg +3 -0
.gitattributes CHANGED
@@ -34,3 +34,4 @@ saved_model/**/* 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
  final_output.keras 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
  final_output.keras filter=lfs diff=lfs merge=lfs -text
37
+ test_image.jpg filter=lfs diff=lfs merge=lfs -text
README.md CHANGED
@@ -3,9 +3,12 @@ datasets:
3
  - natix-network-org/roadwork
4
  metrics:
5
  - accuracy
 
6
  base_model:
7
  - Ultralytics/YOLO11
8
- ---
 
 
9
  # Model Card for Model ID
10
 
11
  <!-- Provide a quick summary of what the model is/does. -->
@@ -16,7 +19,7 @@ This modelcard aims to be a base template for new models. It has been generated
16
 
17
  ### Model Description
18
 
19
- <!-- Provide a longer summary of what this model is. -->
20
 
21
 
22
 
@@ -34,11 +37,13 @@ This modelcard aims to be a base template for new models. It has been generated
34
 
35
  - **Repository:** [More Information Needed]
36
  - **Paper [optional]:** [More Information Needed]
37
- - **Demo [optional]:** [More Information Needed]
 
 
38
 
39
  ## Uses
40
 
41
- <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
42
 
43
  ### Direct Use
44
 
 
3
  - natix-network-org/roadwork
4
  metrics:
5
  - accuracy
6
+ - mcc
7
  base_model:
8
  - Ultralytics/YOLO11
9
+ - natix-network-org/roadwork
10
+ - tensorflow/efficientnetv2-b0
11
+ ,---
12
  # Model Card for Model ID
13
 
14
  <!-- Provide a quick summary of what the model is/does. -->
 
19
 
20
  ### Model Description
21
 
22
+ This model was built based on inception modules.
23
 
24
 
25
 
 
37
 
38
  - **Repository:** [More Information Needed]
39
  - **Paper [optional]:** [More Information Needed]
40
+ - **Demo [optional]:** [More Information Neede
41
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
42
+ d]
43
 
44
  ## Uses
45
 
46
+ python run.py <image_path>
47
 
48
  ### Direct Use
49
 
run.py CHANGED
@@ -130,13 +130,19 @@ def make_demo_image(size=IMG_SIZE):
130
 
131
 
132
  def load_image(path):
133
- """Load an image from file. Returns PIL Image (RGB)."""
134
  from PIL import Image
135
 
136
- path = Path(path)
137
- if not path.exists():
138
- raise FileNotFoundError(f"Image not found: {path}")
139
- return Image.open(path).convert("RGB")
 
 
 
 
 
 
140
 
141
 
142
  def main():
@@ -145,7 +151,7 @@ def main():
145
  sys.exit(1)
146
 
147
  try:
148
- input_image = load_image(sys.argv[1])
149
  except FileNotFoundError as e:
150
  print(e)
151
  sys.exit(1)
 
130
 
131
 
132
  def load_image(path):
133
+ """Load an image from file. Returns PIL Image (RGB). Tries cwd, then script directory (DIR)."""
134
  from PIL import Image
135
 
136
+ raw = Path(str(path).strip()).expanduser()
137
+ # 1) Relative to current working directory
138
+ p = raw.resolve()
139
+ if p.exists():
140
+ return Image.open(p).convert("RGB")
141
+ # 2) Fallback: same filename in script directory (e.g. roadwork-miner/test_image.jpg)
142
+ p = DIR / raw.name
143
+ if p.exists():
144
+ return Image.open(p).convert("RGB")
145
+ raise FileNotFoundError(f"Image not found: {raw} (tried cwd and {DIR})")
146
 
147
 
148
  def main():
 
151
  sys.exit(1)
152
 
153
  try:
154
+ input_image = load_image(sys.argv[1].strip())
155
  except FileNotFoundError as e:
156
  print(e)
157
  sys.exit(1)
test_image.jpg ADDED

Git LFS Details

  • SHA256: 22d70a17b68fadc5ed1508f84e241f3dc5bb3578a49f3b0b4866854b846735e4
  • Pointer size: 133 Bytes
  • Size of remote file: 10.6 MB