In a grocery store somewhere in North America, a small drone floats from aisle to aisle, hovering like a hummingbird that has traded its nimble wings for tiny propellers.

Each time the autonomous robot drops down to scan a crowded shelf using an onboard camera, the machine collects valuable data about the store’s ever-changing inventory.

What would take a person hours to accomplish — tediously checking shelves for missing or misplaced products — is accomplished in minutes by the tiny aircraft. Once finished, the drone uploads its findings to the cloud, setting a massive supply chain in motion and offering the store’s owners, and potentially brand manufacturers, the kind of precise data about shopping habits that has largely eluded brick-and-mortar stores.

It may sound like a sequence from some high-tech vision of the future, but the drone and the artificial intelligence behind it — created by an Austin-based startup and data subscription service called Pensa — already has been tested in multiple retail outlets and probably will begin appearing in grocery stores later this year.

Not so long ago, stepping inside a grocery store — with its canned goods, harsh lighting and outdated Muzak playlists — felt like going back in time. The industry’s business model had changed little over the past century. Now, experts say, the industry finds itself in the midst of a technological upheaval, one that is providing the public with a glimpse of a future far beyond self-service kiosks and online shopping.

Those changes are not without risk. As U.S. retail companies embrace automation, many experts believe that the impact on jobs will be significant, with some analysts predicting as many as 7.5 million retail workers could lose their jobs over the next decade. Yet the U.S. Bureau of Labor Statistics suggests the retail-sales labor force will grow over the decade between 2016 and 2026, though more slowly than average.

In recent months, Kroger, the nation’s largest grocer, introduced a new fleet of autonomous delivery vehicles, and Giant Food Stores rolled out a series of robotic assistants named “Marty” that scan shelves and identify hazardous spills. Last year, Kroger introduced a system called “Scan, Bag, Go” that allows customers to scan and pay for grocery items as they shop — with their smartphone.

Walmart customers recently have been able to order groceries using a Google assistant, joining Amazon-owned Whole Foods, which partnered with Amazon’s Echo last year so that customers can shop using voice commands.

By next year, Walmart — which also sells $200 billion worth of groceries each year and remains the world’s largest private employer with 1.5 million Americans on its payroll — plans to have autonomous floor-scrubbing robots at nearly half of its 4,700 U.S. stores, part of a major effort to upgrade its business by harnessing the convenience of intelligent machines.

Pensa CEO Richard Schwartz says it’s developments such as these that make grocery stores “ground zero” for the blurring of the online and offline worlds. He identified several forces within the industry that have resulted in a swelling of innovation:

Convenience: Busy lifestyles mean consumers increasingly expect companies to make the shopping experience frictionless so they can reclaim their time.

Experimentation: The combination of delivery, pickup and in-person shopping is challenging inventory and supply chains, forcing grocery chains to partner with robotics companies and introduce new forms of automation and high technology.

Disruption: Increasingly efficient online shopping means brick-and-mortar chains are under pressure to evolve.

“Amazon is right behind all of this, waking everybody up and basically challenging the industry to find an effective way to do that end-to-end delivery to the consumer with more combinations and more instant gratification,” Pensa said. (Amazon CEO and founder Jeff Bezos owns The Washington Post.)

He added: “Somehow, the future of retail has to marry that convenience with tighter control over knowing what’s available for sale and how much product should be in each location, without completely redesigning every store, everywhere, for every product, in order to compete and deliver effectively.”

There is perhaps no grocery seller embracing futuristic technology faster than Walmart, the retail juggernaut, which began using Oculus VR headsets to train employees at its nationwide academies in 2017.

At their recently opened “Intelligent Retail Lab” in Levittown, N.Y., the company has turned a 50,000-square-foot store into a mass experiment in new technologies. Using an array of cameras, sensors and processors, the artificially intelligent store automatically sends out-of-stock notifications to internal apps monitored by store employees.

The store has enough processing power to download three years’ worth of music (27,000 hours) each second, Walmart said.

“With technology performing mundane tasks like evaluating if shopping carts need to be corralled, associates will be able to spend more time on tasks humans can do best, such as helping customers or adding creative touches to merchandise displays,” the company said in a statement.

If that’s true, according to Erikka Knuti, the communications director at the United Food and Commercial Workers Union, then customers are going to respond positively to an influx of new technologies. The key, she said, is for businesses to take a hybrid approach that introduces useful technology while also enhancing customer service.

“If you think people don’t want to interact with somebody when they make their purchases, then you’re not reading the tea leaves,” Knuti said.

For a recent example of stores implementing technology poorly, Knuti pointed to Marty, the googly-eyed, 7-foot-tall robot patrolling grocery stores up and down the East Coast.

“People hate Marty,” Knuti said. “He moves around the store and people feel like he’s watching them. Small children and toddlers cry — he’s creepy!”

“If you’re looking at technology and innovation and not looking at improving the customer experience, it’s not really technology that’s going to move your business forward,” she added.