From 642b6c412e920b0a41dafd78982ed363a747f99b Mon Sep 17 00:00:00 2001 From: Jules Laplace Date: Fri, 28 Jun 2019 00:44:59 -0400 Subject: css fixes etc --- client/chart/constants.js | 18 ++++++++++++++++++ client/chart/singlePie.chart.js | 18 ++++++------------ client/table/citations.table.js | 16 ++++++++-------- megapixels/app/site/builder.py | 2 +- site/assets/css/css.css | 2 +- site/content/pages/datasets/msceleb/index.md | 4 ++-- site/content/pages/research/_introduction/index.md | 2 +- .../pages/research/munich_security_conference/index.md | 12 ++---------- 8 files changed, 39 insertions(+), 35 deletions(-) diff --git a/client/chart/constants.js b/client/chart/constants.js index b916cbd2..6fe94433 100644 --- a/client/chart/constants.js +++ b/client/chart/constants.js @@ -15,6 +15,24 @@ export const rainbow = [ // '#888888', ] +export const bigRainbow = [ + '#9e0142', + '#d53e4f', + '#f46d43', + '#fdae61', + '#fee08b', + '#ffffbf', + '#e6f598', + '#abdda4', + '#66c2a5', + '#3288bd', + '#5e4fa2', + '#8744ae', + '#a044ae', + '#b342a4', + '#b34287', + // '#888888', +] export const colorblindSafeRainbow = [ '#a50026', '#d73027', diff --git a/client/chart/singlePie.chart.js b/client/chart/singlePie.chart.js index fcff3214..ed2da582 100644 --- a/client/chart/singlePie.chart.js +++ b/client/chart/singlePie.chart.js @@ -2,15 +2,11 @@ import React, { Component } from 'react' import csv from 'parse-csv' import C3Chart from 'react-c3js' -import { toTuples } from '../util' - import 'c3/c3.css' import './chart.css' import { - rainbow, otherCountriesLabel, - institutionOrder, institutionLabels, - initialInstitutionLookup, + rainbow, bigRainbow } from './constants' class SinglePieChart extends Component { @@ -45,7 +41,6 @@ class SinglePieChart extends Component { } render() { - const { payload } = this.props const { keys, data, fields } = this.state console.log(keys, data) const [labelField, numberField] = keys @@ -59,15 +54,14 @@ class SinglePieChart extends Component { return [label, number] }).sort((a, b) => b[1] - a[1]) - console.log(rows) - let chartRows = rows.slice(0, rowsToDisplay) - let otherCount = rows.slice(rowsToDisplay).reduce((a, b) => { return a + b[1] }, 0) + let otherCount = rows.slice(rowsToDisplay).reduce((a, b) => a + b[1], 0) if (otherCount > 0) { chartRows.push([fields.OtherLabel, otherCount]) } - console.log(rowsToDisplay, chartRows) + const height = chartRows.length < 6 ? 316 : + chartRows.length < 10 ? 336 : 356 return (
@@ -78,7 +72,7 @@ class SinglePieChart extends Component { type: 'pie', }} color={{ - pattern: rainbow, + pattern: chartRows.length < 10 ? rainbow : bigRainbow, }} tooltip={{ format: { @@ -86,7 +80,7 @@ class SinglePieChart extends Component { } }} size={{ - height: chartRows.length < 4 ? 316 : 336, + height, }} /> {fields.Caption} diff --git a/client/table/citations.table.js b/client/table/citations.table.js index 8fe46b69..ef5ab0b5 100644 --- a/client/table/citations.table.js +++ b/client/table/citations.table.js @@ -64,12 +64,12 @@ class CitationsTable extends Component { if (!q.length) { this.setState({ q, filteredCitations: formattedCitations }) } else { - let q_re = new RegExp('(' + q.replace(/\s+/g, ' ').trim().replace(' ', '|') + ')', 'gi') + let qRe = new RegExp('(' + q.replace(/\s+/g, ' ').trim().replace(' ', '|') + ')', 'gi') let filteredCitations = formattedCitations.filter(citation => ( - citation.title.match(q_re) || - citation.institution.match(q_re) || - citation.country.match(q_re) - )) + citation.title.match(qRe) || + citation.institution.match(qRe) || + citation.country.match(qRe) + )) this.setState({ q, filteredCitations }) } } @@ -85,7 +85,7 @@ class CitationsTable extends Component { case 'number': return String(data) default: - return '\"' + String(data) + '\"' + return '"' + String(data) + '"' } }) return row.join(",") @@ -96,8 +96,8 @@ class CitationsTable extends Component { titles.join(','), ...rows, ].join('\n') - ], {type: "text/csv;charset=utf-8"}); - saveAs(blob, fn); + ], { type: "text/csv;charset=utf-8" }) + saveAs(blob, fn) } render() { diff --git a/megapixels/app/site/builder.py b/megapixels/app/site/builder.py index bb1f1701..6b9aa92c 100644 --- a/megapixels/app/site/builder.py +++ b/megapixels/app/site/builder.py @@ -41,7 +41,7 @@ def build_page(fn, research_posts, datasets): elif 'research/' in fn: # skip_h1 = True # template = env.get_template("research.html") - template = env.get_template("datasets.html") + template = env.get_template("page.html") elif 'datasets/index' in fn: template = env.get_template("datasets.html") else: diff --git a/site/assets/css/css.css b/site/assets/css/css.css index adc1a2fa..816806f4 100644 --- a/site/assets/css/css.css +++ b/site/assets/css/css.css @@ -645,7 +645,7 @@ section.images { } .image:first-child:nth-last-child(2), .image:first-child:nth-last-child(2) ~ .image { - width: 300px; + width: 455px; } .image:first-child:nth-last-child(3), .image:first-child:nth-last-child(3) ~ .image { diff --git a/site/content/pages/datasets/msceleb/index.md b/site/content/pages/datasets/msceleb/index.md index 453c1522..0e457cd9 100644 --- a/site/content/pages/datasets/msceleb/index.md +++ b/site/content/pages/datasets/msceleb/index.md @@ -101,9 +101,9 @@ For example, on October 28, 2019, the MS Celeb dataset will be used for a new co And in June, shortly after [posting](https://twitter.com/adamhrv/status/1134511293526937600) about the disappearance of the MS Celeb dataset, it reemerged on [Academic Torrents](https://academictorrents.com/details/9e67eb7cc23c9417f39778a8e06cca5e26196a97/tech). As of June 10, the MS Celeb dataset files have been redistributed in at least 9 countries and downloaded 44 times without any restrictions. The files were seeded and are mostly distributed by an AI company based in China called Hyper.ai, which states that it redistributes MS Celeb and other datasets for "teachers and students of service industry-related practitioners and research institutes."[^hyperai_readme] -Earlier in 2019 images from the MS Celeb were also repackaged into another face dataset called *Racial Faces in the Wild (RFW)*. To create it, the RFW authors uploaded face images from the MS Celeb dataset to the Face++ API and used the inferred racial scores to segregate people into four subsets: Caucasian, Asian, Indian, and African each with 3,000 subjects. That dataset then appeared in a subsequent research project from researchers affiliated with IIIT-Delhi and IBM TJ Watson called [Deep Learning for Face Recognition: Pride or Prejudiced?](https://arxiv.org/abs/1904.01219), which aims to reduce bias but also inadvertently furthers racist language and ideologies that can not be repeated here. +Earlier in 2019 images from the MS Celeb were also repackaged into another face dataset called *Racial Faces in the Wild (RFW)*. To create it, the RFW authors uploaded face images from the MS Celeb dataset to the Face++ API and used the inferred racial scores to segregate people into four subsets: Caucasian, Asian, Indian, and African each with 3,000 subjects. That dataset then appeared in a subsequent research project from researchers affiliated with IIIT-Delhi and IBM TJ Watson called [Deep Learning for Face Recognition: Pride or Prejudiced?](https://arxiv.org/abs/1904.01219), which aims to reduce bias but also inadvertently furthers racist ideologies, using discredited racial terminology that cannot be repeated here. -The estimated racial scores for the MS Celeb face images used in the RFW dataset were computed using the Face++ API, which is owned by Megvii Inc, a company that has been repeatedly linked to the oppressive surveillance of Uighur Muslims in Xinjiang, China. According to posts from the [ChinAI Newsletter](https://chinai.substack.com/p/chinai-newsletter-11-companies-involved-in-expanding-chinas-public-security-apparatus-in-xinjiang) and [BuzzFeedNews](https://www.buzzfeednews.com/article/ryanmac/us-money-funding-facial-recognition-sensetime-megvii), Megvii announced in 2017 at the China-Eurasia Security Expo in Ürümqi, Xinjiang, that it would be the official technical support unit of the "Public Security Video Laboratory" in Xinjiang, China. If they didn't already, it's highly likely that Megvii has a copy of everyone's biometric faceprint from the MS Celeb dataset, either from uploads to the Face++ API or through the research projects explicitly referencing MS Celeb dataset usage, such as a 2018 paper called [GridFace: Face Rectification via Learning Local Homography Transformations](https://arxiv.org/pdf/1808.06210.pdf) jointly published by 3 authors, all of whom worked for Megvii. +The estimated racial scores for the MS Celeb face images used in the RFW dataset were computed using the Face++ API, which is owned by Megvii Inc, a company that has been repeatedly linked to the oppressive surveillance of Uighur Muslims in Xinjiang, China. According to posts from the [ChinAI Newsletter](https://chinai.substack.com/p/chinai-newsletter-11-companies-involved-in-expanding-chinas-public-security-apparatus-in-xinjiang) and [BuzzFeedNews](https://www.buzzfeednews.com/article/ryanmac/us-money-funding-facial-recognition-sensetime-megvii), Megvii announced in 2017 at the China-Eurasia Security Expo in Ürümqi, Xinjiang, that it would be the official technical support unit of the "Public Security Video Laboratory" in Xinjiang, China. If they didn't already, it's highly likely that Megvii has a copy of everyone's biometric faceprint from the MS Celeb dataset, either from uploads to the Face++ API or through research projects explicitly referencing MS Celeb dataset usage, such as a 2018 paper called [GridFace: Face Rectification via Learning Local Homography Transformations](https://arxiv.org/pdf/1808.06210.pdf) jointly published by 3 authors, all of whom worked for Megvii. ## Commercial Usage diff --git a/site/content/pages/research/_introduction/index.md b/site/content/pages/research/_introduction/index.md index b99e3048..7e839fe7 100644 --- a/site/content/pages/research/_introduction/index.md +++ b/site/content/pages/research/_introduction/index.md @@ -1,6 +1,6 @@ ------------ -status: published +status: draft title: Introducing MegaPixels desc: Introduction to Megapixels slug: 00_introduction diff --git a/site/content/pages/research/munich_security_conference/index.md b/site/content/pages/research/munich_security_conference/index.md index aba39b1c..6a1b84e9 100644 --- a/site/content/pages/research/munich_security_conference/index.md +++ b/site/content/pages/research/munich_security_conference/index.md @@ -71,7 +71,7 @@ Add text === -#### Locations Where Face Data Is Used +#### Where Face Data Is Used Add text @@ -104,16 +104,8 @@ Including over 2,000 more for racial analysis ![caption: MegaFace from U.S. Embassy Canberra](assets/4730007024.jpg) -=== columns 2 - ![caption: An image from the MegaFace dataset obtained from United Kingdom's Embassy in Italy https://flickr.com/photos/ukinitaly](assets/4606260362.jpg) - -==== - -![caption: An imgae from the MegaFace dataset obtained from the Flick account of the United States Embassy in Kabul Afghanistan https://flickr.com/photos/kabulpublicdiplomacy](assets/4749096858.jpg) - - -=== end columns +![caption: An image from the MegaFace dataset obtained from the Flickr account of the United States Embassy in Kabul, Afghanistan https://flickr.com/photos/kabulpublicdiplomacy](assets/4749096858.jpg) === columns 2 -- cgit v1.2.3-70-g09d2