In [1]:
from IPython.display import HTML, display

display(HTML('''<script>
code_show=true; 
function code_toggle() {
 if (code_show){
 $('div.input').hide();
 } else {
 $('div.input').show();
 }
 code_show = !code_show
} 
$( document ).ready(code_toggle);
</script>
toggle the code of this notebook on/off &nbsp;<a href="javascript:code_toggle()">^</a>'''))
toggle the code of this notebook on/off  ^

PANORAMAS OF CINEMA online

// PANORAMA CREATOR

v0.03

In [2]:
# GLOBAL
tag_http = 'http://poctag-env.eba-vjpstfpz.eu-central-1.elasticbeanstalk.com/tags'
button_color = 'black' # #7d1b27

PANORAMA OF IMAGES

tags index

In [3]:
import requests
import ipywidgets as widgets

this_request = tag_http+'?action=GET_ALL_TAGS'
r = requests.get(this_request).json()['body']
for e in sorted(r):
    print(e, end='  .  ')
    
def get_tags(event):
    clear_output()

    this_request = tag_http+'?action=GET_ALL_TAGS'
    r = requests.get(this_request).json()['body']
    for e in sorted(r):
        print(e, end='  .  ')
    
    display(refresh_tags_button)
    
refresh_tags_button = widgets.Button(description="refresh tags", button_style='info')
refresh_tags_button.style.button_color = button_color
display(refresh_tags_button)
refresh_tags_button.on_click(get_tags)
 mouth  .  Archive  .  Elizabeth  .  H2O  .  Marchant  .  Na  .  Sophists’ money  .  Spirit  .  agora  .  agora portal  .  agora theatre  .  aiakos  .  aisle  .  alien  .  all  .  amphitheatre  .  apollo  .  apollon  .  apotheosium  .  applause  .  arava_valley  .  arcade  .  architecturalcomponent  .  archive  .  area  .  area_lizzy  .  area_lizzy2  .  arena  .  ark  .  assembly  .  atmosphere  .  attack  .  audience  .  auditorium  .  balcony  .  balloon  .  ballroom  .  bank  .  banquet  .  banquet panorama  .  banquet2  .  banquetpanorama  .  bar  .  baroque  .  basileion  .  basileios  .  basilica  .  basilica_altar  .  basilica_atmosphere  .  basilica_ceiling  .  basilica_columns  .  basilica_floor  .  basin  .  bath  .  bath   .  bathrobe  .  bderoom  .  beach  .  bedroom  .  bedroom_atmosphere  .  bema  .  big_hall  .  billboard  .  biosphere  .  bird  .  bistrot_atmosphere  .  bistrot_ceiling  .  bistrot_columns  .  bistrot_floor  .  bistrot_table  .  bite  .  black  .  blackout  .  blade-runner  .  bladerunner  .  blood  .  blue  .  boat  .  bondage  .  book  .  boudoir  .  bouleterion  .  boxing   .  bubble  .  buffet  .  building site  .  burning  .  cafe  .  cage  .  camping  .  candles  .  candy  .  capsule  .  carpet  .  carrousel  .  cassettes  .  catacombs  .  catastrophe  .  cathedral  .  cave  .  cemetery  .  centralizing  .  ceremony  .  ch  .  chairs  .  chaiselongue  .  chandelier  .  chase  .  chess  .  children  .  chr  .  chrome  .  church  .  churches  .  cigarette  .  cinema  .  circe  .  circe_confusing  .  circe_openings  .  circe_roofs  .  circe_sorted_1  .  circe_textile  .  circe_walls  .  circle  .  circus  .  city  .  cityscape  .  classicism  .  clinic  .  clo  .  cloche  .  cloud  .  colonade  .  color  .  color-palette  .  colour  .  colours  .  columns  .  confession  .  connections  .  continuous_space  .  cook  .  copy  .  coral  .  corner  .  corridor  .  council  .  coupola  .  courage  .  courtyard  .  couveuse  .  coverBrief  .  craft  .  creation  .  crowd  .  crystal  .  cupbearer  .  cupola  .  curtain  .  cycle  .  cycling  .  danae  .  dance  .  dead animals  .  delirium  .  desert  .  detail  .  diams  .  diner  .  dining  .  dining hall  .  diningRed  .  dining_room  .  dinner  .  diplomatic_Material  .  diplomatic_corridor  .  diplomatic_furniture  .  diplomatic_material  .  domestic  .  dominic  .  doors  .  double_helix  .  dpilomatic_corridor  .  draught  .  dress_up  .  dressedup  .  dressingroom  .  drink  .  duble_helix  .  dumbwaiter  .  dumbwaiter_mouth  .  dumbwaiter_plate  .  dumbwaiter_shaft  .  echo  .  echo_material  .  echo_structure  .  echo_topo  .  egg  .  egg_cook  .  eiffel tower  .  electric  .  elements  .  elevator  .  elevator_shaft  .  elisabeth  .  embty_room  .  entrance  .  entrance_hall_lizzy  .  escalation  .  event  .  excess  .  fabric  .  facade  .  facade_lizzy  .  facde  .  fall  .  fashion  .  feast  .  figure  .  fire  .  fire   .  floating_tank  .  flood  .  floor  .  foam  .  fog  .  food  .  food   .  forest  .  forest/swamp  .  fountain  .  fountain_of_youth  .  foyer  .  frankenstein  .  free  .  friendliness  .  fur  .  gallery  .  garbage dump  .  garden  .  garden-city  .  gate  .  gift  .  glas_breaking  .  glass  .  god  .  gold  .  green_marble  .  greenhouse  .  grid  .  grotte  .  grotto  .  gsm  .  guest  .  guests  .  guild  .  guilt  .  hall  .  hand  .  hearthbeat_smelling  .  heaven  .  hedge  .  hell  .  helmsman  .  hephaistos  .  horizon  .  hotel-room  .  ice  .  iceberg  .  illusion  .  industry  .  influencer  .  ins  .  insect  .  inside  .  interaction  .  interior  .  interspace  .  jewelry  .  joy  .  justice  .  kai  .  kill  .  king'sCarrousel  .  king'sChamber  .  king'sCity  .  king'sDinner  .  king'sHall  .  king'sHorse  .  king'sStage  .  king'sYacht  .  kiss  .  kitchen  .  kitchen_element  .  kitchen_elements  .  kitchen_material  .  labblue  .  labyrinth  .  landscape  .  latermaybe  .  lavatorium  .  lavatory  .  lecture_room  .  lenny  .  letter  .  liberality  .  library  .  library_work  .  liftknopf  .  light  .  light   .  light_hearing  .  limestone  .  line1  .  line2  .  line3  .  line4  .  living_room  .  lizzyszoo  .  lobby  .  lynchean  .  magic  .  magnanimity  .  magnificence  .  main_hall  .  marble  .  market  .  material  .  material_kitchen  .  maybe  .  maybe   .  maybelater  .  maze_facade  .  media  .  medieval city  .  meeting  .  menagerie  .  menu  .  metis  .  metis_columns  .  metis_openings  .  metis_patterns  .  metis_roofs  .  metis_sorted_1  .  metis_structure  .  mezzanine  .  mint  .  mirror  .  mirroring  .  mix  .  monitor  .  monster  .  monument  .  monument   .  mor  .  moscow  .  mother  .  mouth  .  muesum  .  narrow  .  nature  .  newsroom  .  niche  .  nomadic_space  .  normality  .  oculus  .  office  .  one_movie  .  oparea  .  openings  .  opera  .  opera_area  .  operating-room  .  optheosium  .  ornament  .  ornamentarium  .  outside  .  ouverture  .  painting  .  palace  .  palacesbath  .  palacescompartments  .  palacescover  .  palacescover2  .  palacescover3  .  palacesdelicacies  .  palacesface  .  palacesfashion  .  palacesfoyer  .  palacesgrotto  .  palaceshall  .  palaceslover  .  palacesobjects  .  palacesompartments  .  palacespaintings  .  palacesralationtoparis  .  palacesrelationtoparis  .  palacesrextures  .  palacesship  .  palacessuitcase  .  palacestextures  .  palacestower  .  pandora  .  pandora_bib  .  pandora_out  .  pantheon  .  parano  .  paris  .  parliament  .  party  .  passetto  .  passetto_mouth  .  patience  .  pattern  .  people mass  .  piano  .  pier  .  pink  .  planning  .  plastic  .  plate  .  playground  .  plaza  .  plenty  .  prison  .  procession  .  protest  .  rain  .  raining  .  rave  .  reception  .  recovery  .  red  .  resting  .  rich forest  .  ritual  .  rituals  .  rock  .  room  .  s  .  sacrifice  .  sad  .  salon  .  satin  .  scaffolding  .  scenario  .  science  .  screen  .  secret  .  seine  .  seinepanorama  .  senses  .  ser  .  server  .  shadow  .  shame  .  shape-of-water  .  shapes-of-water  .  sheep  .  shine  .  shining  .  ship  .  shopping mall  .  silhouette  .  site  .  sittinginbath  .  skull  .  sky  .  skyline  .  sleep  .  snow  .  snow   .  solar  .  sound  .  sounds_touching  .  sounds_watching  .  sparks  .  specatcle  .  speech  .  spiegelsaal  .  stage  .  stair  .  staircase  .  stairs  .  steam  .  steel structure  .  steps  .  stone  .  stones  .  strategeion  .  structure  .  studio  .  surrealism  .  surroundings  .  symmetry  .  synesthetic  .  table  .  taste_hearing  .  temperance  .  temple  .  tennis  .  tent  .  textile  .  texture  .  textures  .  the city  .  theater 1  .  theater1  .  theatre  .  this  .  throne  .  tiles  .  time_seeing  .  tomb  .  torch  .  tower  .  training_ground  .  transition  .  transparency  .  tree  .  treeandbalcony  .  trickster  .  underwater  .  university  .  violin  .  void  .  waiter  .  wallpaper  .  wasteland  .  water  .  waterdrop  .  waterfall  .  wave  .  white  .  white_space  .  wi  .  wild  .  window  .  windows  .  wine_glass  .  wittiness  .  woman  .  wtc  .  wunderkammer  .  yellow  .  

users index

In [4]:
this_request = tag_http+'?action=GET_ALL_USERS'
r = requests.get(this_request).json()['body']
for e in sorted(r):
    print(e, end='  .  ')

def get_users(event):
    clear_output()

    this_request = tag_http+'?action=GET_ALL_USERS'
    r = requests.get(this_request).json()['body']
    for e in sorted(r):
        print(e, end='  .  ')
    
    display(refresh_users_button)

        
refresh_users_button = widgets.Button(description="refresh users", button_style='info')
refresh_users_button.style.button_color = button_color
display(refresh_users_button)
refresh_users_button.on_click(get_users)
3-2  .  Helia  .  Julie  .  Rachelle  .  archive  .  birk  .  circe  .  cowboy  .  dominic  .  eva  .  flavio  .  gaad  .  gsm  .  h  .  heldc  .  helia  .  hero  .  jb  .  jno  .  jorge  .  julie  .  julie   .  k  .  lah  .  laura  .  liquid  .  oliver  .  page  .  poureli  .  queenlizzy  .  sebastian  .  secret  .  sigi  .  slash  .  sophie  .  stan  .  toti  .  vampire  .  wayward  .  

> type your user name and/or tag

In [5]:
from IPython.display import clear_output
from ipywidgets import interactive

def getUser(user):
    return

def getTag(tag):
    return

def refresh(event):
    clear_output()
    display(w_tag)
    display(w_user)
    display(add_refresh_button)
    
    global this_user, this_tag
    this_user = w_user.kwargs['user']
    this_tag = w_tag.kwargs['tag']
    
    if len(this_user) > 0 and len(this_tag) > 0:
        this_request = tag_http+'?action=GET_FRAMES_USER_TAG&tag=%s&user=%s'%(this_tag,this_user)
        my_frames_tag = requests.get(this_request).json()
        this_length = len(my_frames_tag['body'])
        print (this_length, 'images to render')
    elif len(this_user) > 0 and len(this_tag) == 0:
        this_request = tag_http+'?action=GET_FRAMES_USER&user=%s'%(this_user)
        my_frames_tag = requests.get(this_request).json()
        this_length = len(my_frames_tag['body'])
        print (this_length, 'images to render')
        this_tags = set([ f['tag'] for f in my_frames_tag['body'] ])
        print (this_user, 'is talking about  .  ', end='')
        for e in sorted(this_tags): print(e, end='  .  ')
    elif len(this_user) == 0 and len(this_tag) > 0:
        this_request = tag_http+'?action=GET_FRAMES_TAG&tag=%s'%(this_tag)
        my_frames_tag = requests.get(this_request).json()
        this_length = len(my_frames_tag['body'])
        print (this_length, 'images to render')
        this_users = set([ f['user'] for f in my_frames_tag['body'] ])
        print (this_tag, 'is talked about by  .  ', end='')
        for e in sorted(this_users): print(e, end='  .  ')
    else:
        print ('type a user name and/or a tag')

w_user = interactive(getUser, user='')
w_tag = interactive(getTag, tag='')

add_refresh_button = widgets.Button(description="refresh", button_style='info')
add_refresh_button.style.button_color = button_color
add_refresh_button.on_click(refresh)

display(w_tag)
display(w_user)
display(add_refresh_button)
In [ ]:
 

> select your options

In [ ]:
 
In [6]:
#
def getType(panorama, orientation, square, resolution):
    return

def getSize(size):
    return 

# BUTTON EVENT
def make_request(event):
    clear_output()
    display(ui2)
    display(ui1)
    display(request_panorama_button)

    this_size = size.kwargs['size']
    this_type = panorama.value
    this_square = square.value
    this_contour = 'no'
    this_resolution = resolution.value
    
    my_orientation = orientation.value
    if my_orientation == '[ ]': this_orientation = 'square'
    else: this_orientation = my_orientation

    this_query = 'http://poccreatepanorama-env-1.eba-upy2qcn6.eu-central-1.elasticbeanstalk.com/panorama?'
    if this_type: this_query = this_query+'type=%s'%this_type
    if this_user: this_query = this_query+'&user=%s'%this_user
    if this_tag: this_query = this_query+'&tag=%s'%this_tag
    if this_orientation: this_query = this_query+'&orientation=%s'%this_orientation
    if this_contour: this_query = this_query+'&images_contour=%s'%this_contour
    if this_square: this_query = this_query+'&images_square=%s'%this_square
    if this_size: this_query = this_query+'&grid=%s'%this_size
    if this_resolution: this_query = this_query+'&resolution=%s'%this_resolution
    
    # make request
    html_doc = requests.get(this_query)
    
    from bs4 import BeautifulSoup
    soup = BeautifulSoup(html_doc.text, 'html.parser')
    my_panorama = soup.p.text
    if 'https://' in my_panorama: pass
    else: print (my_panorama)

    from IPython.display import Image
    display( Image(url=my_panorama) )

panorama = widgets.RadioButtons( options=['atlas','dreams'], value='atlas', description='type' )
orientation = widgets.RadioButtons( options=['horizontal','vertical','[ ]'], value='horizontal', description='orientation', disabled=False )
square = widgets.RadioButtons( options=['no', 'yes'], value='no', description='square imgs' )
# grid / resolution box
resolution = widgets.RadioButtons( options=['low', 'high'], value='low', description='resolution' )
size = interactive(getSize, size='3,2')
#size_box = widgets.VBox([resolution, size])
# arrange in boxes
ui1 = widgets.HBox([panorama, orientation, square, resolution])
ui2 = widgets.HBox([size])
out = widgets.interactive_output(getType, {'panorama': panorama, 'orientation':orientation, 'square':square,
                                          'resolution': resolution})

display(ui2)
display(ui1)

request_panorama_button = widgets.Button(description="create panorama", button_style='info')
request_panorama_button.style.button_color = button_color
request_panorama_button.on_click(make_request)
display(request_panorama_button)
In [7]:
print('\n', '\n', '\n', '\n', '\n')
 
 
 
 

ETH Zurich      Department of Architecture      Chair for Digital Architectonics      2021

In [ ]: