Skip to content

Commit

Permalink
Add Mixpanel.
Browse files Browse the repository at this point in the history
  • Loading branch information
andreseliot committed Oct 24, 2017
1 parent b920926 commit 1c89434
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 2 deletions.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
Sortable and searchable compilation of pre-trained deep learning models. With demos and code.

## A word of warning
This is running on a server without GPU, hence it seems slow.

Also, the code may look a bit like monkey-patching for the following reasons:
- Models are cloned as submodules: therefore we have to mess around with the python path :-(
Expand All @@ -16,7 +17,7 @@ Having spent too much time installing deep learning models just to evaluate thei
## Installation
Requirements: Docker, docker-compose and enough space free for the model weights.

git clone https://github.com/EliotAndres/pretrained.ml
git clone https://github.com/EliotAndres/pretrained.ml --recursive
cd containers
docker-compose build
docker-compose up -d
Expand Down
8 changes: 8 additions & 0 deletions docs/app.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,15 @@ app
});
});

var trackMixpanel = function (name, data) {
if (location.hostname !== "localhost") {
mixpanel.track(name, data);
}
};

$scope.openModal = function (model) {
trackMixpanel("Opened Modal", {"model": model.name});

$scope.currentModel = model;
var modal = Popeye.openModal({
templateUrl: 'views/' + modals[model.subtype],
Expand Down
6 changes: 6 additions & 0 deletions docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,12 @@
<link rel="stylesheet" href="vendors/tablesort.css" />
<link rel="stylesheet" href="vendors/popeye.min.css" />
<link rel="stylesheet" href="style.css" />
<!-- start Mixpanel --><script type="text/javascript">(function(e,a){if(!a.__SV){var b=window;try{var c,l,i,j=b.location,g=j.hash;c=function(a,b){return(l=a.match(RegExp(b+"=([^&]*)")))?l[1]:null};g&&c(g,"state")&&(i=JSON.parse(decodeURIComponent(c(g,"state"))),"mpeditor"===i.action&&(b.sessionStorage.setItem("_mpcehash",g),history.replaceState(i.desiredHash||"",e.title,j.pathname+j.search)))}catch(m){}var k,h;window.mixpanel=a;a._i=[];a.init=function(b,c,f){function e(b,a){var c=a.split(".");2==c.length&&(b=b[c[0]],a=c[1]);b[a]=function(){b.push([a].concat(Array.prototype.slice.call(arguments,
0)))}}var d=a;"undefined"!==typeof f?d=a[f]=[]:f="mixpanel";d.people=d.people||[];d.toString=function(b){var a="mixpanel";"mixpanel"!==f&&(a+="."+f);b||(a+=" (stub)");return a};d.people.toString=function(){return d.toString(1)+".people (stub)"};k="disable time_event track track_pageview track_links track_forms register register_once alias unregister identify name_tag set_config reset people.set people.set_once people.increment people.append people.union people.track_charge people.clear_charges people.delete_user".split(" ");
for(h=0;h<k.length;h++)e(d,k[h]);a._i.push([b,c,f])};a.__SV=1.2;b=e.createElement("script");b.type="text/javascript";b.async=!0;b.src="undefined"!==typeof MIXPANEL_CUSTOM_LIB_URL?MIXPANEL_CUSTOM_LIB_URL:"file:"===e.location.protocol&&"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js".match(/^\/\//)?"https://cdn.mxpnl.com/libs/mixpanel-2-latest.min.js":"//cdn.mxpnl.com/libs/mixpanel-2-latest.min.js";c=e.getElementsByTagName("script")[0];c.parentNode.insertBefore(b,c)}})(document,window.mixpanel||[]);
mixpanel.init("1d56782363052e80379c4bc5074f1642");</script><!-- end Mixpanel -->


</head>
<body ng-controller="MainController">
<a href="https://github.com/EliotAndres/pretrained.ml">
Expand Down
1 change: 0 additions & 1 deletion docs/views/imageModal.html
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,6 @@ <h2 class="about_sub-headline">Demo for {{currentModel.name}}</h2>
<div ng-if="predictions.output" class="segmentation">
<img ng-src="{{serverUrl + predictions.output}}" class="segmentation-image" alt="">
<img ng-if="currentModel.subtype == 'Semantic Segmentation'" src="image/colour_scheme.png" class="segmentation-legend" alt="">
{{currentModel.subtype}}
</div>

</div>
Expand Down

0 comments on commit 1c89434

Please sign in to comment.