In just under a fortnight, leaders from some of the world's major economies will gather in South Africa's economic heartland, Johannesburg, for the G20 summit.

But just a few kilometres from the spruced-up, highly secure venue is a city centre which the authorities are struggling to improve and keep safe.

They face major challenges in cleaning up more than 100 derelict buildings, many plagued by rubbish and open sewage, some of which have been taken over by criminal gangs.

There's guns, there's drugs, there's prostitutes, there's everything here, said Nelson Khetani, resident of a building known as MBV1, located in Joubert Park.

Neglect and a lack of maintenance have left vandalised communal kitchens stripped of their fittings, while overflowing human waste covers parts of what used to be the laundry area.

Mr Khetani told BBC Africa Eye that rooms in MBV1 had been hijacked – a phenomenon where spaces or entire residential units are taken over and controlled by criminals to collect rent for themselves and, in some circumstance, provide a base for illegal activities.

The BBC has located and confirmed that there are 102 derelict or abandoned buildings in the inner city, an area of about 18 sq km (seven sq miles), but other media reports have cited much higher figures. Some of these have been hijacked and are unfit for human habitation.

The state of the city was on the mind of President Cyril Ramaphosa when talking about the G20 summit to the city council in March.

I found the city filthy, he said.

Johannesburg Mayor Dada Morero said at the time that the city was ready to host the G20.

Last month, as part of a clean-up campaign across Johannesburg, the city council said the inner city had been targeted... for the systemic removal of pervasive lawlessness, illegal activities, hijacked properties, and critical by-law infringements.

A fire at one of these derelict buildings that killed 76 people two years ago was supposed to spur people into action, but it seems not much has changed.

The BBC visited another inner-city building, Vannin Court, where rooms were covered in dirt and strewn with litter. A strong smell of human faeces permeated the building.

Resident Sinethemba Maqoma told the BBC that council-owned Vannin Court had been hijacked, and that the city council had cut off the water.

The lack of utilities means residents cook food using portable gas tanks to power stoves. But without water or fire extinguishers nearby, the fire risks are huge.

Cars abandoned in the building's basement were partly submerged in human waste that was overflowing into an adjacent alleyway. Litter was floating on top of this slow-moving sludge of sewage.

Even amid these dire conditions, many residents still cling to hope that their voices will be heard during the G20 summit, hoping it may finally bring attention to the plight of those struggling in Johannesburg's inner city.