summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--megapixels/app/site/builder.py10
-rw-r--r--megapixels/app/site/parser.py5
-rw-r--r--megapixels/app/site/s3.py9
-rw-r--r--megapixels/commands/site/build.py14
-rw-r--r--site/public/about/credits/index.html2
-rw-r--r--site/public/about/index.html2
-rw-r--r--site/public/research/00_introduction/index.html12
-rw-r--r--site/public/research/index.html2
8 files changed, 38 insertions, 18 deletions
diff --git a/megapixels/app/site/builder.py b/megapixels/app/site/builder.py
index 895f265b..ff1a0c83 100644
--- a/megapixels/app/site/builder.py
+++ b/megapixels/app/site/builder.py
@@ -18,6 +18,8 @@ def build_page(fn, research_posts):
"""
build a single page from markdown into the appropriate template
- writes it to site/public/
+ - syncs any assets with s3
+ - handles certain index pages...
"""
metadata, sections = parser.read_metadata(fn)
@@ -91,3 +93,11 @@ def build_site():
for fn in glob.iglob(os.path.join(cfg.DIR_SITE_CONTENT, "**/*.md"), recursive=True):
build_page(fn, research_posts)
build_research_index(research_posts)
+
+def build_file(fn):
+ """
+ build just one page from a filename! =^)
+ """
+ research_posts = parser.read_research_post_index()
+ fn = os.path.join(cfg.DIR_SITE_CONTENT, fn)
+ build_page(fn, research_posts)
diff --git a/megapixels/app/site/parser.py b/megapixels/app/site/parser.py
index 6c6ad688..ca6ac77b 100644
--- a/megapixels/app/site/parser.py
+++ b/megapixels/app/site/parser.py
@@ -55,8 +55,8 @@ def format_metadata(section):
return "<section><div class='meta'>{}</div></section>".format(''.join(meta))
def format_applet(section, s3_path):
- print(section)
- payload = section.strip('```').strip().split('\n')
+ # print(section)
+ payload = section.strip('```').strip().strip('```').strip().split('\n')
applet = {}
print(payload)
if ': ' in payload[0]:
@@ -213,6 +213,7 @@ def parse_metadata(fn, sections):
metadata['sync'] = metadata['sync'] != 'false'
metadata['author_html'] = '<br>'.join(metadata['authors'].split(','))
+
return metadata, valid_sections
def read_research_post_index():
diff --git a/megapixels/app/site/s3.py b/megapixels/app/site/s3.py
index 5464d464..18133078 100644
--- a/megapixels/app/site/s3.py
+++ b/megapixels/app/site/s3.py
@@ -6,13 +6,14 @@ def sync_directory(base_fn, s3_path, metadata):
"""
Synchronize a local assets folder with S3
"""
+ if not metadata['sync']:
+ return
+
fns = {}
for fn in glob.glob(os.path.join(base_fn, 'assets/*')):
+ # print(fn)
fns[os.path.basename(fn)] = True
- if not metadata['sync']:
- return
-
remote_path = s3_path + metadata['url']
session = boto3.session.Session()
@@ -31,6 +32,7 @@ def sync_directory(base_fn, s3_path, metadata):
if 'Contents' in directory:
for obj in directory['Contents']:
s3_fn = obj['Key']
+ # print(s3_fn)
fn = os.path.basename(s3_fn)
local_fn = os.path.join(base_fn, 'assets', fn)
if fn in fns:
@@ -52,6 +54,7 @@ def sync_directory(base_fn, s3_path, metadata):
for fn in fns:
local_fn = os.path.join(base_fn, 'assets', fn)
s3_fn = os.path.join(remote_path, 'assets', fn)
+ print(s3_fn)
print("s3 create {}".format(s3_fn))
s3_client.upload_file(
local_fn,
diff --git a/megapixels/commands/site/build.py b/megapixels/commands/site/build.py
index 0a76a9ac..2d344899 100644
--- a/megapixels/commands/site/build.py
+++ b/megapixels/commands/site/build.py
@@ -4,12 +4,18 @@ Build the static site
import click
-from app.site.builder import build_site
+from app.site.builder import build_site, build_file
@click.command()
+@click.option('-i', '--input', 'input_file', required=False,
+ help='File to generate')
@click.pass_context
-def cli(ctx):
+def cli(ctx, input_file):
"""Build the static site
"""
- print('Building the site...')
- build_site()
+ if input_file:
+ print('Building {}'.format(input_file))
+ build_file(input_file)
+ else:
+ print('Building the site...')
+ build_site()
diff --git a/site/public/about/credits/index.html b/site/public/about/credits/index.html
index 67e9dcb8..b1b394bd 100644
--- a/site/public/about/credits/index.html
+++ b/site/public/about/credits/index.html
@@ -28,7 +28,7 @@
<div class="content">
<section><h1>Credits</h1>
-</section><section class='images'><div class='image'><img src='https://nyc3.digitaloceanspaces.com/megapixels/v1/site/about/assets/test.jpg' alt='alt text'><div class='caption'>alt text</div></div></section><section><ul>
+<ul>
<li>MegaPixels by Adam Harvey</li>
<li>Made with support from Mozilla</li>
<li>Site developed by Jules Laplace</li>
diff --git a/site/public/about/index.html b/site/public/about/index.html
index 67e9dcb8..b1b394bd 100644
--- a/site/public/about/index.html
+++ b/site/public/about/index.html
@@ -28,7 +28,7 @@
<div class="content">
<section><h1>Credits</h1>
-</section><section class='images'><div class='image'><img src='https://nyc3.digitaloceanspaces.com/megapixels/v1/site/about/assets/test.jpg' alt='alt text'><div class='caption'>alt text</div></div></section><section><ul>
+<ul>
<li>MegaPixels by Adam Harvey</li>
<li>Made with support from Mozilla</li>
<li>Site developed by Jules Laplace</li>
diff --git a/site/public/research/00_introduction/index.html b/site/public/research/00_introduction/index.html
index 290208f8..4349bcaf 100644
--- a/site/public/research/00_introduction/index.html
+++ b/site/public/research/00_introduction/index.html
@@ -3,8 +3,8 @@
<head>
<title>MegaPixels</title>
<meta charset="utf-8" />
- <meta name="author" content="Adam Harvey" />
- <meta name="description" content="" />
+ <meta name="author" content="Megapixels" />
+ <meta name="description" content="Introduction to Megapixels" />
<meta name="referrer" content="no-referrer" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=yes" />
<link rel='stylesheet' href='/assets/css/fonts.css' />
@@ -28,21 +28,21 @@
<div class="content">
<section>
- <h1>Untitled Page</h1>
+ <h1>00: Introduction</h1>
<div class='meta'>
<div>
<div class='gray'>Posted</div>
- <div>2018-12-31</div>
+ <div>2018-12-15</div>
</div>
<div>
<div class='gray'>By</div>
- <div>Adam Harvey</div>
+ <div>Megapixels</div>
</div>
</div>
</section>
- <section><p>It was the early 2000s. Face recognition was new and no one seemed sure exactly how well it was going to perform in practice. In theory, face recognition was poised to be a game changer, a force multiplier, a strategic military advantage, a way to make cities safer and to secure borders. This was the future John Ashcroft demanded with the Total Information Awareness act of the 2003 and that spooks had dreamed of for decades. It was a future that academics at Carnegie Mellon Universtiy and Colorado State University would help build. It was also a future that celebrities would play a significant role in building. And to the surprise of ordinary Internet users like myself and perhaps you, it was a future that millions of Internet users would unwittingly play role in creating.</p>
+ <section><div class='meta'><div><div class='gray'>Posted</div><div>Dec. 15</div></div><div><div class='gray'>Author</div><div>Adam Harvey</div></div></div></section><section><p>It was the early 2000s. Face recognition was new and no one seemed sure exactly how well it was going to perform in practice. In theory, face recognition was poised to be a game changer, a force multiplier, a strategic military advantage, a way to make cities safer and to secure borders. This was the future John Ashcroft demanded with the Total Information Awareness act of the 2003 and that spooks had dreamed of for decades. It was a future that academics at Carnegie Mellon Universtiy and Colorado State University would help build. It was also a future that celebrities would play a significant role in building. And to the surprise of ordinary Internet users like myself and perhaps you, it was a future that millions of Internet users would unwittingly play role in creating.</p>
<p>Now the future has arrived and it doesn't make sense. Facial recognition works yet it doesn't actually work. Facial recognition is cheap and accessible but also expensive and out of control. Facial recognition research has achieved headline grabbing superhuman accuracies over 99.9% yet facial recognition is also dangerously inaccurate. During a trial installation at Sudkreuz station in Berlin in 2018, 20% of the matches were wrong, a number so low that it should not have any connection to law enforcement or justice. And in London, the Metropolitan police had been using facial recognition software that mistakenly identified an alarming 98% of people as criminals <sup class="footnote-ref" id="fnref-met_police"><a href="#fn-met_police">1</a></sup>, which perhaps is a crime itself.</p>
<p>MegaPixels is an online art project that explores the history of facial recognition from the perspective of datasets. To paraphrase the artist Trevor Paglen, whoever controls the dataset controls the meaning. MegaPixels aims to unravel the meanings behind the data and expose the darker corners of the biometric industry that have contributed to its growth. MegaPixels does not start with a conclusion, a moralistic slant, or a</p>
<p>Whether or not to build facial recognition was a question that can no longer be asked. As an outspoken critic of face recognition I've developed, and hopefully furthered, my understanding during the last 10 years I've spent working with computer vision. Though I initially disagreed, I've come to see technocratic perspective as a non-negotiable reality. As Oren (nytimes article) wrote in NYT Op-Ed "the horse is out of the barn" and the only thing we can do collectively or individually is to steer towards the least worse outcome. Computational communication has entered a new era and it's both exciting and frightening to explore the potentials and opportunities. In 1997 getting access to 1 teraFLOPS of computational power would have cost you $55 million and required a strategic partnership with the Department of Defense. At the time of writing, anyone can rent 1 teraFLOPS on a cloud GPU marketplace for less than $1/day. <sup class="footnote-ref" id="fnref-asci_option_red"><a href="#fn-asci_option_red">2</a></sup>.</p>
diff --git a/site/public/research/index.html b/site/public/research/index.html
index 17b4a2a0..1acbe844 100644
--- a/site/public/research/index.html
+++ b/site/public/research/index.html
@@ -29,7 +29,7 @@
<section><h1>Research Blog</h1>
<h2>The darkside of datasets and the future of computer vision</h2>
-</section><div class='research_index'><a href='/research/00_introduction/'><section class='wide'><img src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' alt='Research post' /><section><h1>Untitled Page</h1><h2></h2></section></section></a><a href='/research/01_from_1_to_100_pixels/'><section class='wide'><img src='https://nyc3.digitaloceanspaces.com/megapixels/v1/site/research/01_from_1_to_100_pixels/assets/intro.jpg' alt='Research post' /><section><h1>From 1 to 100 Pixels</h1><h2>Photographs are for romantics. For the rest of us, it's all about data. And a photo contains a massive amount of information about who you are.</h2></section></section></a></div>
+</section><div class='research_index'><a href='/research/00_introduction/'><section class='wide'><img src='data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==' alt='Research post' /><section><h1>00: Introduction</h1><h2></h2></section></section></a><a href='/research/01_from_1_to_100_pixels/'><section class='wide'><img src='https://nyc3.digitaloceanspaces.com/megapixels/v1/site/research/01_from_1_to_100_pixels/assets/intro.jpg' alt='Research post' /><section><h1>From 1 to 100 Pixels</h1><h2>Photographs are for romantics. For the rest of us, it's all about data. And a photo contains a massive amount of information about who you are.</h2></section></section></a></div>
</div>
<footer>