Cut the onion in four. Slice the garlic. Remove the rosemary needles from the stalks. Heat the olive oil in a pan, cook the onion and garlic for 20 minutes until onion take a brownish color. Add the rosemary and cook for another 3 minutes. Remove pan from the heat.
Line an oven dish with parchment paper
For the polenta, heat the milk and 500ml of vegetable stock. Add the polenta and turn down the heat to low. Let soak for 10 minutes, stirring regularly. Add the Parmesan. Pour the polenta in to oven dish and smooth out the top. Let cool for 20 minutes for the polenta to harden
Spread the crème fraiche on top of the polenta. Sprinkle with 2 tbsp of Gruyere/Emmental,. Arrange the onion and rosemary on top, and sprinkle with the rest of the cheese. Season with see salt and pepper.
Bake for 15-20 minutes on 400F. Take out of the oven and let cool for a few minutes before serving.