prithivMLmods commited on
Commit
6aabc83
·
verified ·
1 Parent(s): 434f945

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +95 -75
README.md CHANGED
@@ -3,19 +3,41 @@
3
 
4
  .vg-container, .vg-container * {
5
  font-family: 'Ubuntu', sans-serif;
 
6
  }
7
 
8
  .vg-code, .vg-code * {
9
  font-family: 'Ubuntu Mono', 'Courier New', monospace !important;
10
- line-height: 1.4 !important;
11
  }
12
 
13
- .vg-table tbody tr:nth-child(even) {
14
- background-color: #0d0d0d;
 
 
 
 
 
 
 
15
  }
16
 
17
- .vg-table tbody tr:hover {
18
- background-color: #161616;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
19
  }
20
  </style>
21
 
@@ -23,7 +45,7 @@
23
 
24
  <h1 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 0;">VisionGuardrail-4B</h1>
25
 
26
- <p style="color: #FFFFFF;">
27
  <b>VisionGuardrail-4B</b> is a multimodal content-safety classifier based on <b>Qwen/Qwen3.5-4B</b> and trained on the <a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">prithivMLmods/ImageShield-Guardrail-Pro</a> content-safety guardrail dataset. The model is designed to classify visual content as <b>Safe</b> or <b>Unsafe</b>, with a particular focus on detecting <b>Not Safe for Work (NSFW) sensual content</b> and other potentially sensitive visual content. VisionGuardrail-4B excels at detecting <b>explicit and sensitive visual content</b>, with detailed analysis of <b>dress codes, clothing exposure, poses, framing, and different visual settings</b> to support conservative content-safety classification.
28
  </p>
29
 
@@ -45,32 +67,25 @@
45
  <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</span></div>
46
  <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</span></div>
47
 
48
- <details style="border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden; background-color: #000000;">
49
  <summary style="padding: 12px 16px; cursor: pointer; color: #FFFFFF !important; font-weight: 500; background-color: #111111; list-style: none; display: flex; justify-content: space-between; font-family: 'Ubuntu', sans-serif;">Standard Instruction</summary>
50
  <div style="background-color: #000000; border: none; border-radius: 0; margin: 0; overflow: hidden;">
51
- <div style="background-color: #1a1a1a; padding: 6px 12px; border-bottom: 1px solid #333333; display: flex; justify-content: flex-end; align-items: center;">
52
- <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif; line-height: 1.2;">Copy</button>
53
  </div>
54
- <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-size: 14px;">You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
55
 
56
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
57
 
58
  STRICT ZERO-TOLERANCE CLASSIFICATION RULES:
59
 
60
  1. Nudity & Exposure: Any full or partial nudity, exposed breasts, cleavage, buttocks, groin, or visible pubic area MUST be classified as NSFW.
61
-
62
  2. Underwear & Swimwear: Thongs, G-strings, micro-bikinis, skimpy or revealing swimwear, bras, panties, lingerie, see-through clothing, or unbuttoned tops revealing undergarments or bare torsos MUST be classified as NSFW.
63
-
64
  3. Dress-Code Analysis: Carefully analyze clothing, coverage, transparency, exposure, and the overall dress code. Revealing or sexually provocative clothing MUST be classified as NSFW.
65
-
66
  4. Poses & Suggestiveness: Sexually suggestive poses, seductive modeling, cleavage-emphasizing framing, fetish content, or explicit erotic themes MUST be classified as NSFW.
67
-
68
  5. Context & Setting: Consider the visual setting, composition, framing, and contextual cues when evaluating potentially sensitive content.
69
-
70
  6. Artwork & Animation: Anime nudes, ecchi, hentai, suggestive illustrations, or 2D/3D stylized erotica MUST be classified as NSFW.
71
-
72
  7. Sensitive Visual Content: Explicit or highly suggestive visual content MUST be classified as NSFW even when presented in non-photorealistic or artistic formats.
73
-
74
  8. Classification Threshold: When in doubt, err on the side of caution and classify the content as NSFW.
75
 
76
  Output strictly valid JSON with no extra conversational text, commentary, or markdown formatting outside the JSON object:
@@ -88,18 +103,18 @@ Output strictly valid JSON with no extra conversational text, commentary, or mar
88
  <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Quick Start with Transformers</h2>
89
 
90
  <div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;">
91
- <div style="background-color: #1a1a1a; padding: 6px 12px; border-bottom: 1px solid #333333; display: flex; justify-content: flex-end; align-items: center;">
92
- <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif; line-height: 1.2;">Copy</button>
93
  </div>
94
- <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-size: 14px;">pip install transformers
95
  pip install accelerate</pre>
96
  </div>
97
 
98
  <div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;">
99
- <div style="background-color: #1a1a1a; padding: 6px 12px; border-bottom: 1px solid #333333; display: flex; justify-content: flex-end; align-items: center;">
100
- <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif; line-height: 1.2;">Copy</button>
101
  </div>
102
- <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-size: 14px;">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
103
  import torch
104
 
105
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
@@ -155,54 +170,46 @@ print(output_text[0])</pre>
155
 
156
  <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Training Details</h2>
157
 
158
- <div style="border: 1px solid #333333; border-radius: 8px; overflow: hidden; margin: 20px 0;">
159
- <table class="vg-table" style="width: 100%; border-collapse: collapse; color: #FFFFFF;">
160
- <thead>
161
- <tr style="background-color: #1a1a1a;">
162
- <th style="text-align: left; padding: 12px 16px; border-bottom: 1px solid #333333; color: #FF4500; font-weight: 500; width: 35%;">Field</th>
163
- <th style="text-align: left; padding: 12px 16px; border-bottom: 1px solid #333333; color: #FF4500; font-weight: 500;">Value</th>
164
- </tr>
165
- </thead>
166
- <tbody>
167
- <tr>
168
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222; font-weight: 500;">Base Model</td>
169
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222;">Qwen/Qwen3.5-4B</td>
170
- </tr>
171
- <tr>
172
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222; font-weight: 500;">Model</td>
173
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222;">VisionGuardrail-4B</td>
174
- </tr>
175
- <tr>
176
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222; font-weight: 500;">Model Type</td>
177
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222;">Multimodal Content-Safety Classifier</td>
178
- </tr>
179
- <tr>
180
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222; font-weight: 500;">Training Dataset</td>
181
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222;">prithivMLmods/ImageShield-Guardrail-Pro</td>
182
- </tr>
183
- <tr>
184
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222; font-weight: 500;">Training Objective</td>
185
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222;">Content-safety guardrail classification</td>
186
- </tr>
187
- <tr>
188
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222; font-weight: 500;">Primary Classification</td>
189
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222;">Safe / Unsafe</td>
190
- </tr>
191
- <tr>
192
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222; font-weight: 500;">Safety Focus</td>
193
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222;">Not Safe for Work (NSFW) Sensual Content</td>
194
- </tr>
195
- <tr>
196
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222; font-weight: 500;">Visual Analysis</td>
197
- <td style="padding: 12px 16px; border-bottom: 1px solid #222222;">Dress Codes, Poses, Exposure & Settings</td>
198
- </tr>
199
- <tr>
200
- <td style="padding: 12px 16px; font-weight: 500;">Training Framework</td>
201
- <td style="padding: 12px 16px;">TRL</td>
202
- </tr>
203
- </tbody>
204
- </table>
205
- </div>
206
 
207
  <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Intended Use</h2>
208
  <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</span></div>
@@ -233,16 +240,29 @@ print(output_text[0])</pre>
233
  <script>
234
  function copyCode(btn) {
235
  const codeBlock = btn.parentElement.nextElementSibling;
 
 
 
 
 
 
 
 
 
 
 
 
236
  const textArea = document.createElement('textarea');
237
- textArea.value = codeBlock.innerText;
 
 
238
  document.body.appendChild(textArea);
 
239
  textArea.select();
240
  try {
241
  document.execCommand('copy');
242
  btn.innerText = 'Copied!';
243
- setTimeout(() => {
244
- btn.innerText = 'Copy';
245
- }, 2000);
246
  } catch (err) {
247
  console.error('Failed to copy text: ', err);
248
  }
 
3
 
4
  .vg-container, .vg-container * {
5
  font-family: 'Ubuntu', sans-serif;
6
+ box-sizing: border-box;
7
  }
8
 
9
  .vg-code, .vg-code * {
10
  font-family: 'Ubuntu Mono', 'Courier New', monospace !important;
 
11
  }
12
 
13
+ .vg-table {
14
+ width: 100%;
15
+ border-collapse: separate;
16
+ border-spacing: 0;
17
+ margin: 20px 0;
18
+ color: #FFFFFF;
19
+ border: 1px solid #333333;
20
+ border-radius: 6px;
21
+ overflow: hidden;
22
  }
23
 
24
+ .vg-table tr:not(:last-child) td {
25
+ border-bottom: 1px solid #333333;
26
+ }
27
+
28
+ .vg-table td:first-child {
29
+ border-right: 1px solid #333333;
30
+ width: 32%;
31
+ background-color: #121212;
32
+ font-weight: 500;
33
+ color: #DDDDDD;
34
+ padding: 10px 16px;
35
+ }
36
+
37
+ .vg-table td:last-child {
38
+ background-color: #080808;
39
+ color: #FFFFFF;
40
+ padding: 10px 16px;
41
  }
42
  </style>
43
 
 
45
 
46
  <h1 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 0;">VisionGuardrail-4B</h1>
47
 
48
+ <p style="color: #FFFFFF; margin: 16px 0;">
49
  <b>VisionGuardrail-4B</b> is a multimodal content-safety classifier based on <b>Qwen/Qwen3.5-4B</b> and trained on the <a href="https://huggingface.co/datasets/prithivMLmods/ImageShield-Guardrail-Pro" style="color: #FF4500; text-decoration: none;">prithivMLmods/ImageShield-Guardrail-Pro</a> content-safety guardrail dataset. The model is designed to classify visual content as <b>Safe</b> or <b>Unsafe</b>, with a particular focus on detecting <b>Not Safe for Work (NSFW) sensual content</b> and other potentially sensitive visual content. VisionGuardrail-4B excels at detecting <b>explicit and sensitive visual content</b>, with detailed analysis of <b>dress codes, clothing exposure, poses, framing, and different visual settings</b> to support conservative content-safety classification.
50
  </p>
51
 
 
67
  <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Zero-Tolerance Safety Classification</b>: Uses a conservative classification policy that favors safety when the content is ambiguous.</span></div>
68
  <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Structured Output</b>: Produces a machine-readable JSON response containing a caption, classification, and reasoning.</span></div>
69
 
70
+ <details style="border: 1px solid #333333; border-radius: 4px; margin: 24px 0 16px 0; overflow: hidden; background-color: #000000;">
71
  <summary style="padding: 12px 16px; cursor: pointer; color: #FFFFFF !important; font-weight: 500; background-color: #111111; list-style: none; display: flex; justify-content: space-between; font-family: 'Ubuntu', sans-serif;">Standard Instruction</summary>
72
  <div style="background-color: #000000; border: none; border-radius: 0; margin: 0; overflow: hidden;">
73
+ <div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; display: flex; justify-content: flex-end; align-items: center;">
74
+ <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
75
  </div>
76
+ <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px; white-space: pre-wrap; line-height: 1.45;">You are a strict, zero-tolerance parental control content-safety guardrail classifier for visual media.
77
 
78
  Your role is minor protection: any media containing suggestive, revealing, sexually provocative, or explicit visual elements must be flagged as NSFW.
79
 
80
  STRICT ZERO-TOLERANCE CLASSIFICATION RULES:
81
 
82
  1. Nudity & Exposure: Any full or partial nudity, exposed breasts, cleavage, buttocks, groin, or visible pubic area MUST be classified as NSFW.
 
83
  2. Underwear & Swimwear: Thongs, G-strings, micro-bikinis, skimpy or revealing swimwear, bras, panties, lingerie, see-through clothing, or unbuttoned tops revealing undergarments or bare torsos MUST be classified as NSFW.
 
84
  3. Dress-Code Analysis: Carefully analyze clothing, coverage, transparency, exposure, and the overall dress code. Revealing or sexually provocative clothing MUST be classified as NSFW.
 
85
  4. Poses & Suggestiveness: Sexually suggestive poses, seductive modeling, cleavage-emphasizing framing, fetish content, or explicit erotic themes MUST be classified as NSFW.
 
86
  5. Context & Setting: Consider the visual setting, composition, framing, and contextual cues when evaluating potentially sensitive content.
 
87
  6. Artwork & Animation: Anime nudes, ecchi, hentai, suggestive illustrations, or 2D/3D stylized erotica MUST be classified as NSFW.
 
88
  7. Sensitive Visual Content: Explicit or highly suggestive visual content MUST be classified as NSFW even when presented in non-photorealistic or artistic formats.
 
89
  8. Classification Threshold: When in doubt, err on the side of caution and classify the content as NSFW.
90
 
91
  Output strictly valid JSON with no extra conversational text, commentary, or markdown formatting outside the JSON object:
 
103
  <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Quick Start with Transformers</h2>
104
 
105
  <div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;">
106
+ <div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; display: flex; justify-content: flex-end; align-items: center;">
107
+ <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
108
  </div>
109
+ <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px; white-space: pre-wrap; line-height: 1.45;">pip install transformers
110
  pip install accelerate</pre>
111
  </div>
112
 
113
  <div style="background-color: #000000; border: 1px solid #333333; border-radius: 4px; margin-bottom: 16px; overflow: hidden;">
114
+ <div style="background-color: #1a1a1a; padding: 8px 16px; border-bottom: 1px solid #333333; display: flex; justify-content: flex-end; align-items: center;">
115
+ <button onclick="copyCode(this)" style="background-color: #333333; color: #FFFFFF; border: none; padding: 4px 10px; cursor: pointer; border-radius: 4px; font-size: 12px; font-family: 'Ubuntu', sans-serif;">Copy</button>
116
  </div>
117
+ <pre class="vg-code" style="margin: 0; padding: 16px; background-color: #000000 !important; color: #FFFFFF !important; overflow-x: auto; font-family: 'Ubuntu Mono', 'Courier New', monospace !important; font-size: 14px; white-space: pre-wrap; line-height: 1.45;">from transformers import Qwen3_5ForConditionalGeneration, AutoProcessor
118
  import torch
119
 
120
  model = Qwen3_5ForConditionalGeneration.from_pretrained(
 
170
 
171
  <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Training Details</h2>
172
 
173
+ <table class="vg-table">
174
+ <tbody>
175
+ <tr>
176
+ <td>Base Model</td>
177
+ <td>Qwen/Qwen3.5-4B</td>
178
+ </tr>
179
+ <tr>
180
+ <td>Model</td>
181
+ <td>VisionGuardrail-4B</td>
182
+ </tr>
183
+ <tr>
184
+ <td>Model Type</td>
185
+ <td>Multimodal Content-Safety Classifier</td>
186
+ </tr>
187
+ <tr>
188
+ <td>Training Dataset</td>
189
+ <td>prithivMLmods/ImageShield-Guardrail-Pro</td>
190
+ </tr>
191
+ <tr>
192
+ <td>Training Objective</td>
193
+ <td>Content-safety guardrail classification</td>
194
+ </tr>
195
+ <tr>
196
+ <td>Primary Classification</td>
197
+ <td>Safe / Unsafe</td>
198
+ </tr>
199
+ <tr>
200
+ <td>Safety Focus</td>
201
+ <td>Not Safe for Work (NSFW) Sensual Content</td>
202
+ </tr>
203
+ <tr>
204
+ <td>Visual Analysis</td>
205
+ <td>Dress Codes, Poses, Exposure &amp; Settings</td>
206
+ </tr>
207
+ <tr>
208
+ <td>Training Framework</td>
209
+ <td>TRL</td>
210
+ </tr>
211
+ </tbody>
212
+ </table>
 
 
 
 
 
 
 
 
213
 
214
  <h2 style="color: #FFFFFF; font-weight: 500; border-bottom: 1px solid #333333; padding-bottom: 8px; margin-top: 32px;">Intended Use</h2>
215
  <div style="display: flex; align-items: flex-start; margin-bottom: 8px; color: #FFFFFF;"><span style="margin-right: 12px; color: #FFFFFF; font-weight: bold;">+</span><span><b>Content Safety Classification</b>: Classifying visual media as safe or unsafe.</span></div>
 
240
  <script>
241
  function copyCode(btn) {
242
  const codeBlock = btn.parentElement.nextElementSibling;
243
+ const textToCopy = codeBlock.innerText.trim();
244
+ if (navigator.clipboard && window.isSecureContext) {
245
+ navigator.clipboard.writeText(textToCopy).then(() => {
246
+ btn.innerText = 'Copied!';
247
+ setTimeout(() => { btn.innerText = 'Copy'; }, 2000);
248
+ }).catch(() => fallbackCopy(textToCopy, btn));
249
+ } else {
250
+ fallbackCopy(textToCopy, btn);
251
+ }
252
+ }
253
+
254
+ function fallbackCopy(text, btn) {
255
  const textArea = document.createElement('textarea');
256
+ textArea.value = text;
257
+ textArea.style.position = 'fixed';
258
+ textArea.style.opacity = '0';
259
  document.body.appendChild(textArea);
260
+ textArea.focus();
261
  textArea.select();
262
  try {
263
  document.execCommand('copy');
264
  btn.innerText = 'Copied!';
265
+ setTimeout(() => { btn.innerText = 'Copy'; }, 2000);
 
 
266
  } catch (err) {
267
  console.error('Failed to copy text: ', err);
268
  }