nightfury commited on
Commit
b8ea3b0
β€’
1 Parent(s): ffeb8b6

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +67 -71
app.py CHANGED
@@ -44,83 +44,79 @@ Practically the algorithm is used to COLORIZE your **old BLACK & WHITE / GRAYSCA
44
  To use it, simply just upload the concerned image.<br>
45
  """
46
  article = r"""
47
- <p style='text-align: '>
48
- Given a grayscale photograph as input, this demo attacks the problem of hallucinating a plausible color version of the photograph. This problem is clearly underconstrained, so previous approaches have either relied on significant user interaction or resulted in desaturated colorizations. A fully automatic approach has been proposed that produces vibrant and realistic colorizations. The underlying uncertainty of the problem was embraced by posing it as a classification task and use class-rebalancing at training time to increase the diversity of colors in the result. The system is implemented as a feed-forward pass in a CNN at test time and is trained on over a million color images. The algorithm is evaluated using a "colorization Turing test," asking human participants to choose between a generated and ground truth color image. The method used here successfully fools humans on 32% of the trials, significantly higher than other methodology used by the other photo automation tools. Moreover, the colorization can be a powerful pretext task for self-supervised feature learning, acting as a cross-channel encoder. This approach results in state-of-the-art performance on several feature learning benchmarks.
49
- </p>
50
  <img src="https://camo.githubusercontent.com/8f849fd53753e61659664d37849703d949209ec93957d1a2fd529be9772f7030/687474703a2f2f726963687a68616e672e6769746875622e696f2f636f6c6f72697a6174696f6e2f7265736f75726365732f696d616765732f746561736572342e6a7067" alt="Teaser Image" data-canonical-src="http://richzhang.github.io/colorization/resources/images/teaser4.jpg" style="max-width: 100%;">
51
  <p>
52
- <img class="round" style="height:275px" src="http://richzhang.github.io/colorization/resources/images/net_diagram.jpg">
53
  </p>
54
-
55
  <div class="footer">
56
- <p>Built by <a href="" style="text-decoration: underline;" target="_blank">Dushyantsinh Jadeja</a> & the Model being used in here is from <a href="https://github.com/richzhang/colorization" style="text-decoration: underline;" target="_blank">richzhang</a> - Gradio Demo by πŸ€— Hugging Face
57
- </p>
58
- </div>
59
- <div class="acknowledgments">
60
- <p><h4>LICENSE</h4></p>
61
-
62
- <h3 class="mt-0 mb-2 h4">BSD 2-Clause "Simplified" License</h3>
63
- <p class="mb-0 color-fg-muted text-small pr-2">A permissive license that comes in two variants, the BSD 2-Clause and BSD 3-Clause. Both have very minute differences to the MIT license.</p>
64
- <h4 class="mt-1 mb-2 h5">Permissions</h4>
65
- <ul class="list-style-none">
66
- <li class="text-small pl-3">
67
- <svg width="13" class="octicon octicon-check color-fg-success ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>
68
- <span class="v-align-middle" title="The licensed material and derivatives may be used for commercial purposes.">
69
- Commercial use
70
- </span>
71
- </li>
72
- <li class="text-small pl-3">
73
- <svg width="13" class="octicon octicon-check color-fg-success ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>
74
- <span class="v-align-middle" title="The licensed material may be modified.">
75
- Modification
76
- </span>
77
- </li>
78
- <li class="text-small pl-3">
79
- <svg width="13" class="octicon octicon-check color-fg-success ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>
80
- <span class="v-align-middle" title="The licensed material may be distributed.">
81
- Distribution
82
- </span>
83
- </li>
84
- <li class="text-small pl-3">
85
- <svg width="13" class="octicon octicon-check color-fg-success ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true"><path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path></svg>
86
- <span class="v-align-middle" title="The licensed material may be used and modified in private.">
87
- Private use
88
- </span>
89
- </li>
90
- </ul>
91
- <h4 class="mt-1 mb-2 h5">Limitations</h4>
92
- <ul class="list-style-none">
93
- <li class="text-small pl-3">
94
- <svg width="13" class="octicon octicon-x color-fg-danger ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true"><path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg>
95
- <span class="v-align-middle" title="This license includes a limitation of liability.">
96
- Liability
97
- </span>
98
- </li>
99
- <li class="text-small pl-3">
100
- <svg width="13" class="octicon octicon-x color-fg-danger ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true"><path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path></svg>
101
- <span class="v-align-middle" title="This license explicitly states that it does NOT provide any warranty.">
102
- Warranty
103
- </span>
104
- </li>
105
- </ul>
106
- <h4 class="mt-1 mb-2 h5">Conditions</h4>
107
- <ul class="list-style-none">
108
- <li class="text-small pl-3">
109
- <svg width="13" class="octicon octicon-info color-fg-accent ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true"><path fill-rule="evenodd" d="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z"></path></svg>
110
- <span class="v-align-middle" title="A copy of the license and copyright notice must be included with the licensed material.">
111
- License and copyright notice
112
- </span>
113
- </li>
114
- </ul>
115
- <p class="color-fg-muted text-small mb-0 border-top col-12 float-left p-2 px-sm-3">
116
- This is not legal advice.
117
- <a href="https://docs.github.com/articles/licensing-a-repository/#disclaimer">Learn more about repository licenses</a>.
118
- </p>
119
  </div>
120
- For the full list of restrictions please <a href="https://github.dev/richzhang/colorization/blob/master/LICENSE" target="_blank" style="text-decoration: underline;" target="_blank">read the license</a></p>
121
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
122
  <br>
123
- <center><img src='https://visitor-badge.glitch.me/badge?page_id=dj_colorization_eccv16siggraph17' alt='visitor badge'></center>
 
 
124
  """
125
 
126
  #with gr.Interface(css=css) as mainBody:
 
44
  To use it, simply just upload the concerned image.<br>
45
  """
46
  article = r"""
47
+ <p style='text-align: '> Given a grayscale photograph as input, this demo attacks the problem of hallucinating a plausible color version of the photograph. This problem is clearly underconstrained, so previous approaches have either relied on significant user interaction or resulted in desaturated colorizations. A fully automatic approach has been proposed that produces vibrant and realistic colorizations. The underlying uncertainty of the problem was embraced by posing it as a classification task and use class-rebalancing at training time to increase the diversity of colors in the result. The system is implemented as a feed-forward pass in a CNN at test time and is trained on over a million color images. The algorithm is evaluated using a "colorization Turing test," asking human participants to choose between a generated and ground truth color image. The method used here successfully fools humans on 32% of the trials, significantly higher than other methodology used by the other photo automation tools. Moreover, the colorization can be a powerful pretext task for self-supervised feature learning, acting as a cross-channel encoder. This approach results in state-of-the-art performance on several feature learning benchmarks. </p>
 
 
48
  <img src="https://camo.githubusercontent.com/8f849fd53753e61659664d37849703d949209ec93957d1a2fd529be9772f7030/687474703a2f2f726963687a68616e672e6769746875622e696f2f636f6c6f72697a6174696f6e2f7265736f75726365732f696d616765732f746561736572342e6a7067" alt="Teaser Image" data-canonical-src="http://richzhang.github.io/colorization/resources/images/teaser4.jpg" style="max-width: 100%;">
49
  <p>
50
+ <img class="round" style="height:275px" src="http://richzhang.github.io/colorization/resources/images/net_diagram.jpg">
51
  </p>
 
52
  <div class="footer">
53
+ <p>Built by <a href="" style="text-decoration: underline;" target="_blank">Dushyantsinh Jadeja</a> & the Model being used in here is from <a href="https://github.com/richzhang/colorization" style="text-decoration: underline;" target="_blank">richzhang</a> - Gradio Demo by πŸ€— Hugging Face </p>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
54
  </div>
55
+ <div class="acknowledgments">
56
+ <p>
57
+ <h4>LICENSE</h4>
58
+ </p>
59
+ <p class="text-small color-fg-muted mb-0 lh-condensed-ultra"> richzhang/colorization is licensed under the </p>
60
+ <h3 class="mt-0 mb-2 h4">BSD 2-Clause "Simplified" License</h3>
61
+ <p class="mb-0 color-fg-muted text-small pr-2">A permissive license that comes in two variants, the BSD 2-Clause and BSD 3-Clause. Both have very minute differences to the MIT license.</p>
62
+ <h4 class="mt-1 mb-2 h5">Permissions</h4>
63
+ <ul class="list-style-none">
64
+ <li class="text-small pl-3">
65
+ <svg width="13" class="octicon octicon-check color-fg-success ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true">
66
+ <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path>
67
+ </svg>
68
+ <span class="v-align-middle" title="The licensed material and derivatives may be used for commercial purposes."> Commercial use </span>
69
+ </li>
70
+ <li class="text-small pl-3">
71
+ <svg width="13" class="octicon octicon-check color-fg-success ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true">
72
+ <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path>
73
+ </svg>
74
+ <span class="v-align-middle" title="The licensed material may be modified."> Modification </span>
75
+ </li>
76
+ <li class="text-small pl-3">
77
+ <svg width="13" class="octicon octicon-check color-fg-success ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true">
78
+ <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path>
79
+ </svg>
80
+ <span class="v-align-middle" title="The licensed material may be distributed."> Distribution </span>
81
+ </li>
82
+ <li class="text-small pl-3">
83
+ <svg width="13" class="octicon octicon-check color-fg-success ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true">
84
+ <path fill-rule="evenodd" d="M13.78 4.22a.75.75 0 010 1.06l-7.25 7.25a.75.75 0 01-1.06 0L2.22 9.28a.75.75 0 011.06-1.06L6 10.94l6.72-6.72a.75.75 0 011.06 0z"></path>
85
+ </svg>
86
+ <span class="v-align-middle" title="The licensed material may be used and modified in private."> Private use </span>
87
+ </li>
88
+ </ul>
89
+ <h4 class="mt-1 mb-2 h5">Limitations</h4>
90
+ <ul class="list-style-none">
91
+ <li class="text-small pl-3">
92
+ <svg width="13" class="octicon octicon-x color-fg-danger ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true">
93
+ <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path>
94
+ </svg>
95
+ <span class="v-align-middle" title="This license includes a limitation of liability."> Liability </span>
96
+ </li>
97
+ <li class="text-small pl-3">
98
+ <svg width="13" class="octicon octicon-x color-fg-danger ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true">
99
+ <path fill-rule="evenodd" d="M3.72 3.72a.75.75 0 011.06 0L8 6.94l3.22-3.22a.75.75 0 111.06 1.06L9.06 8l3.22 3.22a.75.75 0 11-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 01-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 010-1.06z"></path>
100
+ </svg>
101
+ <span class="v-align-middle" title="This license explicitly states that it does NOT provide any warranty."> Warranty </span>
102
+ </li>
103
+ </ul>
104
+ <h4 class="mt-1 mb-2 h5">Conditions</h4>
105
+ <ul class="list-style-none">
106
+ <li class="text-small pl-3">
107
+ <svg width="13" class="octicon octicon-info color-fg-accent ml-n3 v-align-middle" viewBox="0 0 16 16" version="1.1" height="13" aria-hidden="true">
108
+ <path fill-rule="evenodd" d="M8 1.5a6.5 6.5 0 100 13 6.5 6.5 0 000-13zM0 8a8 8 0 1116 0A8 8 0 010 8zm6.5-.25A.75.75 0 017.25 7h1a.75.75 0 01.75.75v2.75h.25a.75.75 0 010 1.5h-2a.75.75 0 010-1.5h.25v-2h-.25a.75.75 0 01-.75-.75zM8 6a1 1 0 100-2 1 1 0 000 2z"></path>
109
+ </svg>
110
+ <span class="v-align-middle" title="A copy of the license and copyright notice must be included with the licensed material."> License and copyright notice </span>
111
+ </li>
112
+ </ul>
113
+ <p class="color-fg-muted text-small mb-0 border-top col-12 float-left p-2 px-sm-3"> This is not legal advice. <a href="https://docs.github.com/articles/licensing-a-repository/#disclaimer">Learn more about repository licenses</a>. </p>
114
+ </div> For the full list of restrictions please <a href="https://github.dev/richzhang/colorization/blob/master/LICENSE" target="_blank" style="text-decoration: underline;" target="_blank">read the license</a>
115
+ </p>
116
  <br>
117
+ <center>
118
+ <img src='https://visitor-badge.glitch.me/badge?page_id=dj_colorization_eccv16siggraph17' alt='visitor badge'>
119
+ </center>
120
  """
121
 
122
  #with gr.Interface(css=css) as mainBody: