nakamura196 commited on
Commit
124cdc8
1 Parent(s): 655e8fd

feat: initial commit

Browse files
Files changed (7) hide show
  1. .gitattributes +1 -0
  2. .gitignore +5 -0
  3. README.md +128 -3
  4. default.jpg +0 -0
  5. index.ipynb +87 -0
  6. model_- 19 may 2024 15_13.pt +3 -0
  7. requirements.txt +2 -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
+ *.ipynb filter=nbstripout
.gitignore ADDED
@@ -0,0 +1,5 @@
 
 
 
 
 
 
1
+ results*
2
+ .DS_Store
3
+ .venv
4
+ .jpg
5
+ yolo*.pt
README.md CHANGED
@@ -1,3 +1,128 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ tags:
4
+ - yolov5
5
+ - yolo
6
+ - vision
7
+ - object-detection
8
+ - pytorch
9
+ library_name: yolov5
10
+ datasets:
11
+ - nakamura196/ndl-layout-dataset
12
+ ---
13
+
14
+ # yolov8-ndl-layout
15
+
16
+ <!-- Provide a quick summary of what the model is/does. -->
17
+
18
+ This modelcard aims to be a base template for new models. It has been generated using [this raw template](https://github.com/huggingface/huggingface_hub/blob/main/src/huggingface_hub/templates/modelcard_template.md?plain=1).
19
+
20
+ ## Model Details
21
+
22
+ ### Model Description
23
+
24
+ <!-- Provide a longer summary of what this model is. -->
25
+
26
+ - **Developed by:** [More Information Needed]
27
+ - **Funded by [optional]:** [More Information Needed]
28
+ - **Shared by [optional]:** [More Information Needed]
29
+ - **Model type:** [More Information Needed]
30
+ - **Language(s) (NLP):** [More Information Needed]
31
+ - **License:** [More Information Needed]
32
+ - **Finetuned from model [optional]:** [More Information Needed]
33
+
34
+ ## Uses
35
+
36
+ <!-- Address questions around how the model is intended to be used, including the foreseeable users of the model and those affected by the model. -->
37
+
38
+ ### Direct Use
39
+
40
+ <!-- This section is for the model use without fine-tuning or plugging into a larger ecosystem/app. -->
41
+
42
+ [More Information Needed]
43
+
44
+ ### Out-of-Scope Use
45
+
46
+ <!-- This section addresses misuse, malicious use, and uses that the model will not work well for. -->
47
+
48
+ [More Information Needed]
49
+
50
+ ## Bias, Risks, and Limitations
51
+
52
+ <!-- This section is meant to convey both technical and sociotechnical limitations. -->
53
+
54
+ [More Information Needed]
55
+
56
+ ### Recommendations
57
+
58
+ <!-- This section is meant to convey recommendations with respect to the bias, risk, and technical limitations. -->
59
+
60
+ Users (both direct and downstream) should be made aware of the risks, biases and limitations of the model. More information needed for further recommendations.
61
+
62
+ ## How to Get Started with the Model
63
+
64
+ Use the code below to get started with the model.
65
+
66
+ [More Information Needed]
67
+
68
+ ## Training Details
69
+
70
+ ### Training Data
71
+
72
+ <!-- This should link to a Dataset Card, perhaps with a short stub of information on what the training data is all about as well as documentation related to data pre-processing or additional filtering. -->
73
+
74
+ [More Information Needed]
75
+
76
+ ### Training Procedure
77
+
78
+ <!-- This relates heavily to the Technical Specifications. Content here should link to that section when it is relevant to the training procedure. -->
79
+
80
+ #### Training Hyperparameters
81
+
82
+ - **Training regime:** [More Information Needed] <!--fp32, fp16 mixed precision, bf16 mixed precision, bf16 non-mixed precision, fp16 non-mixed precision, fp8 mixed precision -->
83
+
84
+ ## Evaluation
85
+
86
+ <!-- This section describes the evaluation protocols and provides the results. -->
87
+
88
+ ### Testing Data, Factors & Metrics
89
+
90
+ #### Testing Data
91
+
92
+ <!-- This should link to a Dataset Card if possible. -->
93
+
94
+ [More Information Needed]
95
+
96
+ #### Factors
97
+
98
+ <!-- These are the things the evaluation is disaggregating by, e.g., subpopulations or domains. -->
99
+
100
+ [More Information Needed]
101
+
102
+ #### Metrics
103
+
104
+ <!-- These are the evaluation metrics being used, ideally with a description of why. -->
105
+
106
+ [More Information Needed]
107
+
108
+ ### Results
109
+
110
+ [More Information Needed]
111
+
112
+ #### Summary
113
+
114
+ ## Environmental Impact
115
+
116
+ <!-- Total emissions (in grams of CO2eq) and additional considerations, such as electricity usage, go here. Edit the suggested text below accordingly -->
117
+
118
+ Carbon emissions can be estimated using the [Machine Learning Impact calculator](https://mlco2.github.io/impact#compute) presented in [Lacoste et al. (2019)](https://arxiv.org/abs/1910.09700).
119
+
120
+ - **Hardware Type:** [More Information Needed]
121
+ - **Hours used:** [More Information Needed]
122
+ - **Cloud Provider:** [More Information Needed]
123
+ - **Compute Region:** [More Information Needed]
124
+ - **Carbon Emitted:** [More Information Needed]
125
+
126
+ ## Model Card Contact
127
+
128
+ [More Information Needed]
default.jpg ADDED
index.ipynb ADDED
@@ -0,0 +1,87 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "cells": [
3
+ {
4
+ "cell_type": "markdown",
5
+ "metadata": {},
6
+ "source": [
7
+ "## How tu use\n",
8
+ "\n",
9
+ "- Install [ultralyticsplus](https://github.com/fcakyon/ultralyticsplus):\n",
10
+ "\n",
11
+ "```bash\n",
12
+ "pip install -U ultralyticsplus\n",
13
+ "```\n",
14
+ "\n",
15
+ "- Load model and perform prediction:"
16
+ ]
17
+ },
18
+ {
19
+ "cell_type": "code",
20
+ "execution_count": 10,
21
+ "metadata": {},
22
+ "outputs": [
23
+ {
24
+ "name": "stdout",
25
+ "output_type": "stream",
26
+ "text": [
27
+ "\n",
28
+ "Found https://dl.ndl.go.jp/api/iiif/2534020/T0000001/full/full/0/default.jpg locally at default.jpg\n",
29
+ "image 1/1 /Users/nakamura/git/hf/models/yolov8-ndl-layout/default.jpg: 640x640 1 1_overall, 1 3_typography, 510.9ms\n",
30
+ "Speed: 2.2ms preprocess, 510.9ms inference, 1.8ms postprocess per image at shape (1, 3, 640, 640)\n"
31
+ ]
32
+ }
33
+ ],
34
+ "source": [
35
+ "from ultralyticsplus import YOLO, render_result\n",
36
+ "import os\n",
37
+ "\n",
38
+ "# load model\n",
39
+ "model = YOLO('model_- 19 may 2024 15_13.pt')\n",
40
+ " \n",
41
+ "# set model parameters\n",
42
+ "conf_threshold = 0.25 # NMS confidence threshold\n",
43
+ "iou_threshold = 0.45 # NMS IoU threshold\n",
44
+ "\n",
45
+ "# set image\n",
46
+ "img = 'https://dl.ndl.go.jp/api/iiif/2534020/T0000001/full/full/0/default.jpg'\n",
47
+ "\n",
48
+ "# perform inference\n",
49
+ "results = model.predict(img, conf=conf_threshold, iou=iou_threshold)\n",
50
+ "render = render_result(model=model, image=img, result=results[0]) \n",
51
+ "\n",
52
+ "os.makedirs('results', exist_ok=True)\n",
53
+ "\n",
54
+ "# save\n",
55
+ "render.save('results/1.jpg')"
56
+ ]
57
+ },
58
+ {
59
+ "cell_type": "code",
60
+ "execution_count": null,
61
+ "metadata": {},
62
+ "outputs": [],
63
+ "source": []
64
+ }
65
+ ],
66
+ "metadata": {
67
+ "kernelspec": {
68
+ "display_name": ".venv",
69
+ "language": "python",
70
+ "name": "python3"
71
+ },
72
+ "language_info": {
73
+ "codemirror_mode": {
74
+ "name": "ipython",
75
+ "version": 3
76
+ },
77
+ "file_extension": ".py",
78
+ "mimetype": "text/x-python",
79
+ "name": "python",
80
+ "nbconvert_exporter": "python",
81
+ "pygments_lexer": "ipython3",
82
+ "version": "3.9.11"
83
+ }
84
+ },
85
+ "nbformat": 4,
86
+ "nbformat_minor": 2
87
+ }
model_- 19 may 2024 15_13.pt ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8acb10e585c68b31142f2f4470606da52ce054ab467368b6bfe22ca547620e12
3
+ size 136737193
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ ultralyticsplus
2
+ nbstripout